actions / runner-images

GitHub Actions runner images
MIT License
9.12k stars 2.82k forks source link

CMake cannot find PkgConfig on windows-latest images after the 20240407 update #9693

Closed GregDomzalski closed 2 weeks ago

GregDomzalski commented 2 weeks ago

Description

Our builds have suddenly started failing once the 20240407 Windows image update was pushed. Things were working fine on the 20240403 build.

I've filed an issue with vcpkg as well, in case it is their issue. However I have looked at the diffs between the commits used by each image and saw nothing that jumped out at me. https://github.com/microsoft/vcpkg/issues/38200

The build that succeeded has a mention of Strawberry Perl:

-- Found PkgConfig: C:/Strawberry/perl/bin/pkg-config.bat (found version "0.26")

This does not exist in the failed logs from 20240407 builds.

Platforms affected

Runner images affected

Image version and build link

20240407.1.0

Is it regression?

Yes; 20240403.1.0

Expected behavior

PkgConfig is found and the CMake / vcpkg build can complete.

Actual behavior

CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:114 (find_package_handle_standard_args)
  C:/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
  CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!

Repro steps

Please see repro steps in the linked vcpkg issue: https://github.com/microsoft/vcpkg/issues/38200

MaksimZhukov commented 2 weeks ago

Hello @GregDomzalski! Thank you for reporting the problem! Is it possible for you to provide a link to the public repository where the issue occurs?

GregDomzalski commented 2 weeks ago

Thanks for your replies. As this was originally from a private repository, it took me a little time to build a minimal repro.

Repro repository here: https://github.com/GregDomzalski/vcpkg-github-repro-20240407

A failed build run is here: https://github.com/GregDomzalski/vcpkg-github-repro-20240407/actions/runs/8710631351/job/23892943452

It looks to be specific to the *-windows-static triplets. I was unable to reproduce it with just x64-windows, for example - as seen here: https://github.com/GregDomzalski/vcpkg-github-repro-20240407/actions/runs/8709845222/job/23890424011

Both runs are on the new 20240414 GitHub Actions runner image with CMake 3.29.2...

It's unclear to me where the issue really is. All that I know was that things were working on the 20240403 build. Now they are not working 😄. I'm sure it's not the image itself per-se and probably a newer version of "something" that got pulled in. But I figured I would post this here for visibility and any help/ideas for narrowing the issue down.

sergei-pyshnoi commented 2 weeks ago

Hello @GregDomzalski . We do not installing PkgConfig on windows images by itself. Only like dependence for other packages. Also Its kind weird situation when find_package(PkgConfig REQUIRED) finds PkgConfig in perl dir. Anyway, as workaround you can download and install PkgConfig in runtime. For example using for it choco install pkgconfiglite . Here is your repro with successful build.

GregDomzalski commented 2 weeks ago

Thanks for reporting a workaround. I can fall back on this for the time being. It's looking like this may be an issue contained within the vcpkg ecosystem now that I've ruled out the CMake version and this can be reproduced outside of GitHub Actions.

Given this, I'm going to close this issue as it does not seem related to the runner image specifically.