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