Commit b3b507ad8f

Andrew Kelley <andrew@ziglang.org>
2022-11-22 22:13:58
CI: disable building tarballs; x86 self-hosted
1 parent 942a104
.github/workflows/ci.yaml
@@ -57,29 +57,3 @@ jobs:
         uses: actions/checkout@v3
       - name: Build and Test
         run: ./ci/macos/build-aarch64.sh
-  build-tarballs:
-    if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}  
-    runs-on: ubuntu-latest
-    needs: 
-      - x86_64-linux-debug
-      - x86_64-linux-release
-      - x86_64-macos
-      - x86_64-windows
-      - aarch64-linux
-      - aarch64-macos
-    env:
-      ZIG_VERSION: "${{ needs.x86_64-linux-debug.outputs.version }}"
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v3            
-      - uses: webfactory/ssh-agent@v0.6.0
-        with:
-          ssh-private-key: ${{ secrets.WEBSITE_CI_PUSH_SSH_KEY }}
-      - name: Set AWS credentials
-        uses: aws-actions/configure-aws-credentials@v1
-        with:
-          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
-          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
-          aws-region: eu-west-1      
-      - name: Build Tarballs
-        run: sh ./ci/linux/build-tarballs.sh
ci/linux/build-aarch64.sh
@@ -12,7 +12,7 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1"
 PREFIX="$HOME/deps/$CACHE_BASENAME"
 ZIG="$PREFIX/bin/zig" 
 
-export PATH="$HOME/deps/wasmtime-v2.0.2-aarch64-linux:$PATH"
+export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$PATH"
 
 # Make the `zig version` number consistent.
 # This will affect the cmake command below.
@@ -42,6 +42,14 @@ unset CXX
 
 ninja install
 
+echo "Looking for non-conforming code formatting..."
+stage3-release/bin/zig fmt --check .. \
+  --exclude ../test/cases/ \
+  --exclude ../build-release
+
+# simultaneously test building self-hosted without LLVM and with 32-bit arm
+stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf
+
 # TODO: add -fqemu back to this line
 
 stage3-release/bin/zig build test docs \
@@ -51,15 +59,12 @@ stage3-release/bin/zig build test docs \
   --search-prefix "$PREFIX" \
   --zig-lib-dir "$(pwd)/../lib"
 
+# Look for HTML errors.
+tidy --drop-empty-elements no -qe zig-cache/langref.html
+
 # Produce the experimental std lib documentation.
 mkdir -p "stage3-release/doc/std"
 stage3-release/bin/zig test ../lib/std/std.zig \
   -femit-docs=stage3-release/doc/std \
   -fno-emit-bin \
   --zig-lib-dir "$(pwd)/../lib"
-
-# cp ../LICENSE $RELEASE_STAGING/
-# cp ../zig-cache/langref.html $RELEASE_STAGING/doc/
-
-# # Look for HTML errors.
-# tidy --drop-empty-elements no -qe $RELEASE_STAGING/doc/langref.html
ci/linux/build-x86_64-debug.sh
@@ -1,56 +1,70 @@
 #!/bin/sh
 
+# Requires cmake ninja-build
+
 set -x
 set -e
 
-ZIGDIR="$(pwd)"
 ARCH="$(uname -m)"
-DEPS_LOCAL="$HOME/local"
-OLD_ZIG="$DEPS_LOCAL/bin/zig"
-TARGET="${ARCH}-linux-musl"
-
-mkdir -p "$DEPS_LOCAL"
-cd "$DEPS_LOCAL"
+TARGET="$ARCH-linux-musl"
+MCPU="baseline"
+CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1"
+PREFIX="$HOME/deps/$CACHE_BASENAME"
+ZIG="$PREFIX/bin/zig"
 
-OLD_ZIG_VERSION="0.11.0-dev.256+271cc52a1"
-wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz
-tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz
+export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH"
 
-wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz
-tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz
+# Make the `zig version` number consistent.
+# This will affect the cmake command below.
+git config core.abbrev 9
+git fetch --unshallow || true
+git fetch --tags
 
-wget https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.2/wasmtime-v2.0.2-x86_64-linux.tar.xz
-tar x --strip-components=1 -f wasmtime-v2.0.2-x86_64-linux.tar.xz
-rm -f LICENSE README.md
-mv wasmtime bin/
+export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
+export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
 
-export PATH=$DEPS_LOCAL/bin:$PATH
+rm -rf build-debug
+mkdir build-debug
+cd build-debug
+cmake .. \
+  -DCMAKE_INSTALL_PREFIX="stage3-debug" \
+  -DCMAKE_PREFIX_PATH="$PREFIX" \
+  -DCMAKE_BUILD_TYPE=Debug \
+  -DZIG_TARGET_TRIPLE="$TARGET" \
+  -DZIG_TARGET_MCPU="$MCPU" \
+  -DZIG_STATIC=ON \
+  -GNinja
 
-cd "$ZIGDIR"
-echo "building stage3-debug with zig version $($OLD_ZIG version)"
+# 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.
+unset CC
+unset CXX
 
-"$OLD_ZIG" build \
-  --prefix stage3 \
-  --search-prefix "$DEPS_LOCAL" \
-  --zig-lib-dir lib \
-  -Denable-stage1 \
-  -Dstatic-llvm \
-  -Drelease \
-  -Duse-zig-libcxx \
-  -Dtarget="$TARGET"
+ninja install
 
 echo "Looking for non-conforming code formatting..."
