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
34 timeout-minutes: 634 timeout-minutes: 6
35 steps:35 steps:
36 - uses: actions/checkout@v436 - uses: actions/checkout@v4
37 - name: test (x86_64-win32)37 - name: build tcc (x86_64-win32)
38 shell: cmd38 shell: cmd
39 run: |39 run: |
40 echo ::group:: run build-tcc.bat
41 cd win3240 cd win32
42 call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd6441 for /f "delims=" %%i in ('vswhere.exe -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" amd64
43 call build-tcc.bat -c cl -t x86_6442 call build-tcc.bat -c cl -t x86_64
44 @echo off43 - name: test (x86_64-win32)
45 echo ::endgroup::44 shell: cmd
46 cd ..\tests45 run: |
46 cd tests
47 call test-win32.bat all -k47 call test-win32.bat all -k
48 48
49 test-i386-win32:49 test-i386-win32:
@@ -51,16 +51,16 @@ jobs: · 1 unmodified line
51 timeout-minutes: 651 timeout-minutes: 6
52 steps:52 steps:
53 - uses: actions/checkout@v453 - uses: actions/checkout@v4
54 - name: test (i386-win32)54 - name: build tcc (i386-win32)
55 shell: cmd55 shell: cmd
56 run: |56 run: |
57 echo ::group:: run build-tcc.bat
58 cd win3257 cd win32
59 call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x8658 for /f "delims=" %%i in ('vswhere.exe -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" x86
60 call build-tcc.bat -c cl -t i38659 call build-tcc.bat -c cl -t i386
61 @echo off60 - name: test (i386-win32)
62 echo ::endgroup::61 shell: cmd
63 cd ..\tests62 run: |
63 cd tests
64 call test-win32.bat -p c:\mingw32\bin all -k64 call test-win32.bat -p c:\mingw32\bin all -k
65 65
66 test-arm64-win32:66 test-arm64-win32:
@@ -68,15 +68,13 @@ jobs: · 1 unmodified line
68 timeout-minutes: 668 timeout-minutes: 6
69 steps:69 steps:
70 - uses: actions/checkout@v470 - uses: actions/checkout@v4
71 - name: test (arm64-win32)71 - name: build and test (arm64-win32)
72 shell: cmd72 shell: cmd
73 run: |73 run: |
74 echo ::group:: run build-tcc.bat
75 cd win3274 cd win32
76 call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=arm6475 for /f "delims=" %%i in ('vswhere.exe -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64
77 call build-tcc.bat -c cl -t arm6476 call build-tcc.bat -c cl -t arm64
78 @echo off77 set "PATH=C:\Program Files\LLVM\bin;%CD%;%PATH%"
79 echo ::endgroup::
80 cd ..\tests78 cd ..\tests
81 call test-win32.bat -c clang all -k79 call test-win32.bat -c clang all -k
82 80

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