Skip to content

Commit 3760272

Browse files
committed
Revert "Cleanup VS 2019 refs in pytorch (pytorch#145863)" (pytorch#152613)
This reverts commit b45e6fa. revert PRs: pytorch#145863 pytorch#145319 Pull Request resolved: pytorch#152613 Approved by: https://github.com/atalman, https://github.com/malfet
1 parent 1a3161a commit 3760272

File tree

7 files changed

+68
-4
lines changed

7 files changed

+68
-4
lines changed

.ci/pytorch/windows/internal/smoke_test.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ goto end
128128
:libtorch
129129
echo "install and test libtorch"
130130

131+
if "%VC_YEAR%" == "2019" powershell internal\vs2019_install.ps1
131132
if "%VC_YEAR%" == "2022" powershell internal\vs2022_install.ps1
132133

133134
if ERRORLEVEL 1 exit /b 1
@@ -139,6 +140,10 @@ pushd tmp\libtorch
139140

140141
set VC_VERSION_LOWER=17
141142
set VC_VERSION_UPPER=18
143+
IF "%VC_YEAR%" == "2019" (
144+
set VC_VERSION_LOWER=16
145+
set VC_VERSION_UPPER=17
146+
)
142147

143148
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 (
144149
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (

.ci/pytorch/windows/internal/static_lib_test.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ echo "install and test libtorch"
7070
pip install cmake
7171
echo "installing cmake"
7272

73+
if "%VC_YEAR%" == "2019" powershell internal\vs2019_install.ps1
7374
if "%VC_YEAR%" == "2022" powershell internal\vs2022_install.ps1
7475

7576
if ERRORLEVEL 1 exit /b 1
@@ -82,6 +83,10 @@ pushd tmp\libtorch
8283

8384
set VC_VERSION_LOWER=17
8485
set VC_VERSION_UPPER=18
86+
IF "%VC_YEAR%" == "2019" (
87+
set VC_VERSION_LOWER=16
88+
set VC_VERSION_UPPER=17
89+
)
8590

8691
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 (
8792
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (

.ci/pytorch/windows/internal/vc_install_helper.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
if "%VC_YEAR%" == "2019" powershell windows/internal/vs2019_install.ps1
12
if "%VC_YEAR%" == "2022" powershell windows/internal/vs2022_install.ps1
23

34
set VC_VERSION_LOWER=17
45
set VC_VERSION_UPPER=18
5-
6+
if "%VC_YEAR%" == "2019" (
7+
set VC_VERSION_LOWER=16
8+
set VC_VERSION_UPPER=17
9+
)
610

711
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do (
812
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# https://developercommunity.visualstudio.com/t/install-specific-version-of-vs-component/1142479
2+
# https://docs.microsoft.com/en-us/visualstudio/releases/2019/history#release-dates-and-build-numbers
3+
4+
# 16.8.6 BuildTools
5+
$VS_DOWNLOAD_LINK = "https://ossci-windows.s3.us-east-1.amazonaws.com/vs16.8.6_BuildTools.exe"
6+
$COLLECT_DOWNLOAD_LINK = "https://aka.ms/vscollect.exe"
7+
$VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStudio.Workload.VCTools",
8+
"--add Microsoft.Component.MSBuild",
9+
"--add Microsoft.VisualStudio.Component.Roslyn.Compiler",
10+
"--add Microsoft.VisualStudio.Component.TextTemplating",
11+
"--add Microsoft.VisualStudio.Component.VC.CoreIde",
12+
"--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
13+
"--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
14+
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
15+
"--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81")
16+
17+
curl.exe --retry 3 -kL $VS_DOWNLOAD_LINK --output vs_installer.exe
18+
if ($LASTEXITCODE -ne 0) {
19+
echo "Download of the VS 2019 Version 16.8.5 installer failed"
20+
exit 1
21+
}
22+
23+
if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe") {
24+
$existingPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -products "Microsoft.VisualStudio.Product.BuildTools" -version "[16, 17)" -property installationPath
25+
if ($existingPath -ne $null) {
26+
if (!${env:CIRCLECI}) {
27+
echo "Found correctly versioned existing BuildTools installation in $existingPath"
28+
exit 0
29+
}
30+
echo "Found existing BuildTools installation in $existingPath, keeping it"
31+
}
32+
}
33+
34+
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_INSTALL_ARGS -NoNewWindow -Wait -PassThru
35+
Remove-Item -Path vs_installer.exe -Force
36+
$exitCode = $process.ExitCode
37+
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
38+
echo "VS 2019 installer exited with code $exitCode, which should be one of [0, 3010]."
39+
curl.exe --retry 3 -kL $COLLECT_DOWNLOAD_LINK --output Collect.exe
40+
if ($LASTEXITCODE -ne 0) {
41+
echo "Download of the VS Collect tool failed."
42+
exit 1
43+
}
44+
Start-Process "${PWD}\Collect.exe" -NoNewWindow -Wait -PassThru
45+
New-Item -Path "C:\w\build-results" -ItemType "directory" -Force
46+
Copy-Item -Path "C:\Users\${env:USERNAME}\AppData\Local\Temp\vslogs.zip" -Destination "C:\w\build-results\"
47+
exit 1
48+
}

.circleci/scripts/binary_windows_build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ export CUDA_VERSION="${DESIRED_CUDA/cu/}"
88
export USE_SCCACHE=1
99
export SCCACHE_BUCKET=ossci-compiler-cache
1010
export SCCACHE_IGNORE_SERVER_IO_ERROR=1
11-
export VC_YEAR=2022
11+
export VC_YEAR=2019
1212

1313
if [[ "$DESIRED_CUDA" == 'xpu' ]]; then
14+
export VC_YEAR=2022
1415
export USE_SCCACHE=0
1516
export XPU_VERSION=2025.0
1617
export XPU_ENABLE_KINETO=1

.circleci/scripts/binary_windows_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ set -eux -o pipefail
44
source "${BINARY_ENV_FILE:-/c/w/env}"
55

66
export CUDA_VERSION="${DESIRED_CUDA/cu/}"
7-
export VC_YEAR=2022
7+
export VC_YEAR=2019
88

99
if [[ "$DESIRED_CUDA" == 'xpu' ]]; then
10+
export VC_YEAR=2022
1011
export XPU_VERSION=2025.0
1112
fi
1213

.github/ISSUE_TEMPLATE/disable-ci-jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "DISABLED [WORKFLOW_NAME] / [PLATFORM_NAME] / [JOB_NAME]"
55
labels: "module: ci"
66
---
77

8-
> For example, DISABLED pull / win-vs2022-cpu-py3 / test (default). Once
8+
> For example, DISABLED pull / win-vs2019-cpu-py3 / test (default). Once
99
> created, the job will be disabled within 15 minutes. You can check the
1010
> list of disabled jobs at https://ossci-metrics.s3.amazonaws.com/disabled-jobs.json
1111

0 commit comments

Comments
 (0)