authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-28 20:39:31+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-29 11:46:53-08:00
log1cbfdb42449f25cf996f4492736dbf8722ab3f09
tree7b339df4f5910fead95a3870b6eabb99cb4be7e7
parent798bb0bc61284be3948272bb2085912534feb8bd

ci: Set ZIG_GLOBAL_CACHE_DIR and ZIG_LOCAL_CACHE_DIR earlier.

Otherwise the disk just keeps getting filled up. Also remove some pointless cleanup commands since the actions/checkout workflow step already cleans the repository by default.

10 files changed, 52 insertions(+), 80 deletions(-)

ci/aarch64-linux-debug.sh+6-10
...@@ -19,19 +19,18 @@ export PATH="$HOME/local/bin:$PATH"...@@ -19,19 +19,18 @@ export PATH="$HOME/local/bin:$PATH"
19git fetch --unshallow || true19git fetch --unshallow || true
20git fetch --tags20git fetch --tags
2121
22export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
23export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
24
25rm -rf build-debug
26mkdir build-debug
27cd build-debug
28
29# Override the cache directories because they won't actually help other CI runs22# Override the cache directories because they won't actually help other CI runs
30# which will be testing alternate versions of zig, and ultimately would just23# which will be testing alternate versions of zig, and ultimately would just
31# fill up space on the hard drive for no reason.24# fill up space on the hard drive for no reason.
32export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"25export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
33export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"26export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3427
28mkdir build-debug
29cd build-debug
30
31export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
32export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
33
35cmake .. \34cmake .. \
36 -DCMAKE_INSTALL_PREFIX="stage3-debug" \35 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
37 -DCMAKE_PREFIX_PATH="$PREFIX" \36 -DCMAKE_PREFIX_PATH="$PREFIX" \
...@@ -66,12 +65,9 @@ stage3-debug/bin/zig build test docs \...@@ -66,12 +65,9 @@ stage3-debug/bin/zig build test docs \
66# Ensure that updating the wasm binary from this commit will result in a viable build.65# Ensure that updating the wasm binary from this commit will result in a viable build.
67stage3-debug/bin/zig build update-zig166stage3-debug/bin/zig build update-zig1
6867
69rm -rf ../build-new
70mkdir ../build-new68mkdir ../build-new
71cd ../build-new69cd ../build-new
7270
73export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
74export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
75export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"71export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
76export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"72export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
7773
ci/aarch64-linux-release.sh+6-10
...@@ -19,19 +19,18 @@ export PATH="$HOME/local/bin:$PATH"...@@ -19,19 +19,18 @@ export PATH="$HOME/local/bin:$PATH"
19git fetch --unshallow || true19git fetch --unshallow || true
20git fetch --tags20git fetch --tags
2121
22export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
23export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
24
25rm -rf build-release
26mkdir build-release
27cd build-release
28
29# Override the cache directories because they won't actually help other CI runs22# Override the cache directories because they won't actually help other CI runs
30# which will be testing alternate versions of zig, and ultimately would just23# which will be testing alternate versions of zig, and ultimately would just
31# fill up space on the hard drive for no reason.24# fill up space on the hard drive for no reason.
32export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"25export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
33export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"26export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3427
28mkdir build-release
29cd build-release
30
31export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
32export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
33
35cmake .. \34cmake .. \
36 -DCMAKE_INSTALL_PREFIX="stage3-release" \35 -DCMAKE_INSTALL_PREFIX="stage3-release" \
37 -DCMAKE_PREFIX_PATH="$PREFIX" \36 -DCMAKE_PREFIX_PATH="$PREFIX" \
...@@ -82,12 +81,9 @@ diff stage3-release/bin/zig stage4-release/bin/zig...@@ -82,12 +81,9 @@ diff stage3-release/bin/zig stage4-release/bin/zig
82# Ensure that updating the wasm binary from this commit will result in a viable build.81# Ensure that updating the wasm binary from this commit will result in a viable build.
83stage3-release/bin/zig build update-zig182stage3-release/bin/zig build update-zig1
8483
85rm -rf ../build-new
86mkdir ../build-new84mkdir ../build-new
87cd ../build-new85cd ../build-new
8886
89export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
90export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
91export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"87export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
92export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"88export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
9389
ci/aarch64-macos-debug.sh+3-4
...@@ -26,16 +26,15 @@ cd $ZIGDIR...@@ -26,16 +26,15 @@ cd $ZIGDIR
26git fetch --unshallow || true26git fetch --unshallow || true
27git fetch --tags27git fetch --tags
2828
29rm -rf build-debug
30mkdir build-debug
31cd build-debug
32
33# Override the cache directories because they won't actually help other CI runs29# Override the cache directories because they won't actually help other CI runs
34# which will be testing alternate versions of zig, and ultimately would just30# which will be testing alternate versions of zig, and ultimately would just
35# fill up space on the hard drive for no reason.31# fill up space on the hard drive for no reason.
36export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"32export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
37export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"33export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3834
35mkdir build-debug
36cd build-debug
37
39PATH="$HOME/local/bin:$PATH" cmake .. \38PATH="$HOME/local/bin:$PATH" cmake .. \
40 -DCMAKE_INSTALL_PREFIX="stage3-debug" \39 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
41 -DCMAKE_PREFIX_PATH="$PREFIX" \40 -DCMAKE_PREFIX_PATH="$PREFIX" \
ci/aarch64-macos-release.sh+3-4
...@@ -26,16 +26,15 @@ cd $ZIGDIR...@@ -26,16 +26,15 @@ cd $ZIGDIR
26git fetch --unshallow || true26git fetch --unshallow || true
27git fetch --tags27git fetch --tags
2828
29rm -rf build-release
30mkdir build-release
31cd build-release
32
33# Override the cache directories because they won't actually help other CI runs29# Override the cache directories because they won't actually help other CI runs
34# which will be testing alternate versions of zig, and ultimately would just30# which will be testing alternate versions of zig, and ultimately would just
35# fill up space on the hard drive for no reason.31# fill up space on the hard drive for no reason.
36export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"32export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
37export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"33export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3834
35mkdir build-release
36cd build-release
37
39PATH="$HOME/local/bin:$PATH" cmake .. \38PATH="$HOME/local/bin:$PATH" cmake .. \
40 -DCMAKE_INSTALL_PREFIX="stage3-release" \39 -DCMAKE_INSTALL_PREFIX="stage3-release" \
41 -DCMAKE_PREFIX_PATH="$PREFIX" \40 -DCMAKE_PREFIX_PATH="$PREFIX" \
ci/aarch64-windows.ps1+4-5
...@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {...@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
30 git fetch --unshallow # `git describe` won't work on a shallow repo30 git fetch --unshallow # `git describe` won't work on a shallow repo
31}31}
3232
33Write-Output "Building from source..."
34Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
35New-Item -Path 'build-release' -ItemType Directory
36Set-Location -Path 'build-release'
37
38# Override the cache directories because they won't actually help other CI runs33# Override the cache directories because they won't actually help other CI runs
39# which will be testing alternate versions of zig, and ultimately would just34# which will be testing alternate versions of zig, and ultimately would just
40# fill up space on the hard drive for no reason.35# fill up space on the hard drive for no reason.
41$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"36$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
42$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"37$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"
4338
39Write-Output "Building from source..."
40New-Item -Path 'build-release' -ItemType Directory
41Set-Location -Path 'build-release'
42
44# CMake gives a syntax error when file paths with backward slashes are used.43# CMake gives a syntax error when file paths with backward slashes are used.
45# Here, we use forward slashes only to work around this.44# Here, we use forward slashes only to work around this.
46& cmake .. `45& cmake .. `
ci/x86_64-linux-debug.sh+8-14
...@@ -19,26 +19,23 @@ export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_6...@@ -19,26 +19,23 @@ export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_6
19git fetch --unshallow || true19git fetch --unshallow || true
20git fetch --tags20git fetch --tags
2121
22# Override the cache directories because they won't actually help other CI runs
23# which will be testing alternate versions of zig, and ultimately would just
24# fill up space on the hard drive for no reason.
25export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
26export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
27
22# Test building from source without LLVM.28# Test building from source without LLVM.
23git clean -fd
24rm -rf zig-out
25cc -o bootstrap bootstrap.c29cc -o bootstrap bootstrap.c
26./bootstrap30./bootstrap
27./zig2 build -Dno-lib31./zig2 build -Dno-lib
28./zig-out/bin/zig test test/behavior.zig32./zig-out/bin/zig test test/behavior.zig
2933
30export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
31export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
32
33rm -rf build-debug
34mkdir build-debug34mkdir build-debug
35cd build-debug35cd build-debug
3636
37# Override the cache directories because they won't actually help other CI runs37export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
38# which will be testing alternate versions of zig, and ultimately would just38export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
39# fill up space on the hard drive for no reason.
40export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
41export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
4239
43cmake .. \40cmake .. \
44 -DCMAKE_INSTALL_PREFIX="stage3-debug" \41 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
...@@ -76,12 +73,9 @@ stage3-debug/bin/zig build test docs \...@@ -76,12 +73,9 @@ stage3-debug/bin/zig build test docs \
76# Ensure that updating the wasm binary from this commit will result in a viable build.73# Ensure that updating the wasm binary from this commit will result in a viable build.
77stage3-debug/bin/zig build update-zig174stage3-debug/bin/zig build update-zig1
7875
79rm -rf ../build-new
80mkdir ../build-new76mkdir ../build-new
81cd ../build-new77cd ../build-new
8278
83export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
84export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
85export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"79export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
86export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"80export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
8781
ci/x86_64-linux-release.sh+8-14
...@@ -19,26 +19,23 @@ export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_6...@@ -19,26 +19,23 @@ export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_6
19git fetch --unshallow || true19git fetch --unshallow || true
20git fetch --tags20git fetch --tags
2121
22# Override the cache directories because they won't actually help other CI runs
23# which will be testing alternate versions of zig, and ultimately would just
24# fill up space on the hard drive for no reason.
25export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
26export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
27
22# Test building from source without LLVM.28# Test building from source without LLVM.
23git clean -fd
24rm -rf zig-out
25cc -o bootstrap bootstrap.c29cc -o bootstrap bootstrap.c
26./bootstrap30./bootstrap
27./zig2 build -Dno-lib31./zig2 build -Dno-lib
28./zig-out/bin/zig test test/behavior.zig32./zig-out/bin/zig test test/behavior.zig
2933
30export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
31export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
32
33rm -rf build-release
34mkdir build-release34mkdir build-release
35cd build-release35cd build-release
3636
37# Override the cache directories because they won't actually help other CI runs37export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
38# which will be testing alternate versions of zig, and ultimately would just38export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
39# fill up space on the hard drive for no reason.
40export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
41export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
4239
43cmake .. \40cmake .. \
44 -DCMAKE_INSTALL_PREFIX="stage3-release" \41 -DCMAKE_INSTALL_PREFIX="stage3-release" \
...@@ -92,12 +89,9 @@ diff stage3-release/bin/zig stage4-release/bin/zig...@@ -92,12 +89,9 @@ diff stage3-release/bin/zig stage4-release/bin/zig
92# Ensure that updating the wasm binary from this commit will result in a viable build.89# Ensure that updating the wasm binary from this commit will result in a viable build.
93stage3-release/bin/zig build update-zig190stage3-release/bin/zig build update-zig1
9491
95rm -rf ../build-new
96mkdir ../build-new92mkdir ../build-new
97cd ../build-new93cd ../build-new
9894
99export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
100export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
101export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"95export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
102export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"96export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
10397
ci/x86_64-macos-release.sh+6-9
...@@ -24,24 +24,21 @@ cd $ZIGDIR...@@ -24,24 +24,21 @@ cd $ZIGDIR
24git fetch --unshallow || true24git fetch --unshallow || true
25git fetch --tags25git fetch --tags
2626
27# Override the cache directories because they won't actually help other CI runs
28# which will be testing alternate versions of zig, and ultimately would just
29# fill up space on the hard drive for no reason.
30export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
31export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
32
27# Test building from source without LLVM.33# Test building from source without LLVM.
28git clean -fd
29rm -rf zig-out
30cc -o bootstrap bootstrap.c34cc -o bootstrap bootstrap.c
31./bootstrap35./bootstrap
32./zig2 build -Dno-lib36./zig2 build -Dno-lib
33./zig-out/bin/zig test test/behavior.zig37./zig-out/bin/zig test test/behavior.zig
3438
35rm -rf build
36mkdir build39mkdir build
37cd build40cd build
3841
39# Override the cache directories because they won't actually help other CI runs
40# which will be testing alternate versions of zig, and ultimately would just
41# fill up space on the hard drive for no reason.
42export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
43export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
44
45cmake .. \42cmake .. \
46 -DCMAKE_PREFIX_PATH="$PREFIX" \43 -DCMAKE_PREFIX_PATH="$PREFIX" \
47 -DCMAKE_BUILD_TYPE=Release \44 -DCMAKE_BUILD_TYPE=Release \
ci/x86_64-windows-debug.ps1+4-5
...@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {...@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
30 git fetch --unshallow # `git describe` won't work on a shallow repo30 git fetch --unshallow # `git describe` won't work on a shallow repo
31}31}
3232
33Write-Output "Building from source..."
34Remove-Item -Path 'build-debug' -Recurse -Force -ErrorAction Ignore
35New-Item -Path 'build-debug' -ItemType Directory
36Set-Location -Path 'build-debug'
37
38# Override the cache directories because they won't actually help other CI runs33# Override the cache directories because they won't actually help other CI runs
39# which will be testing alternate versions of zig, and ultimately would just34# which will be testing alternate versions of zig, and ultimately would just
40# fill up space on the hard drive for no reason.35# fill up space on the hard drive for no reason.
41$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"36$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
42$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"37$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"
4338
39Write-Output "Building from source..."
40New-Item -Path 'build-debug' -ItemType Directory
41Set-Location -Path 'build-debug'
42
44# CMake gives a syntax error when file paths with backward slashes are used.43# CMake gives a syntax error when file paths with backward slashes are used.
45# Here, we use forward slashes only to work around this.44# Here, we use forward slashes only to work around this.
46& cmake .. `45& cmake .. `
ci/x86_64-windows-release.ps1+4-5
...@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {...@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
30 git fetch --unshallow # `git describe` won't work on a shallow repo30 git fetch --unshallow # `git describe` won't work on a shallow repo
31}31}
3232
33Write-Output "Building from source..."
34Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
35New-Item -Path 'build-release' -ItemType Directory
36Set-Location -Path 'build-release'
37
38# Override the cache directories because they won't actually help other CI runs33# Override the cache directories because they won't actually help other CI runs
39# which will be testing alternate versions of zig, and ultimately would just34# which will be testing alternate versions of zig, and ultimately would just
40# fill up space on the hard drive for no reason.35# fill up space on the hard drive for no reason.
41$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"36$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
42$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"37$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"
4338
39Write-Output "Building from source..."
40New-Item -Path 'build-release' -ItemType Directory
41Set-Location -Path 'build-release'
42
44# CMake gives a syntax error when file paths with backward slashes are used.43# CMake gives a syntax error when file paths with backward slashes are used.
45# Here, we use forward slashes only to work around this.44# Here, we use forward slashes only to work around this.
46& cmake .. `45& cmake .. `