Skip to content
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

Document VCPKG_USE_HOST_TOOLS #306

Merged
merged 4 commits into from
Jul 12, 2024
Merged

Conversation

vicroms
Copy link
Member

@vicroms vicroms commented Apr 8, 2024

No description provided.

This comment was marked as outdated.

vcpkg/users/triplets.md Outdated Show resolved Hide resolved
@vicroms vicroms marked this pull request as draft April 9, 2024 21:15
Copy link
Contributor

Learn Build status updates of commit b920e3e:

✅ Validation status: passed

File Status Preview URL Details
vcpkg/users/host-dependencies.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@vicroms vicroms marked this pull request as ready for review May 20, 2024 16:29
Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not very clear to me that VCPKG_USE_HOST_TOOLS goes in the user's CMakeLists.txt from this text but I think this is better than the status quo.

@dg0yt
Copy link
Contributor

dg0yt commented May 29, 2024

IMO this option shouldn't exist. If vcpkg is a using a different host triplet, it must use that triplet for CMAKE_PROGRAM_PATH.
microsoft/vcpkg#25529

@Neumann-A
Copy link
Contributor

IMO this option shouldn't exist. If vcpkg is a using a different host triplet, it must use that triplet for CMAKE_PROGRAM_PATH.

Isn't that how it works? If the host triplet is set VCPKG_USE_HOST_TOOLS should be true.

@dg0yt
Copy link
Contributor

dg0yt commented May 29, 2024

Isn't that how it works? If the host triplet is set VCPKG_USE_HOST_TOOLS should be true.

Yes. "IF THE HOST TRIPLET IS SET".

The problem is that if the user only sets VCPKG_TARGET_TRIPLET, the vcpkg tool makes independent (and valid) decisions about the host triplet. But the user project isn't informed about them.

microsoft/vcpkg#25529 solved the missing link for CMake.
https://github.com/microsoft/vcpkg/pull/25529/files#r932552438 requested the same for msbuild. But nobody contributed a proposal.

@Neumann-A
Copy link
Contributor

The problem is that if the user only sets VCPKG_TARGET_TRIPLET, the vcpkg tool makes independent (and valid) decisions about the host triplet. But the user project isn't informed about them.

That was discussed when the variables where introduce. The maintainers wanted to keep the old behavior if VCPKG_HOST_TRIPLET is not set. In my opinion vcpkg.cmake should be changed so that VCPKG_HOST_TRIPLET is the main variable and VCPKG_TTARGET_TRIPLET is the optional one.

@dg0yt
Copy link
Contributor

dg0yt commented May 29, 2024

In my opinion vcpkg.cmake should be changed so that VCPKG_HOST_TRIPLET is the main variable and VCPKG_TTARGET_TRIPLET is the optional one.

I don't agree.
It is expected that a build system can sufficiently discover the host system (VCPKG_HOST_TRIPLET).
It is expected that a build system must be told to build for a different target (VCPKG_TARGET_TRIPLET).
It is unexpected that a buildsystem needs redundant information about target and host (user project vs. integrated vcpkg)

@Neumann-A
Copy link
Contributor

It is expected that a build system can sufficiently discover the host system (VCPKG_HOST_TRIPLET).

I would agree with that if there would be one correct one and not N. There have been M issues about why vcpkg builds stuff twice if it is considered a native build. The only triplet env variable I have set is VCPKG_DEFAULT_HOST_TRIPLET. If it is not I would set --host-triplet instead of --triplet.
The root problem by setting VCPKG_TARGET_TRIPLET is that the tool does not know if it is a cross build or not and the result thus can be both. Maybe a new variable like VCPKG_TRIPLET is needed to tell that it is a native build with that triplet and everything else is considered a cross build.

@dg0yt
Copy link
Contributor

dg0yt commented May 29, 2024

Let's move the focus back to VPCKG_USE_HOST_TOOLS. The key point is that this doesn't need to be documented or set by the user. The vcpkg toolchain must ensure a match between toolchain configuration and vcpkg tool decisions.

Copy link
Contributor

Learn Build status updates of commit a13a2a7:

✅ Validation status: passed

File Status Preview URL Details
vcpkg/users/host-dependencies.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 91822a3:

✅ Validation status: passed

File Status Preview URL Details
vcpkg/users/host-dependencies.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@AugP AugP merged commit 4cf5208 into microsoft:main Jul 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants