-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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.cmake toolchain file not using triplet environment variables #23607
Comments
cc @dg0yt |
|
Can't repro in x86-windows triplet. |
... shows no indication of x64-windows.
Ensure that vscode uses the same values of the environment variables. The In the end, I think this is a VS Code context problem. vcpkg.cmake does use the environment variables as expected, but it does not see the variable value you expect it to see. Maybe it is easier if you skip 5. and start with manifest mode. This will ensure the right dependencies for your project's triplet. |
That completely misses the point of the issue report, which is that the
It's not my fault that
It's not vscode, it's This log file is conclusive proof that |
Update - I've dug into your
It would probably be better to replace the |
Let's take a step back and look at the documentation:
|
This is why I ultimately suggested the
Hold on, I'm pretty sure that's not how CMake cache variables work. Cache variables do not change after the cache is populated during configure, even when you re-run the configure step. The only ways they can change after cache creation are:
|
That's why I'm saying. A cache variable is suited to make the triplet choice permanent enough. |
I'm confused then how anything I've suggested contradicts that. Anyway, what about my |
It should be considered but would need to deal with the actual value. IMO there are three options when
Background:
|
It should probably be noted that the three options listed don't have to be mutually exclusive, as it would be possible to implement cascading logic that checks two or even all three of these conditions in some order of preference. |
The initial wording was "alternatives", but I changed that to "options" before posting ;-) |
I am adding Mingw detection to project_options. My code invokes an external CMake process. Then in the current CMake process, I parse the CMakeCache.txt file to detect the compiler and its architecture. However, I noticed that vcpkg doesn't respect How can I change this to use the static toolchain (if the license allows)? |
While created independent of this issue, #25529 might resolve the issue. |
This seems like it might be a viable implementation of the third bullet under your previous list of options, as $ vcpkg z-print-config
{
"buildtrees": "C:\\msys64\\opt\\vcpkg\\buildtrees",
"default_triplet": "x64-mingw-dynamic",
"downloads": "C:\\msys64\\opt\\vcpkg\\downloads",
"host_triplet": "x64-mingw-dynamic",
"installed": "C:\\msys64\\opt\\vcpkg\\installed",
"manifest_mode_enabled": false,
"packages": "C:\\msys64\\opt\\vcpkg\\packages",
"tools": "C:\\msys64\\opt\\vcpkg\\downloads\\tools",
"vcpkg_root": "C:\\msys64\\opt\\vcpkg",
"versions_output": "C:\\msys64\\opt\\vcpkg\\buildtrees\\versioning_\\versions"
} Of course, this is because I have set the environment variables like so:
...and unsetting them reverts Note that the proposed change does not address the likelihood that it's physically impossible for the |
That's because the tool chain script doesn't bother to log its triplet
determination. As I mentioned in my report, however, it recorded in my cake
cache that it had erroneously chosen the x64-windows triplet.
vscode was launched from a mingw64 msys2 shell specifically so that those
environment variables would be present. Is this not sufficient?
…On Thu, Mar 17, 2022, 1:44 AM Kai Pastor ***@***.***> wrote:
*Failure logs*
log.txt <https://github.com/microsoft/vcpkg/files/8282013/log.txt>
... shows no indication of x64-windows.
4. edit vscode cmake-tools config to use vcpkg toolchain file
Ensure that vscode uses the same values of the environment variables. The export
... instructions affect the shell session only, at everything which is
started within that session.
In the end, I think this is a VS Code setup problem. vcpkg.cmake does use
the environment variables as expected, but it does not see the variable
value you expect it to see.
Maybe it is easier if you skip 5. and start with manifest mode. This will
ensure the right dependencies for your project's triplet.
—
Reply to this email directly, view it on GitHub
<#23607 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2TC4K4QO57NQO22KI253VALWFBANCNFSM5Q577QIA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
As described in the issue details and reproduction steps, this is
specifically about trying to get gcpkg to use the mingw triplet.
Testing against x86-windows triplet is not a valid method to reproduce the
issue.
…On Wed, Mar 16, 2022, 11:53 PM Jack·Boos·Yu ***@***.***> wrote:
Can't repro in x86-windows triplet.
—
Reply to this email directly, view it on GitHub
<#23607 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2TC5OEZRYSHGPGDY2XNDVALJIFANCNFSM5Q577QIA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This issue hasn’t been updated in 3 month, if it is still an issue, please reopen this issue. |
@JonLiu1993 Look, this issue is still relevant |
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. |
Closing and unsubscribing due to badgering by user hostile bot. You've had almost 3 years to address this. It's not my fault that nobody cares. |
I think we should consider this case and this is NOT a community triplet issue. |
Describe the bug
Documentation for using vcpkg with MinGW at https://github.com/microsoft/vcpkg/blob/master/docs/users/mingw.md says to define the following environment variables to point it to the correct triplet for the compiler:
Having done this, the
vcpkg/scripts/buildsystems/vcpkg.cmake
toolchain file still internally determines a triplet ofx64-windows
which it stores in my CMakeCache.txt like so:The toolchain file should honor the environment variable setting! Having to set and environment variable and muck around with overriding CMake variables is terrible. This should also be mentioned in the article at https://github.com/microsoft/vcpkg/blob/master/docs/users/mingw.md because as written, those instructions don't get you to a working environment.
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
CMake configure succeeds in finding and configuring libtcod import target.
Failure logs
log.txt
Additional context
I was able to prove that
VCPKG_TARGET_TRIPLET:STRING=x64-windows
is the problem by manually changing the cache file setting toVCPKG_TARGET_TRIPLET:STRING=x64-mingw-dynamic
.The text was updated successfully, but these errors were encountered: