From 93749497332ba8e143ea72f8e66f3996b12c083e Mon Sep 17 00:00:00 2001 From: pfg Date: Mon, 3 Feb 2025 12:45:40 -0800 Subject: [PATCH] update actions to maybe build artifacts --- .github/workflows/ci.yaml | 71 ++++++++++++++++++++++++++----- ci/aarch64-linux-debug.sh | 54 ----------------------- ci/aarch64-linux-release.sh | 70 ------------------------------ ci/aarch64-macos-debug.sh | 12 ------ ci/aarch64-macos-release.sh | 30 +------------ ci/aarch64-windows.ps1 | 38 +---------------- ci/x86_64-linux-debug.sh | 56 ------------------------ ci/x86_64-linux-release.sh | 80 ----------------------------------- ci/x86_64-macos-release.sh | 8 ---- ci/x86_64-windows-debug.ps1 | 56 ------------------------ ci/x86_64-windows-release.ps1 | 74 -------------------------------- 11 files changed, 63 insertions(+), 486 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81ab76d3724e..6a5af0942621 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,7 @@ on: branches: - master - llvm19 + - 014-dev concurrency: # Cancels pending runs when a PR gets updated. group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} @@ -19,32 +20,52 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: sh ci/x86_64-linux-debug.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: x86_64-linux-debug + path: build-debug/stage3-debug/bin/zig x86_64-linux-release: timeout-minutes: 420 runs-on: [self-hosted, Linux, x86_64] steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: sh ci/x86_64-linux-release.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: x86_64-linux-release + path: build-release/stage3-release/bin/zig aarch64-linux-debug: timeout-minutes: 480 runs-on: [self-hosted, Linux, aarch64] steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: sh ci/aarch64-linux-debug.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: aarch64-linux-debug + path: build-debug/stage3-debug/bin/zig aarch64-linux-release: timeout-minutes: 480 runs-on: [self-hosted, Linux, aarch64] steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: sh ci/aarch64-linux-release.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: aarch64-linux-release + path: build-release/stage3-release/bin/zig x86_64-macos-release: runs-on: "macos-13" env: @@ -52,8 +73,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: ci/x86_64-macos-release.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: x86_64-macos-release + path: build-release/stage3-release/bin/zig aarch64-macos-debug: runs-on: [self-hosted, macOS, aarch64] env: @@ -61,8 +87,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: ci/aarch64-macos-debug.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: aarch64-macos-debug + path: build-debug/stage3-debug/bin/zig aarch64-macos-release: runs-on: [self-hosted, macOS, aarch64] env: @@ -70,8 +101,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: ci/aarch64-macos-release.sh + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: aarch64-macos-release + path: build-release/stage3-release/bin/zig x86_64-windows-debug: runs-on: [self-hosted, Windows, x86_64] env: @@ -79,8 +115,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: ci/x86_64-windows-debug.ps1 + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: x86_64-windows-debug + path: build-debug/stage3-debug/bin/zig.exe x86_64-windows-release: runs-on: [self-hosted, Windows, x86_64] env: @@ -88,8 +129,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: ci/x86_64-windows-release.ps1 + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: x86_64-windows-release + path: build-release/stage3-release/bin/zig.exe aarch64-windows: runs-on: [self-hosted, Windows, aarch64] env: @@ -97,5 +143,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build and Test + - name: Build run: ci/aarch64-windows.ps1 + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: aarch64-windows + path: build-release/stage3-release/bin/zig.exe diff --git a/ci/aarch64-linux-debug.sh b/ci/aarch64-linux-debug.sh index 47f75c462476..1bae54a3d409 100644 --- a/ci/aarch64-linux-debug.sh +++ b/ci/aarch64-linux-debug.sh @@ -14,11 +14,6 @@ ZIG="$PREFIX/bin/zig" export PATH="$HOME/local/bin:$PATH" -# Make the `zig version` number consistent. -# This will affect the cmake command below. -git fetch --unshallow || true -git fetch --tags - export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" @@ -48,52 +43,3 @@ unset CC unset CXX ninja install - -# simultaneously test building self-hosted without LLVM and with 32-bit arm -stage3-debug/bin/zig build \ - -Dtarget=arm-linux-musleabihf \ - -Dno-lib - -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. -stage3-debug/bin/zig build test docs \ - --maxrss 24696061952 \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" \ - -Denable-superhtml - -# Ensure that updating the wasm binary from this commit will result in a viable build. -stage3-debug/bin/zig build update-zig1 - -rm -rf ../build-new -mkdir ../build-new -cd ../build-new - -export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" -export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - -cmake .. \ - -DCMAKE_PREFIX_PATH="$PREFIX" \ - -DCMAKE_BUILD_TYPE=Debug \ - -DZIG_TARGET_TRIPLE="$TARGET" \ - -DZIG_TARGET_MCPU="$MCPU" \ - -DZIG_STATIC=ON \ - -DZIG_NO_LIB=ON \ - -GNinja - -unset CC -unset CXX - -ninja install - -stage3/bin/zig test ../test/behavior.zig -stage3/bin/zig build -p stage4 \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - -Dno-lib \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" -stage4/bin/zig test ../test/behavior.zig diff --git a/ci/aarch64-linux-release.sh b/ci/aarch64-linux-release.sh index a41255b45476..eb16a2639ad4 100644 --- a/ci/aarch64-linux-release.sh +++ b/ci/aarch64-linux-release.sh @@ -14,11 +14,6 @@ ZIG="$PREFIX/bin/zig" export PATH="$HOME/local/bin:$PATH" -# Make the `zig version` number consistent. -# This will affect the cmake command below. -git fetch --unshallow || true -git fetch --tags - export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" @@ -48,68 +43,3 @@ unset CC unset CXX ninja install - -# simultaneously test building self-hosted without LLVM and with 32-bit arm -stage3-release/bin/zig build \ - -Dtarget=arm-linux-musleabihf \ - -Dno-lib - -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. -stage3-release/bin/zig build test docs \ - --maxrss 24696061952 \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" \ - -Denable-superhtml - -# Ensure that stage3 and stage4 are byte-for-byte identical. -stage3-release/bin/zig build \ - --prefix stage4-release \ - -Denable-llvm \ - -Dno-lib \ - -Doptimize=ReleaseFast \ - -Dstrip \ - -Dtarget=$TARGET \ - -Duse-zig-libcxx \ - -Dversion-string="$(stage3-release/bin/zig version)" - -# diff returns an error code if the files differ. -echo "If the following command fails, it means nondeterminism has been" -echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." -diff stage3-release/bin/zig stage4-release/bin/zig - -# Ensure that updating the wasm binary from this commit will result in a viable build. -stage3-release/bin/zig build update-zig1 - -rm -rf ../build-new -mkdir ../build-new -cd ../build-new - -export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" -export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - -cmake .. \ - -DCMAKE_PREFIX_PATH="$PREFIX" \ - -DCMAKE_BUILD_TYPE=Release \ - -DZIG_TARGET_TRIPLE="$TARGET" \ - -DZIG_TARGET_MCPU="$MCPU" \ - -DZIG_STATIC=ON \ - -DZIG_NO_LIB=ON \ - -GNinja - -unset CC -unset CXX - -ninja install - -stage3/bin/zig test ../test/behavior.zig -stage3/bin/zig build -p stage4 \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - -Dno-lib \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" -stage4/bin/zig test ../test/behavior.zig diff --git a/ci/aarch64-macos-debug.sh b/ci/aarch64-macos-debug.sh index 4d44401a9924..01fa8c652079 100755 --- a/ci/aarch64-macos-debug.sh +++ b/ci/aarch64-macos-debug.sh @@ -21,11 +21,6 @@ fi cd $ZIGDIR -# Make the `zig version` number consistent. -# This will affect the cmake command below. -git fetch --unshallow || true -git fetch --tags - rm -rf build-debug mkdir build-debug cd build-debug @@ -49,10 +44,3 @@ PATH="$HOME/local/bin:$PATH" cmake .. \ -GNinja $HOME/local/bin/ninja install - -stage3-debug/bin/zig build test docs \ - --zig-lib-dir "$PWD/../lib" \ - -Denable-macos-sdk \ - -Dstatic-llvm \ - -Dskip-non-native \ - --search-prefix "$PREFIX" diff --git a/ci/aarch64-macos-release.sh b/ci/aarch64-macos-release.sh index e8ce56eaea2d..452131480d2d 100755 --- a/ci/aarch64-macos-release.sh +++ b/ci/aarch64-macos-release.sh @@ -21,11 +21,6 @@ fi cd $ZIGDIR -# Make the `zig version` number consistent. -# This will affect the cmake command below. -git fetch --unshallow || true -git fetch --tags - rm -rf build-release mkdir build-release cd build-release @@ -48,27 +43,4 @@ PATH="$HOME/local/bin:$PATH" cmake .. \ -DZIG_NO_LIB=ON \ -GNinja -$HOME/local/bin/ninja install - -stage3-release/bin/zig build test docs \ - --zig-lib-dir "$PWD/../lib" \ - -Denable-macos-sdk \ - -Dstatic-llvm \ - -Dskip-non-native \ - --search-prefix "$PREFIX" - -# Ensure that stage3 and stage4 are byte-for-byte identical. -stage3-release/bin/zig build \ - --prefix stage4-release \ - -Denable-llvm \ - -Dno-lib \ - -Doptimize=ReleaseFast \ - -Dstrip \ - -Dtarget=$TARGET \ - -Duse-zig-libcxx \ - -Dversion-string="$(stage3-release/bin/zig version)" - -# diff returns an error code if the files differ. -echo "If the following command fails, it means nondeterminism has been" -echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." -diff stage3-release/bin/zig stage4-release/bin/zig +$HOME/local/bin/ninja install \ No newline at end of file diff --git a/ci/aarch64-windows.ps1 b/ci/aarch64-windows.ps1 index b0e7c474ca8c..f0eff9acec60 100644 --- a/ci/aarch64-windows.ps1 +++ b/ci/aarch64-windows.ps1 @@ -22,14 +22,6 @@ function CheckLastExitCode { return 0 } -# Make the `zig version` number consistent. -# This will affect the `zig build` command below which uses `git describe`. -git fetch --tags - -if ((git rev-parse --is-shallow-repository) -eq "true") { - git fetch --unshallow # `git describe` won't work on a shallow repo -} - Write-Output "Building from source..." Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore New-Item -Path 'build-release' -ItemType Directory @@ -59,32 +51,4 @@ $Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" CheckLastExitCode ninja install -CheckLastExitCode - -Write-Output "Main test suite..." -& "stage3-release\bin\zig.exe" build test docs ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - --search-prefix "$PREFIX_PATH" ` - -Dstatic-llvm ` - -Dskip-non-native ` - -Denable-symlinks-windows -CheckLastExitCode - -# Ensure that stage3 and stage4 are byte-for-byte identical. -Write-Output "Build and compare stage4..." -& "stage3-release\bin\zig.exe" build ` - --prefix stage4-release ` - -Denable-llvm ` - -Dno-lib ` - -Doptimize=ReleaseFast ` - -Dstrip ` - -Dtarget="$TARGET" ` - -Duse-zig-libcxx ` - -Dversion-string="$(stage3-release\bin\zig version)" -CheckLastExitCode - -# Compare-Object returns an error code if the files differ. -Write-Output "If the following command fails, it means nondeterminism has been" -Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical." -Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe) -CheckLastExitCode +CheckLastExitCode \ No newline at end of file diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index 81c286d428da..e559e09ab427 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -14,11 +14,6 @@ ZIG="$PREFIX/bin/zig" export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-9.2.0-rc1/bin:$HOME/local/bin:$PATH" -# Make the `zig version` number consistent. -# This will affect the cmake command below. -git fetch --unshallow || true -git fetch --tags - # Test building from source without LLVM. git clean -fd rm -rf zig-out @@ -56,54 +51,3 @@ unset CC unset CXX ninja install - -# simultaneously test building self-hosted without LLVM and with 32-bit arm -stage3-debug/bin/zig build \ - -Dtarget=arm-linux-musleabihf \ - -Dno-lib - -stage3-debug/bin/zig build test docs \ - --maxrss 21000000000 \ - -Dlldb=$HOME/deps/lldb-zig/Debug-e0a42bb34/bin/lldb \ - -fqemu \ - -fwasmtime \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" \ - -Denable-superhtml - -# Ensure that updating the wasm binary from this commit will result in a viable build. -stage3-debug/bin/zig build update-zig1 - -rm -rf ../build-new -mkdir ../build-new -cd ../build-new - -export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" -export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - -cmake .. \ - -DCMAKE_PREFIX_PATH="$PREFIX" \ - -DCMAKE_BUILD_TYPE=Debug \ - -DZIG_TARGET_TRIPLE="$TARGET" \ - -DZIG_TARGET_MCPU="$MCPU" \ - -DZIG_STATIC=ON \ - -DZIG_NO_LIB=ON \ - -GNinja - -unset CC -unset CXX - -ninja install - -stage3/bin/zig test ../test/behavior.zig -stage3/bin/zig build -p stage4 \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - -Dno-lib \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" -stage4/bin/zig test ../test/behavior.zig diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index a1041e7fb8f8..e0a39d01d29c 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -14,19 +14,6 @@ ZIG="$PREFIX/bin/zig" export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-9.2.0-rc1/bin:$HOME/local/bin:$PATH" -# Make the `zig version` number consistent. -# This will affect the cmake command below. -git fetch --unshallow || true -git fetch --tags - -# Test building from source without LLVM. -git clean -fd -rm -rf zig-out -cc -o bootstrap bootstrap.c -./bootstrap -./zig2 build -Dno-lib -./zig-out/bin/zig test test/behavior.zig - export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" @@ -56,70 +43,3 @@ unset CC unset CXX ninja install - -# simultaneously test building self-hosted without LLVM and with 32-bit arm -stage3-release/bin/zig build \ - -Dtarget=arm-linux-musleabihf \ - -Dno-lib - -stage3-release/bin/zig build test docs \ - --maxrss 21000000000 \ - -Dlldb=$HOME/deps/lldb-zig/Release-e0a42bb34/bin/lldb \ - -fqemu \ - -fwasmtime \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" \ - -Denable-superhtml - -# Ensure that stage3 and stage4 are byte-for-byte identical. -stage3-release/bin/zig build \ - --prefix stage4-release \ - -Denable-llvm \ - -Dno-lib \ - -Doptimize=ReleaseFast \ - -Dstrip \ - -Dtarget=$TARGET \ - -Duse-zig-libcxx \ - -Dversion-string="$(stage3-release/bin/zig version)" - -# diff returns an error code if the files differ. -echo "If the following command fails, it means nondeterminism has been" -echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." -diff stage3-release/bin/zig stage4-release/bin/zig - -# Ensure that updating the wasm binary from this commit will result in a viable build. -stage3-release/bin/zig build update-zig1 - -rm -rf ../build-new -mkdir ../build-new -cd ../build-new - -export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" -export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - -cmake .. \ - -DCMAKE_PREFIX_PATH="$PREFIX" \ - -DCMAKE_BUILD_TYPE=Release \ - -DZIG_TARGET_TRIPLE="$TARGET" \ - -DZIG_TARGET_MCPU="$MCPU" \ - -DZIG_STATIC=ON \ - -DZIG_NO_LIB=ON \ - -GNinja - -unset CC -unset CXX - -ninja install - -stage3/bin/zig test ../test/behavior.zig -stage3/bin/zig build -p stage4 \ - -Dstatic-llvm \ - -Dtarget=native-native-musl \ - -Dno-lib \ - --search-prefix "$PREFIX" \ - --zig-lib-dir "$PWD/../lib" -stage4/bin/zig test ../test/behavior.zig diff --git a/ci/x86_64-macos-release.sh b/ci/x86_64-macos-release.sh index 838952b181bb..0347054bc2ae 100755 --- a/ci/x86_64-macos-release.sh +++ b/ci/x86_64-macos-release.sh @@ -24,14 +24,6 @@ cd $ZIGDIR git fetch --unshallow || true git fetch --tags -# Test building from source without LLVM. -git clean -fd -rm -rf zig-out -cc -o bootstrap bootstrap.c -./bootstrap -./zig2 build -Dno-lib -./zig-out/bin/zig test test/behavior.zig - rm -rf build mkdir build cd build diff --git a/ci/x86_64-windows-debug.ps1 b/ci/x86_64-windows-debug.ps1 index 8fd4db222c52..b00bc303dacb 100644 --- a/ci/x86_64-windows-debug.ps1 +++ b/ci/x86_64-windows-debug.ps1 @@ -22,14 +22,6 @@ function CheckLastExitCode { return 0 } -# Make the `zig version` number consistent. -# This will affect the `zig build` command below which uses `git describe`. -git fetch --tags - -if ((git rev-parse --is-shallow-repository) -eq "true") { - git fetch --unshallow # `git describe` won't work on a shallow repo -} - Write-Output "Building from source..." Remove-Item -Path 'build-debug' -Recurse -Force -ErrorAction Ignore New-Item -Path 'build-debug' -ItemType Directory @@ -60,51 +52,3 @@ CheckLastExitCode ninja install CheckLastExitCode - -Write-Output "Main test suite..." -& "stage3-debug\bin\zig.exe" build test docs ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - --search-prefix "$PREFIX_PATH" ` - -Dstatic-llvm ` - -Dskip-non-native ` - -Dskip-release ` - -Denable-symlinks-windows -CheckLastExitCode - -Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..." -& "stage3-debug\bin\zig.exe" test ` - ..\test\behavior.zig ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - -ofmt=c ` - -femit-bin="test-x86_64-windows-msvc.c" ` - --test-no-exec ` - -target x86_64-windows-msvc ` - -lc -CheckLastExitCode - -& "stage3-debug\bin\zig.exe" build-obj ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - -ofmt=c ` - -OReleaseSmall ` - --name compiler_rt ` - -femit-bin="compiler_rt-x86_64-windows-msvc.c" ` - --dep build_options ` - -target x86_64-windows-msvc ` - -Mroot="..\lib\compiler_rt.zig" ` - -Mbuild_options="config.zig" -CheckLastExitCode - -Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -CheckLastExitCode - -Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` - -DevCmdArguments '-arch=x64 -no_logo' ` - -StartInPath $(Get-Location) -CheckLastExitCode - -Write-Output "Build and run behavior tests with msvc..." -& cl.exe -I..\lib test-x86_64-windows-msvc.c compiler_rt-x86_64-windows-msvc.c /W3 /Z7 -link -nologo -debug -subsystem:console kernel32.lib ntdll.lib libcmt.lib -CheckLastExitCode - -& .\test-x86_64-windows-msvc.exe -CheckLastExitCode diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1 index 432d0649beb1..cfc923856a26 100644 --- a/ci/x86_64-windows-release.ps1 +++ b/ci/x86_64-windows-release.ps1 @@ -22,14 +22,6 @@ function CheckLastExitCode { return 0 } -# Make the `zig version` number consistent. -# This will affect the `zig build` command below which uses `git describe`. -git fetch --tags - -if ((git rev-parse --is-shallow-repository) -eq "true") { - git fetch --unshallow # `git describe` won't work on a shallow repo -} - Write-Output "Building from source..." Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore New-Item -Path 'build-release' -ItemType Directory @@ -60,69 +52,3 @@ CheckLastExitCode ninja install CheckLastExitCode - -Write-Output "Main test suite..." -& "stage3-release\bin\zig.exe" build test docs ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - --search-prefix "$PREFIX_PATH" ` - -Dstatic-llvm ` - -Dskip-non-native ` - -Denable-symlinks-windows -CheckLastExitCode - -# Ensure that stage3 and stage4 are byte-for-byte identical. -Write-Output "Build and compare stage4..." -& "stage3-release\bin\zig.exe" build ` - --prefix stage4-release ` - -Denable-llvm ` - -Dno-lib ` - -Doptimize=ReleaseFast ` - -Dstrip ` - -Dtarget="$TARGET" ` - -Duse-zig-libcxx ` - -Dversion-string="$(stage3-release\bin\zig version)" -CheckLastExitCode - -# Compare-Object returns an error code if the files differ. -Write-Output "If the following command fails, it means nondeterminism has been" -Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical." -Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe) -CheckLastExitCode - -Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..." -& "stage3-release\bin\zig.exe" test ` - ..\test\behavior.zig ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - -ofmt=c ` - -femit-bin="test-x86_64-windows-msvc.c" ` - --test-no-exec ` - -target x86_64-windows-msvc ` - -lc -CheckLastExitCode - -& "stage3-release\bin\zig.exe" build-obj ` - --zig-lib-dir "$ZIG_LIB_DIR" ` - -ofmt=c ` - -OReleaseSmall ` - --name compiler_rt ` - -femit-bin="compiler_rt-x86_64-windows-msvc.c" ` - --dep build_options ` - -target x86_64-windows-msvc ` - -Mroot="..\lib\compiler_rt.zig" ` - -Mbuild_options="config.zig" -CheckLastExitCode - -Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -CheckLastExitCode - -Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` - -DevCmdArguments '-arch=x64 -no_logo' ` - -StartInPath $(Get-Location) -CheckLastExitCode - -Write-Output "Build and run behavior tests with msvc..." -& cl.exe -I..\lib test-x86_64-windows-msvc.c compiler_rt-x86_64-windows-msvc.c /W3 /Z7 -link -nologo -debug -subsystem:console kernel32.lib ntdll.lib libcmt.lib -CheckLastExitCode - -& .\test-x86_64-windows-msvc.exe -CheckLastExitCode