authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-09 13:39:10+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-09 18:22:16+02:00
log480f6a47adbb4293ec827c537052613649da137c
tree6ec9fd4d4e4fc06376b50fcd546531772f3e5479
parentf1c2b30b7e269cce212d01860be0ea65a67ffe33
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

ci: bring aarch64-windows script in line with x86_64-windows-release


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
7function 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
20Write-Output "Building from source..."
21New-Item -Path 'build-release' -ItemType Directory
22Set-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.
26cmake .. `
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
39CheckLastExitCode
40
41ninja install
42CheckLastExitCode
43
44# Must be done after zig cc is finished.
45$Env:ZIG_LIB_DIR="$(Get-Location)\..\lib"
46
47Write-Output "Main test suite..."
48stage3-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
56CheckLastExitCode
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.
66Write-Output "Build and compare stage4..."
67stage3-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)"
76CheckLastExitCode
77
78# Compare-Object returns an error code if the files differ.
79Write-Output "If the following command fails, it means nondeterminism has been"
80Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical."
81Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe)
82CheckLastExitCode
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
9if (!(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
18function 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
31Write-Output "Building from source..."
32New-Item -Path 'build-release' -ItemType Directory
33Set-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
50CheckLastExitCode
51
52ninja install
53CheckLastExitCode
54
55# Must be done after zig cc is finished.
56$Env:ZIG_LIB_DIR="$(Get-Location)\..\lib"
57
58Write-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
66CheckLastExitCode
67
68# Ensure that stage3 and stage4 are byte-for-byte identical.
69Write-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)"
79CheckLastExitCode
80
81# Compare-Object returns an error code if the files differ.
82Write-Output "If the following command fails, it means nondeterminism has been"
83Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical."
84Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe)
85CheckLastExitCode