| ... | ... | @@ -7,7 +7,9 @@ sudo pkg update -fq |
| 7 | 7 | sudo pkg install -y cmake py39-s3cmd wget curl jq samurai |
| 8 | 8 | |
| 9 | 9 | ZIGDIR="$(pwd)" |
| 10 | | CACHE_BASENAME="zig+llvm+lld+clang-x86_64-freebsd-gnu-0.10.0-dev.3524+74673b7f6" |
| 10 | TARGET="x86_64-freebsd-gnu" |
| 11 | MCPU="baseline" |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.3524+74673b7f6" |
| 11 | 13 | PREFIX="$HOME/$CACHE_BASENAME" |
| 12 | 14 | |
| 13 | 15 | cd $HOME |
| ... | ... | @@ -30,38 +32,46 @@ export TERM=dumb |
| 30 | 32 | mkdir build |
| 31 | 33 | cd build |
| 32 | 34 | cmake .. \ |
| 33 | | -DCMAKE_BUILD_TYPE=Release \ |
| 34 | | -DCMAKE_PREFIX_PATH=$PREFIX \ |
| 35 | | "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \ |
| 36 | | -DZIG_STATIC=ON \ |
| 37 | | -DZIG_TARGET_TRIPLE=x86_64-freebsd-gnu \ |
| 38 | | -GNinja |
| 35 | -DCMAKE_BUILD_TYPE=Release \ |
| 36 | -DCMAKE_PREFIX_PATH=$PREFIX \ |
| 37 | -DZIG_TARGET_TRIPLE="$TARGET" \ |
| 38 | -DZIG_TARGET_MCPU="$MCPU" \ |
| 39 | -DZIG_STATIC=ON \ |
| 40 | -GNinja |
| 39 | 41 | samu install |
| 40 | 42 | |
| 41 | | # Here we rebuild zig but this time using the Zig binary we just now produced to |
| 42 | | # build zig1.o rather than relying on the one built with stage0. This makes it |
| 43 | | # a stage3 build rather than a stage2 build. |
| 44 | | cmake .. -DZIG_EXECUTABLE="$PREFIX/bin/zig" |
| 45 | | samu install |
| 43 | # TODO: eliminate this workaround. Without this, zig does not end up passing |
| 44 | # -isystem /usr/include when building libc++, resulting in #include <sys/endian.h> |
| 45 | # "file not found" errors. |
| 46 | stage2/bin/zig libc >libc.txt |
| 46 | 47 | |
| 47 | | # Here we skip some tests to save time. |
| 48 | | release/bin/zig build test docs \ |
| 48 | ZIG_LIBC=libc.txt stage2/bin/zig build \ |
| 49 | --prefix stage3-release \ |
| 49 | 50 | --search-prefix "$PREFIX" \ |
| 50 | 51 | -Dstatic-llvm \ |
| 52 | -Drelease \ |
| 53 | -Dstrip \ |
| 54 | -Dtarget="$TARGET" \ |
| 55 | -Denable-stage1 |
| 56 | |
| 57 | # Here we skip some tests to save time. |
| 58 | stage3-release/bin/zig build test docs \ |
| 59 | -Dstatic-llvm \ |
| 60 | --search-prefix "$PREFIX" \ |
| 51 | 61 | -Dskip-stage1 \ |
| 52 | 62 | -Dskip-non-native |
| 53 | 63 | |
| 54 | 64 | if [ -f ~/.s3cfg ]; then |
| 55 | | mv ../LICENSE release/ |
| 56 | | mv ../zig-cache/langref.html release/ |
| 57 | | mv release/bin/zig release/ |
| 58 | | rmdir release/bin |
| 65 | mv ../LICENSE stage3-release/ |
| 66 | mv ../zig-cache/langref.html stage3-release/ |
| 67 | mv stage3-release/bin/zig stage3-release/ |
| 68 | rmdir stage3-release/bin |
| 59 | 69 | |
| 60 | 70 | GITBRANCH=$(basename $GITHUB_REF) |
| 61 | | VERSION=$(release/zig version) |
| 71 | VERSION=$(stage3-release/zig version) |
| 62 | 72 | DIRNAME="zig-freebsd-x86_64-$VERSION" |
| 63 | 73 | TARBALL="$DIRNAME.tar.xz" |
| 64 | | mv release "$DIRNAME" |
| 74 | mv stage3-release "$DIRNAME" |
| 65 | 75 | tar cfJ "$TARBALL" "$DIRNAME" |
| 66 | 76 | |
| 67 | 77 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ |