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.
Unified · Split
| @@ -34,16 +34,16 @@ jobs: · 33 unmodified lines | ||
| 34 | 34 | timeout-minutes: 6 |
| 35 | 35 | steps: |
| 36 | 36 | - uses: actions/checkout@v4 |
| 37 | − - name: test (x86_64-win32) | |
| 37 | + - name: build tcc (x86_64-win32) | |
| 38 | 38 | shell: cmd |
| 39 | 39 | run: | |
| 40 | − echo ::group:: run build-tcc.bat | |
| 41 | 40 | 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 | |
| 43 | 42 | 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 | |
| 47 | 47 | call test-win32.bat all -k |
| 48 | 48 | |
| 49 | 49 | test-i386-win32: |
| @@ -51,16 +51,16 @@ jobs: · 1 unmodified line | ||
| 51 | 51 | timeout-minutes: 6 |
| 52 | 52 | steps: |
| 53 | 53 | - uses: actions/checkout@v4 |
| 54 | − - name: test (i386-win32) | |
| 54 | + - name: build tcc (i386-win32) | |
| 55 | 55 | shell: cmd |
| 56 | 56 | run: | |
| 57 | − echo ::group:: run build-tcc.bat | |
| 58 | 57 | 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 | |
| 60 | 59 | 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 | |
| 64 | 64 | call test-win32.bat -p c:\mingw32\bin all -k |
| 65 | 65 | |
| 66 | 66 | test-arm64-win32: |
| @@ -68,15 +68,13 @@ jobs: · 1 unmodified line | ||
| 68 | 68 | timeout-minutes: 6 |
| 69 | 69 | steps: |
| 70 | 70 | - uses: actions/checkout@v4 |
| 71 | − - name: test (arm64-win32) | |
| 71 | + - name: build and test (arm64-win32) | |
| 72 | 72 | shell: cmd |
| 73 | 73 | run: | |
| 74 | − echo ::group:: run build-tcc.bat | |
| 75 | 74 | 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 | |
| 77 | 76 | call build-tcc.bat -c cl -t arm64 |
| 78 | − @echo off | |
| 79 | − echo ::endgroup:: | |
| 77 | + set "PATH=C:\Program Files\LLVM\bin;%CD%;%PATH%" | |
| 80 | 78 | cd ..\tests |
| 81 | 79 | call test-win32.bat -c clang all -k |
| 82 | 80 | |