-
Notifications
You must be signed in to change notification settings - Fork 337
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
Visual Studio Build Tools prompt invocation is broken. #483
Comments
I was wrangling Jira on our side and this one is still not working as of Rez 2.47.2. |
I can not reproduce the problem. Can you share the contents of vs_buildtools and the location of vcvars64? I created a package with I can run any of these commands just fine:
|
Hi, Here are some repro steps:
All the Visual Studio environment variables are not present too with the first invocation call. For reference, our |
Maybe this is a misunderstanding of the
... will resolve the environment, create a subprocess/shell with this environment, run the This means that all the variable you would want to have will be gone after the execution.
However this will only work for the single command (your build entry point?). If you want to just evaluate the context on your current shell you probably want to evaluate the resulting .bat file. I am not sure how to do it without a temporary file but this should work:
Let me know if this works for you. |
As far as I remember, it was not exiting the Visual Studio command prompt before we moved to 2.16.0, as a result, you would get inside the prompt and ready to use it. |
If it did not it just may mean that it was broken before. It definitely is behaving correctly now to my best knowledge. To demonstrate I reduced your output.
This is keeping the shell open within the evaluated environment
Rez was designed to work like this so that you could clean up environments properly. It should work like this across any OS and shell. Sorry for the confusion. |
To be fair, from a user standpoint, I don't know if it is the behaviour you would expect naturally. Keep in mind that I'm purposely ignoring technical constraints here, but:
|
I was maybe missing some context here, sorry for that. I think what might be happening is that we hit a limitation in cmd. If I recall correctly we can either have the shell being kept open when calling a batch file via cmd as in your case illustrated here - but then rez env would always not close and we need to ... which I had to revert in 07d07cc
I don't think we can fix it other then pressing Microsoft to finally convert their build environment to PowerShell. But I'll try to clarify and look into it next week. Maybe there is a way that we all have missed so far. I wonder if something along this might work as a more sensible workaround (untested I don't use Windows beyond work):
This might also interest you: Let's see if we can find a way. Again sorry for the confusion. |
Would be surely the way to go, it just does not feel natural. I can see how it is a tricky situation, Windows is full of quirks like that. Just spent my afternoon on #752 :) |
Bumping this buy back into view. In general I tend to suggest people to move away from |
Hi,
I just noticed that lately and this seems to be happening since we moved to Rez 2.16.0 last year but invoking the Visual Studio Build Tools prompt (2015 or 2017) is currently busted.
I noticed it because I did not have cl and dumpbin when invoking the prompt. Before when issuing:
I was put in the Visual Studio Build Tools 2017 prompt and had access to cl, etc... Now I actually need to do it staged:
Waiting for CMD prompt and then:
To properly spawn the Visual Studio Build Tools 2017 prompt.
I'm not exactly sure what is the issue, probably usual Windows pain but I wanted to flag it.
Cheers,
Thomas
The text was updated successfully, but these errors were encountered: