diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-11 00:29:40 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-19 16:45:15 -0700 |
| commit | 5b486b1851ce3ee930236653fc0f8b0ec3eef5e6 (patch) | |
| tree | 5afced6e929e10d015b5557a9800023b3943fc94 /ci | |
| parent | a8f86291d2c108fbc70de175660742a737b78823 (diff) | |
| download | zig-5b486b1851ce3ee930236653fc0f8b0ec3eef5e6.tar.gz zig-5b486b1851ce3ee930236653fc0f8b0ec3eef5e6.zip | |
CI: use zig build to produce release artifact
For both macOS and FreeBSD.
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci/azure/macos_script | 27 | ||||
| -rwxr-xr-x | ci/srht/freebsd_script | 50 |
2 files changed, 40 insertions, 37 deletions
diff --git a/ci/azure/macos_script b/ci/azure/macos_script index bf55dda510..4f3c5697b0 100755 --- a/ci/azure/macos_script +++ b/ci/azure/macos_script @@ -34,13 +34,11 @@ git fetch --tags mkdir build cd build cmake .. \ - -DCMAKE_INSTALL_PREFIX="$(pwd)/stage2" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ - -DZIG_STATIC=ON \ - -DZIG_OMIT_STAGE2=ON + -DZIG_STATIC=ON # Now cmake will use zig as the C/C++ compiler. We reset the environment variables # so that installation and testing do not get affected by them. @@ -49,13 +47,8 @@ unset CXX make $JOBS install -# Here we rebuild zig but this time using the Zig binary we just now produced to -# build zig1.o rather than relying on the one built with stage0. See -# https://github.com/ziglang/zig/issues/6830 for more details. -cmake .. -DZIG_EXECUTABLE="$(pwd)/stage2/bin/zig" -make $JOBS install - -stage2/bin/zig build -p release \ +stage2/bin/zig build \ + --prefix stage3-release \ --search-prefix "$PREFIX" \ -Dstatic-llvm \ -Drelease \ @@ -63,21 +56,21 @@ stage2/bin/zig build -p release \ -Dtarget="$TARGET" \ -Denable-stage1 -release/bin/zig build test docs \ +stage3-release/bin/zig build test docs \ -Denable-macos-sdk \ -Dstatic-llvm \ --search-prefix "$PREFIX" if [ "${BUILD_REASON}" != "PullRequest" ]; then - mv ../LICENSE release/ - mv ../zig-cache/langref.html release/ - mv release/bin/zig release/ - rmdir release/bin + mv ../LICENSE stage3-release/ + mv ../zig-cache/langref.html stage3-release/ + mv stage3-release/bin/zig stage3-release/ + rmdir stage3-release/bin - VERSION=$(release/zig version) + VERSION=$(stage3-release/zig version) DIRNAME="zig-macos-$ARCH-$VERSION" TARBALL="$DIRNAME.tar.xz" - mv release "$DIRNAME" + mv stage3-release "$DIRNAME" tar cfJ "$TARBALL" "$DIRNAME" mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg" diff --git a/ci/srht/freebsd_script b/ci/srht/freebsd_script index 02ab218756..dc22a02ed5 100755 --- a/ci/srht/freebsd_script +++ b/ci/srht/freebsd_script @@ -7,7 +7,9 @@ sudo pkg update -fq sudo pkg install -y cmake py39-s3cmd wget curl jq samurai ZIGDIR="$(pwd)" -CACHE_BASENAME="zig+llvm+lld+clang-x86_64-freebsd-gnu-0.10.0-dev.3524+74673b7f6" +TARGET="x86_64-freebsd-gnu" +MCPU="baseline" +CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.3524+74673b7f6" PREFIX="$HOME/$CACHE_BASENAME" cd $HOME @@ -30,38 +32,46 @@ export TERM=dumb mkdir build cd build cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=$PREFIX \ - "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \ - -DZIG_STATIC=ON \ - -DZIG_TARGET_TRIPLE=x86_64-freebsd-gnu \ - -GNinja + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=$PREFIX \ + -DZIG_TARGET_TRIPLE="$TARGET" \ + -DZIG_TARGET_MCPU="$MCPU" \ + -DZIG_STATIC=ON \ + -GNinja samu install -# Here we rebuild zig but this time using the Zig binary we just now produced to -# build zig1.o rather than relying on the one built with stage0. This makes it -# a stage3 build rather than a stage2 build. -cmake .. -DZIG_EXECUTABLE="$PREFIX/bin/zig" -samu install +# TODO: eliminate this workaround. Without this, zig does not end up passing +# -isystem /usr/include when building libc++, resulting in #include <sys/endian.h> +# "file not found" errors. +stage2/bin/zig libc >libc.txt -# Here we skip some tests to save time. -release/bin/zig build test docs \ +ZIG_LIBC=libc.txt stage2/bin/zig build \ + --prefix stage3-release \ --search-prefix "$PREFIX" \ -Dstatic-llvm \ + -Drelease \ + -Dstrip \ + -Dtarget="$TARGET" \ + -Denable-stage1 + +# Here we skip some tests to save time. +stage3-release/bin/zig build test docs \ + -Dstatic-llvm \ + --search-prefix "$PREFIX" \ -Dskip-stage1 \ -Dskip-non-native if [ -f ~/.s3cfg ]; then - mv ../LICENSE release/ - mv ../zig-cache/langref.html release/ - mv release/bin/zig release/ - rmdir release/bin + mv ../LICENSE stage3-release/ + mv ../zig-cache/langref.html stage3-release/ + mv stage3-release/bin/zig stage3-release/ + rmdir stage3-release/bin GITBRANCH=$(basename $GITHUB_REF) - VERSION=$(release/zig version) + VERSION=$(stage3-release/zig version) DIRNAME="zig-freebsd-x86_64-$VERSION" TARBALL="$DIRNAME.tar.xz" - mv release "$DIRNAME" + mv stage3-release "$DIRNAME" tar cfJ "$TARBALL" "$DIRNAME" s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ |
