Closed GregDomzalski closed 1 week ago
Adding PkgConfig as an explicit dependency.
Installing PkgConfig using
vcpkg install
.Confirming PkgConfig exe is in the vcpkg build tree (it is).
It is not clear what you mean by "PkgConfig" here. The only port which provides a suitable implementation is called pkgconf
.
If you want to use it, remember to request it with "host": true
.
last successful build used the 20240403 image. Builds began failing in the next update 20240407.
Note that 20240407 comes with CMake 3.29.1. This version builds many ports incorrectly, #37968.
Apologies - your interpretation is correct, I misspoke and meant to say that I had tried to use pkgconf
in case that could aid in resolving the issue.
I did not know about the "host": true
. I may try that.
However it does seem very plausible that this is simply another manifestation of #37968. Thank you for alerting me to that issue.
It looks like the next GitHub actions runner image in the release queue updates to CMake 3.29.2. I can see if manually updating to 3.29.2 (or downgrading to 3.28.x) will resolve this. If so, I will close this issue out.
Thank you for your quick reply.
I've tried both actions mentioned in the other thread for updating to CMake 3.29.2. Both seem to successfully update, but neither have addressed the issue I'm facing.
I should also note that building x64-osx, arm64-osx works just fine. It's only the windows triplets that are giving me trouble.
CMake was only a side note, to avoid the next trouble.
The triplet compiled by your test program is arm64-windows-static, but the libusb you installed is x86-windows-static. You need to install libusb:arm64-windows-static.
The triplet compiled by your test program is arm64-windows-static, but the libusb you installed is x86-windows-static. You need to install libusb:arm64-windows-static.
Well, the request is for arm64, but not for static. The first cmake command line is for arm64, the second one and the output are not.
And now I see that the host (x64-windows) pkgconf is already installed as a dependency...
The triplet compiled by your test program is arm64-windows-static, but the libusb you installed is x86-windows-static. You need to install libusb:arm64-windows-static.
Right. Sorry - I pulled logs from a private repo that cross builds x64 and arm64. The arm64 host is my local development machine, the x64 host is the GitHub CI runner. Both hosts will build both target triplets. Both hosts fail with the same error above, so I thought I could just grab either of the logs.
To avoid anymore confusion, I think what I will do is create a minimal repro in a public repository and use that from now on. That way anyone can try it out.
I really appreciate you all looking, and I apologize if I've wasted any of your time by trying to save a few minutes of mine. :disappointed: I'll post back once I have the public repo/repro available.
OK. I have created a 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...
The log diffs look pretty much identical except for the timings and hashes on certain lines.
Let me know if there are any additional files or logs that would be helpful.
You need to set PKG_CONFIG_EXECUTABLE in cmakelists.txt, for example: set(PKG_CONFIG_EXECUTABLE "${VCPKG_INSTALLED_DIR}/x64-windows/tools/pkgconf/pkgconf.exe")
If port pkgconf
is properly installed via vcpkg, then the vcpkg.cmake
toolchain should already make it discoverable to find_package(PkgConfig)
by its settings to CMAKE_PROGRAM_PATH
.
@dg0yt is right. This tool is automatically discovered for other triplets. The *-static triplets also previously worked like this but now do not. @jimwang118 this does seem like a regression somewhere. Not saying that it's necessarily the libusb port itself. But something has recently changed where this used to work and now it does not.
I don't think it is very much related to particular triplets. However, the default triplet is x64-windows
. x64-windows-static
is a (vcpkg) cross build when building ports.
But the toolchain is stupid. It doesn't treat x64-windows-static
as a cross build (and enable VCPKG_CAN_USE_HOST_TOOLS
) when building the user project unless the user sets VCPKG_HOST_TRIPLET
.
Couldn't the toolchain be a little bit smarter? Wait... somebody tried with https://github.com/microsoft/vcpkg/pull/25529.
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
Operating system
Windows Server 2022 10.0.20348
Compiler
MSVC
Steps to reproduce the behavior
Failure logs
cmake -S . -B build_out/cmake/win-x86 -A Win32 -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -DRID=win-x86
Additional context
This is failing for me both locally and in the latest GitHub Actions (windows-latest) runner. Last successful build used the 20240403 image. Builds began failing in the next update 20240407.
I've tried:
vcpkg install
.I have compared the logs from our internal builds - it seems that in the older build there is an extra line mentioning Strawberry Perl being present and it finding PkgConfig via that. That line is missing in the failure logs.