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"
1919git fetch --unshallow || true
2020git 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
2922# Override the cache directories because they won't actually help other CI runs
3023# which will be testing alternate versions of zig, and ultimately would just
3124# fill up space on the hard drive for no reason.
3225export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
3326export 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
3534cmake .. \
3635 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
3736 -DCMAKE_PREFIX_PATH="$PREFIX" \
......@@ -66,12 +65,9 @@ stage3-debug/bin/zig build test docs \
6665# Ensure that updating the wasm binary from this commit will result in a viable build.
6766stage3-debug/bin/zig build update-zig1
6867
69rm -rf ../build-new
7068mkdir ../build-new
7169cd ../build-new
7270
73export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
74export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
7571export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
7672export 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"
1919git fetch --unshallow || true
2020git 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
2922# Override the cache directories because they won't actually help other CI runs
3023# which will be testing alternate versions of zig, and ultimately would just
3124# fill up space on the hard drive for no reason.
3225export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
3326export 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
3534cmake .. \
3635 -DCMAKE_INSTALL_PREFIX="stage3-release" \
3736 -DCMAKE_PREFIX_PATH="$PREFIX" \
......@@ -82,12 +81,9 @@ diff stage3-release/bin/zig stage4-release/bin/zig
8281# Ensure that updating the wasm binary from this commit will result in a viable build.
8382stage3-release/bin/zig build update-zig1
8483
85rm -rf ../build-new
8684mkdir ../build-new
8785cd ../build-new
8886
89export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
90export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
9187export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
9288export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
9389
ci/aarch64-macos-debug.sh+3-4
......@@ -26,16 +26,15 @@ cd $ZIGDIR
2626git fetch --unshallow || true
2727git fetch --tags
2828
29rm -rf build-debug
30mkdir build-debug
31cd build-debug
32
3329# Override the cache directories because they won't actually help other CI runs
3430# which will be testing alternate versions of zig, and ultimately would just
3531# fill up space on the hard drive for no reason.
3632export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
3733export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3834
35mkdir build-debug
36cd build-debug
37
3938PATH="$HOME/local/bin:$PATH" cmake .. \
4039 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
4140 -DCMAKE_PREFIX_PATH="$PREFIX" \
ci/aarch64-macos-release.sh+3-4
......@@ -26,16 +26,15 @@ cd $ZIGDIR
2626git fetch --unshallow || true
2727git fetch --tags
2828
29rm -rf build-release
30mkdir build-release
31cd build-release
32
3329# Override the cache directories because they won't actually help other CI runs
3430# which will be testing alternate versions of zig, and ultimately would just
3531# fill up space on the hard drive for no reason.
3632export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
3733export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3834
35mkdir build-release
36cd build-release
37
3938PATH="$HOME/local/bin:$PATH" cmake .. \
4039 -DCMAKE_INSTALL_PREFIX="stage3-release" \
4140 -DCMAKE_PREFIX_PATH="$PREFIX" \
ci/aarch64-windows.ps1+4-5
......@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
3030 git fetch --unshallow # `git describe` won't work on a shallow repo
3131}
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
3833# Override the cache directories because they won't actually help other CI runs
3934# which will be testing alternate versions of zig, and ultimately would just
4035# fill up space on the hard drive for no reason.
4136$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
4237$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
4443# CMake gives a syntax error when file paths with backward slashes are used.
4544# Here, we use forward slashes only to work around this.
4645& 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
1919git fetch --unshallow || true
2020git 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
2228# Test building from source without LLVM.
23git clean -fd
24rm -rf zig-out
2529cc -o bootstrap bootstrap.c
2630./bootstrap
2731./zig2 build -Dno-lib
2832./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
3434mkdir build-debug
3535cd build-debug
3636
37# Override the cache directories because they won't actually help other CI runs
38# which will be testing alternate versions of zig, and ultimately would just
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"
37export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
38export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
4239
4340cmake .. \
4441 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
......@@ -76,12 +73,9 @@ stage3-debug/bin/zig build test docs \
7673# Ensure that updating the wasm binary from this commit will result in a viable build.
7774stage3-debug/bin/zig build update-zig1
7875
79rm -rf ../build-new
8076mkdir ../build-new
8177cd ../build-new
8278
83export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
84export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
8579export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
8680export 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
1919git fetch --unshallow || true
2020git 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
2228# Test building from source without LLVM.
23git clean -fd
24rm -rf zig-out
2529cc -o bootstrap bootstrap.c
2630./bootstrap
2731./zig2 build -Dno-lib
2832./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
3434mkdir build-release
3535cd build-release
3636
37# Override the cache directories because they won't actually help other CI runs
38# which will be testing alternate versions of zig, and ultimately would just
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"
37export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
38export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
4239
4340cmake .. \
4441 -DCMAKE_INSTALL_PREFIX="stage3-release" \
......@@ -92,12 +89,9 @@ diff stage3-release/bin/zig stage4-release/bin/zig
9289# Ensure that updating the wasm binary from this commit will result in a viable build.
9390stage3-release/bin/zig build update-zig1
9491
95rm -rf ../build-new
9692mkdir ../build-new
9793cd ../build-new
9894
99export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
100export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
10195export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
10296export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
10397
ci/x86_64-macos-release.sh+6-9
......@@ -24,24 +24,21 @@ cd $ZIGDIR
2424git fetch --unshallow || true
2525git 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
2733# Test building from source without LLVM.
28git clean -fd
29rm -rf zig-out
3034cc -o bootstrap bootstrap.c
3135./bootstrap
3236./zig2 build -Dno-lib
3337./zig-out/bin/zig test test/behavior.zig
3438
35rm -rf build
3639mkdir build
3740cd 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
4542cmake .. \
4643 -DCMAKE_PREFIX_PATH="$PREFIX" \
4744 -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") {
3030 git fetch --unshallow # `git describe` won't work on a shallow repo
3131}
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
3833# Override the cache directories because they won't actually help other CI runs
3934# which will be testing alternate versions of zig, and ultimately would just
4035# fill up space on the hard drive for no reason.
4136$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
4237$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
4443# CMake gives a syntax error when file paths with backward slashes are used.
4544# Here, we use forward slashes only to work around this.
4645& cmake .. `
ci/x86_64-windows-release.ps1+4-5
......@@ -30,17 +30,16 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
3030 git fetch --unshallow # `git describe` won't work on a shallow repo
3131}
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
3833# Override the cache directories because they won't actually help other CI runs
3934# which will be testing alternate versions of zig, and ultimately would just
4035# fill up space on the hard drive for no reason.
4136$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
4237$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
4443# CMake gives a syntax error when file paths with backward slashes are used.
4544# Here, we use forward slashes only to work around this.
4645& cmake .. `