[vcpkg.cmake] Support VCPKG_BUILD_TYPE triplets with VCPKG_APPLOCAL_DEPS#30059
[vcpkg.cmake] Support VCPKG_BUILD_TYPE triplets with VCPKG_APPLOCAL_DEPS#30059rpjohnst wants to merge 3 commits intomicrosoft:masterfrom
VCPKG_BUILD_TYPE triplets with VCPKG_APPLOCAL_DEPS#30059Conversation
VCPKG_BUILD_TYPE triplets with VCPKG_APPLOCAL_DEPSVCPKG_BUILD_TYPE triplets with VCPKG_APPLOCAL_DEPS
c8edd76 to
8dc1276
Compare
|
Not sure what's going on with the CLA check- it neither finished nor commented here. |
scripts/buildsystems/vcpkg.cmake
Outdated
There was a problem hiding this comment.
Shouldn't the argument remain quoted?
scripts/buildsystems/vcpkg.cmake
Outdated
scripts/buildsystems/vcpkg.cmake
Outdated
scripts/buildsystems/vcpkg.cmake
Outdated
There was a problem hiding this comment.
IIUC this will add , to the list of characters which must not be used in file paths.
There was a problem hiding this comment.
I've reworked this to use separate arguments to applocal.ps1 rather than a PowerShell array. This should also resolve the quoting issues, given the use of VERBATIM.
The solution for the X_VCPKG_APPLOCAL_DEPS_INSTALL is a bit less robust, but I'm not really sure how to accomplish this perfectly given the use of install(CODE ...).
16a12d5 to
d26eb07
Compare
d26eb07 to
0a97440
Compare
|
I'm a bit stuck on this arm64 failure. The error that does exist in the logs that got uploaded makes it look like Does anyone have any suggestions on better ways to debug this? Edit: Hm, GitHub is showing me that arm64_windows actually passed on commit 0a97440, and the failure started with the merge from master. But I don't see any changes to the failing |
@rpjohnst, I can help you test locally, could you please tell me how to test it? |
|
@JonLiu1993 Sure, thanks! At this point I'm mostly wondering if a local build of |
|
Rather than assuming `$<CONFIG:Debug>` implies a `debug/` installed directory, handle this like `CMAKE_FIND_ROOT_PATH`: applocal.ps1 now accepts an array of directories to search for dependencies.
2bc8fac to
ee7ff86
Compare
|
I'm not convinced that this is the correct behavior:
I can see an argument for a "I am a release only triplet please only check release locations for me" but that wouldn't ever introduce 'try one and then the other' behavior. Tagging vcpkg-team-review for other maintainers to look at... |
|
I will be converting your PR to draft status. The above suggested changes are only recommendations. If you are willing to adopt them, please click "ready for review" after making the modifications. If you do not wish to make any changes, please click "ready for review" directly. That way, I can be aware that you've responded since you can't modify the tags. |
|
@dan-shaw @ras0219-msft @JavierMatosD @vicroms and I discussed this today. We affirm that this feature makes sense, but that this implementation has problems. In particular, "try one then fallback to the other" is not the correct behavior, at least on Windows.
Don't forget to address this if you decide to pick this back up (the part that tries to add This might require the user explicitly telling us that they want no-debug behavior. (Which might already happen with: <PropertyGroup>
<VcpkgConfiguration>Release</VcpkgConfiguration>
</PropertyGroup>) |
|
I probably won't have time to work on this in the near future, but some context on that issue in case anyone wants to pick it up (or for future me): I went with the fallback approach based on how vcpkg/scripts/buildsystems/vcpkg.cmake Lines 411 to 428 in dcef3d5 CMAKE_BUILD_TYPE, which supports single-build-type triplets via fallback built into CMake and toolchains.
In normal operation with both a build and release directory however, there actually is not supposed to be any really granular fallback going on, because both directories have the relevant files. So this may already be an issue if, for example, only one of the debug or release directories gets a generated file, and the other build type is supposed to search a different directory or not use it at all. (Probably not a common way to design a library, or this would have come up before.) The reason I used this to replace the |
|
Closing this PR since it seems that no progress is being made. Please ping us to reopen if work is still being done. |
A triplet that sets
VCPKG_BUILD_TYPEwill (ports permitting) only have one set of installed files, rather than one for debug and one for release. TheVCPKG_APPLOCAL_DEPSoption copies installed libraries into the build directory, but uses a$<CONFIG:Debug>generator expression to decide which set of files to use, which leads to silent failures on these triplets.(I realized this when GTest test discovery started failing after I switched from
x64-windowstox64-windows-release, because it runs the test binary from its position in the build directory, but the gtest DLLs were no longer present. A similar problem, this one outside of vcpkg's control, is that DLL dependencies built in the same CMake build can easily wind up in different build subdirectories...)Rather than assuming
$<CONFIG:Debug>implies adebug/installed directory, handle this likeCMAKE_FIND_ROOT_PATH: Pass both variants of the installedbindirectory toapplocal.ps1, and let it check both of them in the appropriate order.