-
Notifications
You must be signed in to change notification settings - Fork 990
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
Fix build scope OS detection in tools.microsoft.visual.VCVars #15568
Merged
memsharded
merged 4 commits into
conan-io:develop2
from
ravenexp:fix-vcvars-build-os-detect
Feb 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c6fa5f3
Fix build scope OS detection in tools.microsoft.visual.VCVars
ravenexp 25ac0f9
Merge branch 'develop2' into fix-vcvars-build-os-detect
memsharded 46924e7
fix: Change the VCVars build OS detection method
ravenexp 659260c
test: Add an integration test for the VCVars build OS detection
ravenexp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have recovered some tests that were pending to migrate after 1.X -> 2.0 migration, and that test will reveal that this is breaking, actually breaking a lot of users that build with Windows subsystems and
msvc
as compiler.I think we need to keep the
conanfile.settings.get_safe("os") == "Windows"
, and in any case we could consider adding theconanfile.settings_build.get_safe("os")==Windows
as an extra condition to avoid the Linux->Windows cross-build issueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the patch to additionally check
conanfile.settings_build.os
instead, as you suggest.I'm just wondering why
deduce_subsystem()
fails in this case, given that all other generators exceptVCVars
use this function instead of inspecting the settings directly. This could point at a hidden problem indeduce_subsystem()
itself.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that
deduce_subsystem()
returningmsys2
and still compiling withmsvc
and usingvcvars.bat
is a valid scenario.VCVars().generate()
should create aconanvcvars.bat
for this case too. Other generators are using thededuce_subsystem()
mostly to adapt paths, but not to decide if the generator is used or not.