-stage3/bin/zig fmt --check . \
-  --exclude test/cases/ \
-  --exclude build
+stage3-debug/bin/zig fmt --check .. \
+  --exclude ../test/cases/ \
+  --exclude ../build-debug \
+  --exclude ../build-release
 
 # simultaneously test building self-hosted without LLVM and with 32-bit arm
-stage3/bin/zig build -Dtarget=arm-linux-musleabihf
+stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf
 
-stage3/bin/zig build test docs \
+stage3-debug/bin/zig build test docs \
   -fqemu \
   -fwasmtime \
   -Dstatic-llvm \
   -Dtarget=native-native-musl \
-  --search-prefix "$DEPS_LOCAL" \
-  --zig-lib-dir lib
+  --search-prefix "$PREFIX" \
+  --zig-lib-dir "$(pwd)/../lib"
+
+# Look for HTML errors.
+tidy --drop-empty-elements no -qe zig-cache/langref.html
+
+# Produce the experimental std lib documentation.
+mkdir -p "stage3-debug/doc/std"
+stage3-debug/bin/zig test ../lib/std/std.zig \
+  -femit-docs=stage3-debug/doc/std \
+  -fno-emit-bin \
+  --zig-lib-dir "$(pwd)/../lib"
ci/linux/build-x86_64-release.sh
@@ -1,75 +1,86 @@
 #!/bin/sh
 
+# Requires cmake ninja-build
+
 set -x
 set -e
 
-ZIGDIR="$(pwd)"
 ARCH="$(uname -m)"
-DEPS_LOCAL="$HOME/local"
-OLD_ZIG="$DEPS_LOCAL/bin/zig"
-TARGET="${ARCH}-linux-musl"
+TARGET="$ARCH-linux-musl"
 MCPU="baseline"
+CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1"
+PREFIX="$HOME/deps/$CACHE_BASENAME"
+ZIG="$PREFIX/bin/zig" 
 
-mkdir -p "$DEPS_LOCAL"
-cd "$DEPS_LOCAL"
-
-OLD_ZIG_VERSION="0.11.0-dev.256+271cc52a1"
-wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz
-tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz
-
-wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz
-tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz
-
-wget https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.2/wasmtime-v2.0.2-x86_64-linux.tar.xz
-tar x --strip-components=1 -f wasmtime-v2.0.2-x86_64-linux.tar.xz
-rm -f LICENSE README.md
-mv wasmtime bin/
-
-export PATH=$DEPS_LOCAL/bin:$PATH
+export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH"
 
-cd "$ZIGDIR"
-echo "building stage3-release with zig version $($OLD_ZIG version)"
+# Make the `zig version` number consistent.
+# This will affect the cmake command below.
+git config core.abbrev 9
+git fetch --unshallow || true
+git fetch --tags
 
-export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU"
-export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU"
+export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
+export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
 
-mkdir build
-cd build
+rm -rf build-release
+mkdir build-release
+cd build-release
 cmake .. \
-  -DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \
-  -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \
+  -DCMAKE_INSTALL_PREFIX="stage3-release" \
+  -DCMAKE_PREFIX_PATH="$PREFIX" \
   -DCMAKE_BUILD_TYPE=Release \
   -DZIG_TARGET_TRIPLE="$TARGET" \
   -DZIG_TARGET_MCPU="$MCPU" \
-  -DZIG_STATIC=ON
+  -DZIG_STATIC=ON \
+  -GNinja
 
 # 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.
 unset CC
 unset CXX
 
-make -j2 install
+ninja install
 
-"stage3/bin/zig" build test \
+echo "Looking for non-conforming code formatting..."
+stage3-release/bin/zig fmt --check .. \
+  --exclude ../test/cases/ \
+  --exclude ../build-debug \
+  --exclude ../build-release
+
+# simultaneously test building self-hosted without LLVM and with 32-bit arm
+stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf
+
+stage3-release/bin/zig build test docs \
   -fqemu \
   -fwasmtime \
   -Dstatic-llvm \
   -Dtarget=native-native-musl \
-  --search-prefix "$DEPS_LOCAL" \
+  --search-prefix "$PREFIX" \
+  --zig-lib-dir "$(pwd)/../lib"
+
+# Look for HTML errors.
+tidy --drop-empty-elements no -qe zig-cache/langref.html
+
+# Produce the experimental std lib documentation.
+mkdir -p "stage3-release/doc/std"
+stage3-release/bin/zig test ../lib/std/std.zig \
+  -femit-docs=stage3-release/doc/std \
+  -fno-emit-bin \
   --zig-lib-dir "$(pwd)/../lib"
 
 "stage3/bin/zig" build \
-  --prefix stage4 \
+  --prefix stage4-release \
   -Denable-llvm \
   -Denable-stage1 \
   -Dno-lib \
   -Drelease \
   -Dstrip \
-  -Dtarget=x86_64-linux-musl \
+  -Dtarget=$TARGET \
   -Duse-zig-libcxx \
-  -Dversion-string="$(stage3/bin/zig version)"
+  -Dversion-string="$(stage3-release/bin/zig version)"
 
 # diff returns an error code if the files differ.
 echo "If the following command fails, it means nondeterminism has been"
 echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
-diff stage3/bin/zig stage4/bin/zig
+diff stage3-release/bin/zig stage4-release/bin/zig