| author | |
| committer | |
| log | 85580951a7755cf418776ed93ed9c5ad3011c3e9 |
| tree | dbeea79aed17a4a2e786954ab56426f18d7f3d3e |
| parent | b7a4756e1dd4d35da8f4c14dde1e84cca16d4833 |
| signature |
2 files changed, 130 insertions(+), 0 deletions(-)
ci/x86_64-netbsd-debug.sh created+62| ... | @@ -0,0 +1,62 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Requires cmake ninja-build | ||
| 4 | |||
| 5 | set -x | ||
| 6 | set -e | ||
| 7 | |||
| 8 | TARGET="x86_64-netbsd-none" | ||
| 9 | MCPU="baseline" | ||
| 10 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.2287+eb3f16db5" | ||
| 11 | PREFIX="$HOME/deps/$CACHE_BASENAME" | ||
| 12 | ZIG="$PREFIX/bin/zig" | ||
| 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 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | ||
| 18 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | ||
| 19 | |||
| 20 | mkdir build-debug | ||
| 21 | cd build-debug | ||
| 22 | |||
| 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 25 | |||
| 26 | cmake .. \ | ||
| 27 | -DCMAKE_INSTALL_PREFIX="stage3-debug" \ | ||
| 28 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | ||
| 29 | -DCMAKE_BUILD_TYPE=Debug \ | ||
| 30 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 31 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 32 | -DZIG_STATIC=ON \ | ||
| 33 | -DZIG_NO_LIB=ON \ | ||
| 34 | -GNinja \ | ||
| 35 | -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ | ||
| 36 | -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE | ||
| 37 | # https://github.com/ziglang/zig/issues/22213 | ||
| 38 | |||
| 39 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | ||
| 40 | # so that installation and testing do not get affected by them. | ||
| 41 | unset CC | ||
| 42 | unset CXX | ||
| 43 | |||
| 44 | ninja install | ||
| 45 | |||
| 46 | stage3-debug/bin/zig build test docs \ | ||
| 47 | --maxrss ${ZSF_MAX_RSS:-0} \ | ||
| 48 | -Dstatic-llvm \ | ||
| 49 | -Dskip-non-native \ | ||
| 50 | --search-prefix "$PREFIX" \ | ||
| 51 | --zig-lib-dir "$PWD/../lib" \ | ||
| 52 | --test-timeout 2m | ||
| 53 | |||
| 54 | stage3-debug/bin/zig build \ | ||
| 55 | --prefix stage4-debug \ | ||
| 56 | -Denable-llvm \ | ||
| 57 | -Dno-lib \ | ||
| 58 | -Dtarget=$TARGET \ | ||
| 59 | -Duse-zig-libcxx \ | ||
| 60 | -Dversion-string="$(stage3-debug/bin/zig version)" | ||
| 61 | |||
| 62 | stage4-debug/bin/zig test ../test/behavior.zig | ||
ci/x86_64-netbsd-release.sh created+68| ... | @@ -0,0 +1,68 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Requires cmake ninja-build | ||
| 4 | |||
| 5 | set -x | ||
| 6 | set -e | ||
| 7 | |||
| 8 | TARGET="x86_64-netbsd-none" | ||
| 9 | MCPU="baseline" | ||
| 10 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.2287+eb3f16db5" | ||
| 11 | PREFIX="$HOME/deps/$CACHE_BASENAME" | ||
| 12 | ZIG="$PREFIX/bin/zig" | ||
| 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 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | ||
| 18 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | ||
| 19 | |||
| 20 | mkdir build-release | ||
| 21 | cd build-release | ||
| 22 | |||
| 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 25 | |||
| 26 | cmake .. \ | ||
| 27 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | ||
| 28 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | ||
| 29 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 30 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 31 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 32 | -DZIG_STATIC=ON \ | ||
| 33 | -DZIG_NO_LIB=ON \ | ||
| 34 | -GNinja \ | ||
| 35 | -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ | ||
| 36 | -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE | ||
| 37 | # https://github.com/ziglang/zig/issues/22213 | ||
| 38 | |||
| 39 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | ||
| 40 | # so that installation and testing do not get affected by them. | ||
| 41 | unset CC | ||
| 42 | unset CXX | ||
| 43 | |||
| 44 | ninja install | ||
| 45 | |||
| 46 | stage3-release/bin/zig build test docs \ | ||
| 47 | --maxrss ${ZSF_MAX_RSS:-0} \ | ||
| 48 | -Dstatic-llvm \ | ||
| 49 | -Dskip-non-native \ | ||
| 50 | --search-prefix "$PREFIX" \ | ||
| 51 | --zig-lib-dir "$PWD/../lib" \ | ||
| 52 | --test-timeout 2m | ||
| 53 | |||
| 54 | # Ensure that stage3 and stage4 are byte-for-byte identical. | ||
| 55 | stage3-release/bin/zig build \ | ||
| 56 | --prefix stage4-release \ | ||
| 57 | -Denable-llvm \ | ||
| 58 | -Dno-lib \ | ||
| 59 | -Doptimize=ReleaseFast \ | ||
| 60 | -Dstrip \ | ||
| 61 | -Dtarget=$TARGET \ | ||
| 62 | -Duse-zig-libcxx \ | ||
| 63 | -Dversion-string="$(stage3-release/bin/zig version)" | ||
| 64 | |||
| 65 | # diff returns an error code if the files differ. | ||
| 66 | echo "If the following command fails, it means nondeterminism has been" | ||
| 67 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | ||
| 68 | diff stage3-release/bin/zig stage4-release/bin/zig | ||