History

CI: fix win32 MSVC setup and arm64 test

Replace hardcoded VsDevCmd.bat Enterprise path with vswhere.exe + vcvarsall.bat for dynamic VS discovery across editions and runner image versions. Architecture args: amd64, x86, amd64_arm64. Split x86_64/i386 win32 jobs into separate build and test steps. For arm64: keep build+test in one step (needs vcvarsall for lib.exe). Prepend standalone LLVM bin to PATH so clang targets ARM64 natively instead of VS's clang-cl inheriting the x64-hosted cross-compile env.

Meng Zhuo committed 5 months ago

Commit fb4077f1 parent 724b24e1 file · +15 −17Browse files

Unified · Split

.github/workflows/build.yml+15−17
@@ -34,16 +34,16 @@ jobs: · 33 unmodified lines
3434 timeout-minutes: 6
3535 steps:
3636 - uses: actions/checkout@v4
37− - name: test (x86_64-win32)
37+ - name: build tcc (x86_64-win32)
3838 shell: cmd
3939 run: |
40− echo ::group:: run build-tcc.bat
4140 cd win32
42− call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64
41+ for /f "delims=" %%i in ('vswhere.exe -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" amd64
4342 call build-tcc.bat -c cl -t x86_64
44− @echo off
45− echo ::endgroup::
46− cd ..\tests
43+ - name: test (x86_64-win32)
44+ shell: cmd
45+ run: |
46+ cd tests
4747 call test-win32.bat all -k
4848
4949 test-i386-win32:
@@ -51,16 +51,16 @@ jobs: · 1 unmodified line
5151 timeout-minutes: 6
5252 steps:
5353 - uses: actions/checkout@v4
54− - name: test (i386-win32)
54+ - name: build tcc (i386-win32)
5555 shell: cmd
5656 run: |
57− echo ::group:: run build-tcc.bat
5857 cd win32
59− call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86
58+ for /f "delims=" %%i in ('vswhere.exe -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" x86
6059 call build-tcc.bat -c cl -t i386
61− @echo off
62− echo ::endgroup::
63− cd ..\tests
60+ - name: test (i386-win32)
61+ shell: cmd
62+ run: |
63+ cd tests
6464 call test-win32.bat -p c:\mingw32\bin all -k
6565
6666 test-arm64-win32:
@@ -68,15 +68,13 @@ jobs: · 1 unmodified line
6868 timeout-minutes: 6
6969 steps:
7070 - uses: actions/checkout@v4
71− - name: test (arm64-win32)
71+ - name: build and test (arm64-win32)
7272 shell: cmd
7373 run: |
74− echo ::group:: run build-tcc.bat
7574 cd win32
76− call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=arm64
75+ for /f "delims=" %%i in ('vswhere.exe -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64
7776 call build-tcc.bat -c cl -t arm64
78− @echo off
79− echo ::endgroup::
77+ set "PATH=C:\Program Files\LLVM\bin;%CD%;%PATH%"
8078 cd ..\tests
8179 call test-win32.bat -c clang all -k
8280

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t