zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

x86_64-linux-debug.sh (1872B) - Raw


      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.15.0-dev.233+7c85dc460"
     12 PREFIX="$HOME/deps/$CACHE_BASENAME"
     13 ZIG="$PREFIX/bin/zig"
     14 
     15 export PATH="$HOME/deps/wasmtime-v29.0.0-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-10.0.2/bin:$HOME/local/bin:$PATH"
     16 
     17 # Make the `zig version` number consistent.
     18 # This will affect the cmake command below.
     19 git fetch --unshallow || true
     20 git fetch --tags
     21 
     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.
     25 export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
     26 export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
     27 
     28 mkdir build-debug
     29 cd build-debug
     30 
     31 export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
     32 export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
     33 
     34 cmake .. \
     35   -DCMAKE_INSTALL_PREFIX="stage3-debug" \
     36   -DCMAKE_PREFIX_PATH="$PREFIX" \
     37   -DCMAKE_BUILD_TYPE=Debug \
     38   -DZIG_TARGET_TRIPLE="$TARGET" \
     39   -DZIG_TARGET_MCPU="$MCPU" \
     40   -DZIG_STATIC=ON \
     41   -DZIG_NO_LIB=ON \
     42   -GNinja
     43 
     44 # Now cmake will use zig as the C/C++ compiler. We reset the environment variables
     45 # so that installation and testing do not get affected by them.
     46 unset CC
     47 unset CXX
     48 
     49 ninja install
     50 
     51 # simultaneously test building self-hosted without LLVM and with 32-bit arm
     52 stage3-debug/bin/zig build \
     53   -Dtarget=arm-linux-musleabihf \
     54   -Dno-lib
     55 
     56 stage3-debug/bin/zig build test docs \
     57   --maxrss 21000000000 \
     58   -Dlldb=$HOME/deps/lldb-zig/Debug-e0a42bb34/bin/lldb \
     59   -fqemu \
     60   -fwasmtime \
     61   -Dstatic-llvm \
     62   -Dskip-freebsd \
     63   -Dskip-netbsd \
     64   -Dskip-windows \
     65   -Dskip-macos \
     66   -Dskip-llvm \
     67   -Dtarget=native-native-musl \
     68   --search-prefix "$PREFIX" \
     69   --zig-lib-dir "$PWD/../lib" \
     70   -Denable-superhtml