-
Notifications
You must be signed in to change notification settings - Fork 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
Reuse common logic and migrate CUDA >= 10.1 jobs to VS 2019 for Windo… #2264
Changes from 7 commits
6e2a07a
0ff0f0e
799c239
56c08b2
21c8e34
cd134d2
3e4326e
3d470bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@echo on | ||
|
||
set VC_VERSION_LOWER=16 | ||
set VC_VERSION_UPPER=17 | ||
if "%VC_YEAR%" == "2017" ( | ||
set VC_VERSION_LOWER=15 | ||
set VC_VERSION_UPPER=16 | ||
) | ||
|
||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to condense this as an extra Seems like it'd be better to do that instead of having it completely shell out to a separate script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not easy to share an environment between Bash and CMD, especially when you want to activate the env in CMD and get the env back in Bash. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I come up with an idea that we could create a utility to activate the env and do sth in CMD by passing arguments. |
||
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( | ||
set "VS15INSTALLDIR=%%i" | ||
set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" | ||
goto vswhere | ||
) | ||
) | ||
|
||
:vswhere | ||
if "%VSDEVCMD_ARGS%" == "" ( | ||
call "%VS15VCVARSALL%" x64 || exit /b 1 | ||
) else ( | ||
call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1 | ||
) | ||
|
||
@echo on | ||
|
||
set DISTUTILS_USE_SDK=1 | ||
|
||
python setup.py bdist_wheel || exit /b 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
$VS_DOWNLOAD_LINK = "https://aka.ms/vs/16/release/vs_buildtools.exe" | ||
$VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStudio.Workload.VCTools", | ||
"--add Microsoft.Component.MSBuild", | ||
"--add Microsoft.VisualStudio.Component.Roslyn.Compiler", | ||
"--add Microsoft.VisualStudio.Component.VC.CoreBuildTools", | ||
"--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest", | ||
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64") | ||
|
||
curl.exe --retry 3 -kL $VS_DOWNLOAD_LINK --output vs_installer.exe | ||
if ($LASTEXITCODE -ne 0) { | ||
echo "Download of the VS 2019 installer failed" | ||
exit 1 | ||
} | ||
|
||
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_INSTALL_ARGS -NoNewWindow -Wait -PassThru | ||
Remove-Item -Path vs_installer.exe -Force | ||
$exitCode = $process.ExitCode | ||
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) { | ||
echo "VS 2019 installer exited with code $exitCode, which should be one of [0, 3010]." | ||
exit 1 | ||
} |
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 might be a follow up PR but it'd be nice if this logic was just captured in a re-usable command or a script so that we don't have to copy / paste it everywhere
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.
Sounds reasonable. Will fix.