-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vcpkg adds target rather than host paths to CMAKE_PROGRAM_PATH #30220
Comments
It would appear that this bug only occurs if you let vcpkg determine the host triplet. If you explicitly set |
The relevant logic appears to be vcpkg/scripts/buildsystems/vcpkg.cmake Lines 544 to 556 in a7b6122
CMAKE_PROGRAM_PATH ).
CC: @Neumann-A |
Related: #25529 |
So I assume it works ;) In the end it comes down to CMake itself being ambiguous what |
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment. |
Eh, why auto-stale an open, unresolved issue? |
So a solution would be to rebuilt the host triplet selection in vcpkg.cmake or call |
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment. |
Describe the bug
Calls to
find_program()
are generally going to want to find executables that can run on the host, not on the target architecture. At the moment, vcpkg adds thetools
directory of the target triplet install area toCMAKE_PROGRAM_PATH
, but not thetools
directory of the host triplet's install area. When adding a host dependency that provides a tool (in my case the motivating example are things likeccache
andsccache
, which we are experimenting with providing via a private vcpkg registry), those tools are not able to be found due toCMAKE_PROGRAM_PATH
not including the subdirectories under the host triplet'stools
area.I think adding the target triplet's
tools
subdirectories toCMAKE_PROGRAM_PATH
is questionable, but not adding the host triplet'stools
subdirectories definitely looks like a bug to me. It is currently breaking some of our projects that want to provide command line tools when using a custom target triplet.Don't focus on the
ccache
andsccache
part of this, I only use those as examples. There are other problems we are uncovering with trying to have those as host dependencies, but we will follow that up in separate issues and discussions. The bug report here is focused on incorrect population of theCMAKE_PROGRAM_PATH
variable.Environment
To Reproduce
Steps to reproduce the behavior:
find_program()
call for that command line tool.Observe that the tool will not be found, even though vcpkg provides it in the host triplet's install area.
Expected behavior
Calls to
find_program()
should succeed when a host dependency provides the requested tool.The text was updated successfully, but these errors were encountered: