| author | |
| committer | |
| log | 480f6a47adbb4293ec827c537052613649da137c |
| tree | 6ec9fd4d4e4fc06376b50fcd546531772f3e5479 |
| parent | f1c2b30b7e269cce212d01860be0ea65a67ffe33 |
| signature | Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM |
2 files changed, 82 insertions(+), 85 deletions(-)
ci/aarch64-windows-release.ps1 created+82| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | $TARGET = "aarch64-windows-gnu" | |
| 2 | $MCPU = "baseline" | |
| 3 | $PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" | |
| 4 | $ZIG = "$PREFIX_PATH\bin\zig.exe" | |
| 5 | $ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } | |
| 6 | ||
| 7 | function CheckLastExitCode { | |
| 8 | if (!$?) { | |
| 9 | exit 1 | |
| 10 | } | |
| 11 | return 0 | |
| 12 | } | |
| 13 | ||
| 14 | # Override the cache directories because they won't actually help other CI runs | |
| 15 | # which will be testing alternate versions of zig, and ultimately would just | |
| 16 | # fill up space on the hard drive for no reason. | |
| 17 | $Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" | |
| 18 | $Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" | |
| 19 | ||
| 20 | Write-Output "Building from source..." | |
| 21 | New-Item -Path 'build-release' -ItemType Directory | |
| 22 | Set-Location -Path 'build-release' | |
| 23 | ||
| 24 | # CMake gives a syntax error when file paths with backward slashes are used. | |
| 25 | # Here, we use forward slashes only to work around this. | |
| 26 | cmake .. ` | |
| 27 | -GNinja ` | |
| 28 | -DCMAKE_INSTALL_PREFIX="stage3-release" ` | |
| 29 | -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" ` | |
| 30 | -DCMAKE_BUILD_TYPE=Release ` | |
| 31 | -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` | |
| 32 | -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` | |
| 33 | -DCMAKE_AR="$($ZIG -Replace "\\", "/")" ` | |
| 34 | -DZIG_AR_WORKAROUND=ON ` | |
| 35 | -DZIG_TARGET_TRIPLE="$TARGET" ` | |
| 36 | -DZIG_TARGET_MCPU="$MCPU" ` | |
| 37 | -DZIG_STATIC=ON ` | |
| 38 | -DZIG_NO_LIB=ON | |
| 39 | CheckLastExitCode | |
| 40 | ||
| 41 | ninja install | |
| 42 | CheckLastExitCode | |
| 43 | ||
| 44 | # Must be done after zig cc is finished. | |
| 45 | $Env:ZIG_LIB_DIR="$(Get-Location)\..\lib" | |
| 46 | ||
| 47 | Write-Output "Main test suite..." | |
| 48 | stage3-release\bin\zig.exe build test docs ` | |
| 49 | --maxrss $ZSF_MAX_RSS ` | |
| 50 | --search-prefix "$PREFIX_PATH" ` | |
| 51 | -Dstatic-llvm ` | |
| 52 | -Dskip-non-native ` | |
| 53 | -Dskip-test-incremental ` | |
| 54 | -Denable-symlinks-windows ` | |
| 55 | --test-timeout 30m | |
| 56 | CheckLastExitCode | |
| 57 | ||
| 58 | # Ensure that the fuzzer at least compiles. | |
| 59 | # https://codeberg.org/ziglang/zig/issues/31893 | |
| 60 | # stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe | |
| 61 | # CheckLastExitCode | |
| 62 | # stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug | |
| 63 | # CheckLastExitCode | |
| 64 | ||
| 65 | # Ensure that stage3 and stage4 are byte-for-byte identical. | |
| 66 | Write-Output "Build and compare stage4..." | |
| 67 | stage3-release\bin\zig.exe build ` | |
| 68 | --prefix stage4-release ` | |
| 69 | -Denable-llvm ` | |
| 70 | -Dno-lib ` | |
| 71 | -Doptimize=ReleaseFast ` | |
| 72 | -Dstrip ` | |
| 73 | -Dtarget="$TARGET" ` | |
| 74 | -Duse-zig-libcxx ` | |
| 75 | -Dversion-string="$(stage3-release\bin\zig version)" | |
| 76 | CheckLastExitCode | |
| 77 | ||
| 78 | # Compare-Object returns an error code if the files differ. | |
| 79 | Write-Output "If the following command fails, it means nondeterminism has been" | |
| 80 | Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 81 | Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe) | |
| 82 | CheckLastExitCode |
ci/aarch64-windows.ps1 deleted-85| ... | ... | @@ -1,85 +0,0 @@ |
| 1 | $TARGET = "aarch64-windows-gnu" | |
| 2 | $ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" | |
| 3 | $MCPU = "baseline" | |
| 4 | $ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip" | |
| 5 | $PREFIX_PATH = "$(Get-Location)\..\$ZIG_LLVM_CLANG_LLD_NAME" | |
| 6 | $ZIG = "$PREFIX_PATH\bin\zig.exe" | |
| 7 | $ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } | |
| 8 | ||
| 9 | if (!(Test-Path "..\$ZIG_LLVM_CLANG_LLD_NAME.zip")) { | |
| 10 | Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL" | |
| 11 | Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "..\$ZIG_LLVM_CLANG_LLD_NAME.zip" | |
| 12 | ||
| 13 | Write-Output "Extracting..." | |
| 14 | Add-Type -AssemblyName System.IO.Compression.FileSystem ; | |
| 15 | [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\..\$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD\..") | |
| 16 | } | |
| 17 | ||
| 18 | function CheckLastExitCode { | |
| 19 | if (!$?) { | |
| 20 | exit 1 | |
| 21 | } | |
| 22 | return 0 | |
| 23 | } | |
| 24 | ||
| 25 | # Override the cache directories because they won't actually help other CI runs | |
| 26 | # which will be testing alternate versions of zig, and ultimately would just | |
| 27 | # fill up space on the hard drive for no reason. | |
| 28 | $Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" | |
| 29 | $Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" | |
| 30 | ||
| 31 | Write-Output "Building from source..." | |
| 32 | New-Item -Path 'build-release' -ItemType Directory | |
| 33 | Set-Location -Path 'build-release' | |
| 34 | ||
| 35 | # CMake gives a syntax error when file paths with backward slashes are used. | |
| 36 | # Here, we use forward slashes only to work around this. | |
| 37 | & cmake .. ` | |
| 38 | -GNinja ` | |
| 39 | -DCMAKE_INSTALL_PREFIX="stage3-release" ` | |
| 40 | -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" ` | |
| 41 | -DCMAKE_BUILD_TYPE=Release ` | |
| 42 | -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` | |
| 43 | -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` | |
| 44 | -DCMAKE_AR="$ZIG" ` | |
| 45 | -DZIG_AR_WORKAROUND=ON ` | |
| 46 | -DZIG_TARGET_TRIPLE="$TARGET" ` | |
| 47 | -DZIG_TARGET_MCPU="$MCPU" ` | |
| 48 | -DZIG_STATIC=ON ` | |
| 49 | -DZIG_NO_LIB=ON | |
| 50 | CheckLastExitCode | |
| 51 | ||
| 52 | ninja install | |
| 53 | CheckLastExitCode | |
| 54 | ||
| 55 | # Must be done after zig cc is finished. | |
| 56 | $Env:ZIG_LIB_DIR="$(Get-Location)\..\lib" | |
| 57 | ||
| 58 | Write-Output "Main test suite..." | |
| 59 | & "stage3-release\bin\zig.exe" build test docs ` | |
| 60 | --maxrss $ZSF_MAX_RSS ` | |
| 61 | --search-prefix "$PREFIX_PATH" ` | |
| 62 | -Dstatic-llvm ` | |
| 63 | -Dskip-non-native ` | |
| 64 | -Denable-symlinks-windows ` | |
| 65 | --test-timeout 30m | |
| 66 | CheckLastExitCode | |
| 67 | ||
| 68 | # Ensure that stage3 and stage4 are byte-for-byte identical. | |
| 69 | Write-Output "Build and compare stage4..." | |
| 70 | & "stage3-release\bin\zig.exe" build ` | |
| 71 | --prefix stage4-release ` | |
| 72 | -Denable-llvm ` | |
| 73 | -Dno-lib ` | |
| 74 | -Doptimize=ReleaseFast ` | |
| 75 | -Dstrip ` | |
| 76 | -Dtarget="$TARGET" ` | |
| 77 | -Duse-zig-libcxx ` | |
| 78 | -Dversion-string="$(stage3-release\bin\zig version)" | |
| 79 | CheckLastExitCode | |
| 80 | ||
| 81 | # Compare-Object returns an error code if the files differ. | |
| 82 | Write-Output "If the following command fails, it means nondeterminism has been" | |
| 83 | Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 84 | Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe) | |
| 85 | CheckLastExitCode |