I want to use VCPKG_DISABLE_COMPILER_TRACKING along with compiler checks #37399
tsondergaard
started this conversation in
General
Replies: 3 comments 2 replies
-
Use a toolchain to hardcode |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Neumann-A, thanks for the quick answer. What would that look like? My
So the CMAKE_TOOLCHAIN_FILE I specify is the vcpkg.cmake supplied one. Can I specify an additional toolchain file somehow? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Sounds like another use-case for microsoft/vcpkg-tool#816 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Vcpkg ABI hash will change when the compiler is changed even if it is just a revision update from e.g gcc 11.4.1 to 11.4.2. This can be a big problem if your dependencies takes hours to compile and you allow developers to update their compilers independently. With #17526 we got VCPKG_DISABLE_COMPILER_TRACKING, but that turns compiler tracking completely off. What I would like is to be able to use VCPKG_DISABLE_COMPILER_TRACKING, but still tag the ABI hash with some compiler related information. I believe I can do that by simply putting compiler related information in my triplet. Say for instance I want to define x64-linux-gcc-11.cmake it could be done like this, I think:
This mostly works for me, except MY_COMPILER and MY_COMPILER_VERSION are not actually read by anything, it is just added to the triplet, which if I understand it correctly is enough to ensure that it gets a different ABI hash.
Since it is not read by anything it is entirely possible that a build could use this triplet with gcc 13 and then I get my cache populated with gcc 13 generated code, which is not what I want.
Is there are possibility to add inject triplet related checks somewhere?
The triplet itself is a .cmake file. What context is it executed in? Could the triplet itself inject additional code that adds the compiler check? I imagine I don't want to add code to the triplet itself as any changes to that code would affect the ABI hash, right?
How is the ABI hash contribution derived from the triplet file? Is it just the hash of the raw bytes of the file including whitespace and all?
Beta Was this translation helpful? Give feedback.
All reactions