Skip to content

Commit 7aaf0ff

Browse files
authored
[WIP] Create build_wheels_windows.yml (#1101)
* Create build_wheels_windows.yml * Create vc_env_helper.bat * Update build_wheels_windows.yml * Update build_wheels_windows.yml * Update vc_env_helper.bat * Update vc_env_helper.bat * Update vc_env_helper.bat * Update build_wheels_windows.yml
1 parent 7849875 commit 7aaf0ff

File tree

2 files changed

+105
-0
lines changed

2 files changed

+105
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build Windows Wheels
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- build/packaging/**
7+
- .github/workflows/build_wheels_windows.yml
8+
- setup.py
9+
push:
10+
branches:
11+
- nightly
12+
- main
13+
- release/*
14+
tags:
15+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
16+
# Release candidate tags look like: v1.11.0-rc1
17+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
18+
schedule:
19+
- cron: '0 0 * * *' # Runs at midnight UTC every day
20+
workflow_dispatch:
21+
22+
permissions:
23+
id-token: write
24+
contents: read
25+
26+
jobs:
27+
generate-matrix:
28+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
29+
with:
30+
package-type: wheel
31+
os: windows
32+
test-infra-repository: pytorch/test-infra
33+
test-infra-ref: main
34+
with-xpu: enable
35+
with-cuda: disable
36+
37+
build:
38+
needs: generate-matrix
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
- repository: pytorch/ao
44+
pre-script: packaging/pre_build_script.sh
45+
env-script: packaging/vc_env_helper.bat
46+
# post-script: "python packaging/wheel/relocate.py"
47+
smoke-test-script: packaging/smoke_test.py
48+
package-name: torchao
49+
name: ${{ matrix.repository }}
50+
uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@main
51+
with:
52+
repository: ${{ matrix.repository }}
53+
ref: ""
54+
test-infra-repository: pytorch/test-infra
55+
test-infra-ref: main
56+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
57+
pre-script: ${{ matrix.pre-script }}
58+
env-script: ${{ matrix.env-script }}
59+
post-script: ${{ matrix.post-script }}
60+
package-name: ${{ matrix.package-name }}
61+
smoke-test-script: ${{ matrix.smoke-test-script }}
62+
trigger-event: ${{ github.event_name }}

packaging/vc_env_helper.bat

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@echo on
2+
3+
set VC_VERSION_LOWER=17
4+
set VC_VERSION_UPPER=18
5+
if "%VC_YEAR%" == "2019" ( set VC_VERSION_LOWER=16 set VC_VERSION_UPPER=17)
6+
if "%VC_YEAR%" == "2017" ( set VC_VERSION_LOWER=15 set VC_VERSION_UPPER=16)
7+
8+
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 (
9+
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
10+
set "VS15INSTALLDIR=%%i"
11+
set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat"
12+
goto vswhere
13+
)
14+
)
15+
16+
:vswhere
17+
if "%VSDEVCMD_ARGS%" == "" (
18+
call "%VS15VCVARSALL%" x64 || exit /b 1
19+
) else (
20+
call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1
21+
)
22+
23+
@echo on
24+
25+
if "%CU_VERSION%" == "xpu" call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
26+
27+
set DISTUTILS_USE_SDK=1
28+
29+
set args=%1
30+
shift
31+
:start
32+
if [%1] == [] goto done
33+
set args=%args% %1
34+
shift
35+
goto start
36+
37+
:done
38+
if "%args%" == "" (
39+
echo Usage: vc_env_helper.bat [command] [args]
40+
echo e.g. vc_env_helper.bat cl /c test.cpp
41+
)
42+
43+
%args% || exit /b 1

0 commit comments

Comments
 (0)