| author | |
| committer | |
| log | c26c5a3c1b9dc55e157374cc5fab11fe28d53ecf |
| tree | c30f26b3242ee00701eacc40d3fabbf9d0822511 |
| parent | 4aa35160ebeb86aad3431791d57f9bd53c9079f8 |
| signature |
2 files changed, 148 insertions(+), 0 deletions(-)
ci/loongarch64-linux-debug.sh created+71| ... | ... | @@ -0,0 +1,71 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | # Requires cmake ninja-build | |
| 4 | ||
| 5 | set -x | |
| 6 | set -e | |
| 7 | ||
| 8 | ARCH="$(uname -m)" | |
| 9 | TARGET="$ARCH-linux-musl" | |
| 10 | MCPU="baseline" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.157+7fdd60df1" | |
| 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 14 | ||
| 15 | # Make the `zig version` number consistent. | |
| 16 | # This will affect the cmake command below. | |
| 17 | git fetch --unshallow || true | |
| 18 | git fetch --tags | |
| 19 | ||
| 20 | # Override the cache directories because they won't actually help other CI runs | |
| 21 | # which will be testing alternate versions of zig, and ultimately would just | |
| 22 | # fill up space on the hard drive for no reason. | |
| 23 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | |
| 24 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | |
| 25 | ||
| 26 | mkdir build-debug | |
| 27 | cd build-debug | |
| 28 | ||
| 29 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 30 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 31 | ||
| 32 | cmake .. \ | |
| 33 | -DCMAKE_INSTALL_PREFIX="stage3-debug" \ | |
| 34 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 35 | -DCMAKE_BUILD_TYPE=Debug \ | |
| 36 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 37 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 38 | -DZIG_STATIC=ON \ | |
| 39 | -DZIG_NO_LIB=ON \ | |
| 40 | -GNinja \ | |
| 41 | -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ | |
| 42 | -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE | |
| 43 | # https://github.com/ziglang/zig/issues/22213 | |
| 44 | ||
| 45 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 46 | # so that installation and testing do not get affected by them. | |
| 47 | unset CC | |
| 48 | unset CXX | |
| 49 | ||
| 50 | ninja install | |
| 51 | ||
| 52 | # No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. | |
| 53 | stage3-debug/bin/zig build test \ | |
| 54 | --maxrss 60129542144 \ | |
| 55 | -Dstatic-llvm \ | |
| 56 | -Dskip-non-native \ | |
| 57 | -Dtarget=native-native-musl \ | |
| 58 | --search-prefix "$PREFIX" \ | |
| 59 | --zig-lib-dir "$PWD/../lib" \ | |
| 60 | -Dno-langref \ | |
| 61 | -Dskip-translate-c | |
| 62 | ||
| 63 | stage3-debug/bin/zig build \ | |
| 64 | --prefix stage4-debug \ | |
| 65 | -Denable-llvm \ | |
| 66 | -Dno-lib \ | |
| 67 | -Dtarget=$TARGET \ | |
| 68 | -Duse-zig-libcxx \ | |
| 69 | -Dversion-string="$(stage3-debug/bin/zig version)" | |
| 70 | ||
| 71 | stage4-debug/bin/zig test ../test/behavior.zig |
ci/loongarch64-linux-release.sh created+77| ... | ... | @@ -0,0 +1,77 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | # Requires cmake ninja-build | |
| 4 | ||
| 5 | set -x | |
| 6 | set -e | |
| 7 | ||
| 8 | ARCH="$(uname -m)" | |
| 9 | TARGET="$ARCH-linux-musl" | |
| 10 | MCPU="baseline" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.157+7fdd60df1" | |
| 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 14 | ||
| 15 | # Make the `zig version` number consistent. | |
| 16 | # This will affect the cmake command below. | |
| 17 | git fetch --unshallow || true | |
| 18 | git fetch --tags | |
| 19 | ||
| 20 | # Override the cache directories because they won't actually help other CI runs | |
| 21 | # which will be testing alternate versions of zig, and ultimately would just | |
| 22 | # fill up space on the hard drive for no reason. | |
| 23 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | |
| 24 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | |
| 25 | ||
| 26 | mkdir build-release | |
| 27 | cd build-release | |
| 28 | ||
| 29 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 30 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 31 | ||
| 32 | cmake .. \ | |
| 33 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | |
| 34 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 35 | -DCMAKE_BUILD_TYPE=Release \ | |
| 36 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 37 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 38 | -DZIG_STATIC=ON \ | |
| 39 | -DZIG_NO_LIB=ON \ | |
| 40 | -GNinja \ | |
| 41 | -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ | |
| 42 | -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE | |
| 43 | # https://github.com/ziglang/zig/issues/22213 | |
| 44 | ||
| 45 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 46 | # so that installation and testing do not get affected by them. | |
| 47 | unset CC | |
| 48 | unset CXX | |
| 49 | ||
| 50 | ninja install | |
| 51 | ||
| 52 | # No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. | |
| 53 | stage3-release/bin/zig build test \ | |
| 54 | --maxrss 60129542144 \ | |
| 55 | -Dstatic-llvm \ | |
| 56 | -Dskip-non-native \ | |
| 57 | -Dtarget=native-native-musl \ | |
| 58 | --search-prefix "$PREFIX" \ | |
| 59 | --zig-lib-dir "$PWD/../lib" \ | |
| 60 | -Dno-langref \ | |
| 61 | -Dskip-translate-c | |
| 62 | ||
| 63 | # Ensure that stage3 and stage4 are byte-for-byte identical. | |
| 64 | stage3-release/bin/zig build \ | |
| 65 | --prefix stage4-release \ | |
| 66 | -Denable-llvm \ | |
| 67 | -Dno-lib \ | |
| 68 | -Doptimize=ReleaseFast \ | |
| 69 | -Dstrip \ | |
| 70 | -Dtarget=$TARGET \ | |
| 71 | -Duse-zig-libcxx \ | |
| 72 | -Dversion-string="$(stage3-release/bin/zig version)" | |
| 73 | ||
| 74 | # diff returns an error code if the files differ. | |
| 75 | echo "If the following command fails, it means nondeterminism has been" | |
| 76 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 77 | diff stage3-release/bin/zig stage4-release/bin/zig |