Bizarre chocolatey Doxygen issue after Windows Server 2022 20220619.1 image update #26278
-
I don’t really expect help with this given how nebulous the problem is, but I figured I’d put it out there just in case since this will likely take a problematically long time to figure out. For one of my projects I use actions on GitHub hosted runners to handle CI/CD. This project makes use of Doxygen, which does not come by default with the Windows Server 2022 image. So, with that in mind, here is a simplified version of the job that performs the main build for this project
This was working fine. What started happening is that, at first intermittently, documentation would fail to build on the Windows Server 2022 hosts. Checking the logs, when CMake ran I see that instead of the usual: I see: and then the build later fails because of Doxygen features I use that were added after 1.9.1. I first assumed that something must have happened with the chocolatey package, but it hasn’t been touched and the logs for that Doxygen installation step are nearly identical (other than run-to-run variance) between the runs that see the right version vs. the wrong version. It shows the setup executable for 1.9.4 being ran in both cases. So all-in-all I’m not sure what’s up with the path change. Needless to say I was thoroughly confused, but decided to focus on the fact that at first this problem started happening sporadically, yet as of now happens every time. I even have a single run where the first path of the Windows build matrix found the correct Doxygen version and the second path found the wrong Doxygen version. After some cross-referencing, I was able to figure out a consistent demarcation point: It seems that these mixed success runs happened to occur during the rollout of the 100% of the runs where CMake found the correct version of Doxygen (1.9.4) occurred on a runner with My workflow has not been altered at all during any of this, especially evident by the fact this correlation of Windows Server 2022 image version was observed during a single matrix run as noted earlier. Figuring that some related tool must have been changed with the
Updating readme file for win22 version 20220619.1 (#5783)
Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-aut…hored-by: Actions service account <no-reply@github.com> Chocolatey wasn’t updated, CMake wasn’t updated, Powershell wasn’t updated, even the build of Windows Server 2022 wasn’t updated. The only things that were updated that are even within the same universe of relevance were:
But vcpkg should have no bearing on any of this unless its somehow used indirectly by something else, and I really doubt that a new Windows SDK version would cause such an issue (I’d hope), and I don’t even think it’s used by default. I changed my I’m fairly lost here. This basically just doesn’t make sense. I don’t supposed anyone has a clue as to what’s going on. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Ok, I still need to dig much deeper, but I’m onto something. Mingw was updated as part of that image update, quite a number of versions I might add, and it seems to be installed via chocolatey actually. By default, even before Doxygen is installed via my script, there exists a choco shim at What’s still strange is why the install of the Doxygen package still can’t be picked up by CMake. Even if theres some issue where the custom install is unable to overwrite the existing shim, it shouldn’t matter as before this image version FindDoxygen had no issue locating it at EDIT: Hopefully I can figure out why it breaks detection of the separate Doxygen package. |
Beta Was this translation helpful? Give feedback.
-
Alright I cracked it. There are several things going on here, but ultimately it is mostly a CMake issue. When calling
The following is an extremely simplified overview of the search process for
Unlike Basically, CMake does not handle having multiple versions of Doxygen installed gracefully, even when a version requirement should theoretically disambiguate them. Well, due to the way the above call is structured, the standalone version of Doxygen on chocolatey is found on the system via its uninstall entry in the registry, as specified under the PATHS option. The shim of the version included with mingw on chocolatey is located via the system PATH environment variable that chocolatey adds by default: Unfortunately, as can been see in the above search order, the system PATH variable has a higher precedence than the PATHS option of the FindDoxygen command, so by default, unassisted calls to While in the long run there has to be a better way (which unfortunately will likely require CMake to implement FindDoxygen.cmake in a way that can handle checking multiple installs for a specific version), currently this can be worked around by:
Personally I find it annoying that the chocolatey distro of mingw comes with a build of Doxygen since a newer one is readily available within chocolatey already, but ultimately that isn’t the root issue. In the end this wasn’t an Actions problem at all, but I have to imagine at least one other person was affected by this change. |
Beta Was this translation helpful? Give feedback.
Alright I cracked it.
There are several things going on here, but ultimately it is mostly a CMake issue.
When calling
find_package(Doxygen...
in CMake, the build-in FindDoxygen.cmake module is called, which in turn attempts to locate Doxygen using the following: