Fix #19423: Add VSCMD_VER guard to conanvcvars.bat - #20223
Open
anushkagupta200615-jpg wants to merge 2 commits into
Open
Fix #19423: Add VSCMD_VER guard to conanvcvars.bat#20223anushkagupta200615-jpg wants to merge 2 commits into
anushkagupta200615-jpg wants to merge 2 commits into
Conversation
memsharded
reviewed
Jul 28, 2026
memsharded
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution.
This would be a duplicate of #19424
I did a review there and shared some concerns in #19424 (review). I think this change can be risky and break some users.
I think the conversation should be followed up in that PR, not open a new one, I suggest closing this one and commenting in that other PR.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog: Fix:
VCVarsgenerator now skips callingvcvarsall.batif it is already active to prevent%PATH%length crashes on repeated activations.Docs: N/A
Fixes [bug] conanvcvars.bat should activate only once, since it can't be deactivated. #19423
The generated
conanvcvars.batblindly called Microsoft'svcvarsall.batevery timeconanbuild.batwas executed. Because Microsoft's scripts are not idempotent and have no real deactivation mechanism, repeated activations appended duplicate entries to%PATH%. This eventually caused the environment to hit the Windows character limit and crash. The generated scripts (.batand.ps1) now include a guard that checksVSCMD_VERto skip activation if the Visual Studio developer environment is already active.developbranch, documenting this one.