-
Notifications
You must be signed in to change notification settings - Fork 49
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
Setup MSVC environment in CI workflow #2942
Conversation
Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
CLFinder.py
in setup.py
cmd /c '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 && set' | ForEach-Object { | ||
if ($_ -match '^(.*?)=(.*)$') { | ||
[Environment]::SetEnvironmentVariable($matches[1], $matches[2]) | ||
} | ||
} |
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.
This should also work (and simpler).
cmd /c '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 && set' | ForEach-Object { | |
if ($_ -match '^(.*?)=(.*)$') { | |
[Environment]::SetEnvironmentVariable($matches[1], $matches[2]) | |
} | |
} | |
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" |
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.
Invoke-BatchFile is a non-standard extension which is not installed by default. I actually like that Anatoly found a solution that doesn't require installing it, we may want to use it instead. Also save environment variables into GITHUB_ENV for further steps.
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.
We install a lot of custom stuff to the runner image, including support for Invoke-BatchFile.
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've rolled back the last changes and am going to merge the version that was approved. Feel free to ask me to finish something, I can do it in a separate pull request.
Co-authored-by: Pavel Chekin <[email protected]>
Part of #2030 Part of #2824 For all other compilers the situation is about the same, it is expected that they are already in the paths. I don't think it should be any different for Windows. --------- Signed-off-by: Anatoly Myachev <[email protected]>
Part of #2030
Part of #2824
For all other compilers the situation is about the same, it is expected that they are already in the paths. I don't think it should be any different for Windows.