| author | |
| committer | |
| log | b3b507ad8fa9af02b76e2ba2f46d55a771c00895 |
| tree | aed05b6925497dd6f1dce752c41af73a81a9a844 |
| parent | 942a1044576a84dd337df575ae5b742366fc104f |
4 files changed, 108 insertions(+), 104 deletions(-)
.github/workflows/ci.yaml-26| ... | @@ -57,29 +57,3 @@ jobs: | ... | @@ -57,29 +57,3 @@ jobs: |
| 57 | uses: actions/checkout@v3 | 57 | uses: actions/checkout@v3 |
| 58 | - name: Build and Test | 58 | - name: Build and Test |
| 59 | run: ./ci/macos/build-aarch64.sh | 59 | run: ./ci/macos/build-aarch64.sh |
| 60 | build-tarballs: | ||
| 61 | if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
| 62 | runs-on: ubuntu-latest | ||
| 63 | needs: | ||
| 64 | - x86_64-linux-debug | ||
| 65 | - x86_64-linux-release | ||
| 66 | - x86_64-macos | ||
| 67 | - x86_64-windows | ||
| 68 | - aarch64-linux | ||
| 69 | - aarch64-macos | ||
| 70 | env: | ||
| 71 | ZIG_VERSION: "${{ needs.x86_64-linux-debug.outputs.version }}" | ||
| 72 | steps: | ||
| 73 | - name: Checkout | ||
| 74 | uses: actions/checkout@v3 | ||
| 75 | - uses: webfactory/ssh-agent@v0.6.0 | ||
| 76 | with: | ||
| 77 | ssh-private-key: ${{ secrets.WEBSITE_CI_PUSH_SSH_KEY }} | ||
| 78 | - name: Set AWS credentials | ||
| 79 | uses: aws-actions/configure-aws-credentials@v1 | ||
| 80 | with: | ||
| 81 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| 82 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| 83 | aws-region: eu-west-1 | ||
| 84 | - name: Build Tarballs | ||
| 85 | run: sh ./ci/linux/build-tarballs.sh |
ci/linux/build-aarch64.sh+12-7| ... | @@ -12,7 +12,7 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1" | ... | @@ -12,7 +12,7 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1" |
| 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" |
| 13 | ZIG="$PREFIX/bin/zig" | 13 | ZIG="$PREFIX/bin/zig" |
| 14 | 14 | ||
| 15 | export PATH="$HOME/deps/wasmtime-v2.0.2-aarch64-linux:$PATH" | 15 | export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$PATH" |
| 16 | 16 | ||
| 17 | # Make the `zig version` number consistent. | 17 | # Make the `zig version` number consistent. |
| 18 | # This will affect the cmake command below. | 18 | # This will affect the cmake command below. |
| ... | @@ -42,6 +42,14 @@ unset CXX | ... | @@ -42,6 +42,14 @@ unset CXX |
| 42 | 42 | ||
| 43 | ninja install | 43 | ninja install |
| 44 | 44 | ||
| 45 | echo "Looking for non-conforming code formatting..." | ||
| 46 | stage3-release/bin/zig fmt --check .. \ | ||
| 47 | --exclude ../test/cases/ \ | ||
| 48 | --exclude ../build-release | ||
| 49 | |||
| 50 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | ||
| 51 | stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf | ||
| 52 | |||
| 45 | # TODO: add -fqemu back to this line | 53 | # TODO: add -fqemu back to this line |
| 46 | 54 | ||
| 47 | stage3-release/bin/zig build test docs \ | 55 | stage3-release/bin/zig build test docs \ |
| ... | @@ -51,15 +59,12 @@ stage3-release/bin/zig build test docs \ | ... | @@ -51,15 +59,12 @@ stage3-release/bin/zig build test docs \ |
| 51 | --search-prefix "$PREFIX" \ | 59 | --search-prefix "$PREFIX" \ |
| 52 | --zig-lib-dir "$(pwd)/../lib" | 60 | --zig-lib-dir "$(pwd)/../lib" |
| 53 | 61 | ||
| 62 | # Look for HTML errors. | ||
| 63 | tidy --drop-empty-elements no -qe zig-cache/langref.html | ||
| 64 | |||
| 54 | # Produce the experimental std lib documentation. | 65 | # Produce the experimental std lib documentation. |
| 55 | mkdir -p "stage3-release/doc/std" | 66 | mkdir -p "stage3-release/doc/std" |
| 56 | stage3-release/bin/zig test ../lib/std/std.zig \ | 67 | stage3-release/bin/zig test ../lib/std/std.zig \ |
| 57 | -femit-docs=stage3-release/doc/std \ | 68 | -femit-docs=stage3-release/doc/std \ |
| 58 | -fno-emit-bin \ | 69 | -fno-emit-bin \ |
| 59 | --zig-lib-dir "$(pwd)/../lib" | 70 | --zig-lib-dir "$(pwd)/../lib" |
| 60 | |||
| 61 | # cp ../LICENSE $RELEASE_STAGING/ | ||
| 62 | # cp ../zig-cache/langref.html $RELEASE_STAGING/doc/ | ||
| 63 | |||
| 64 | # # Look for HTML errors. | ||
| 65 | # tidy --drop-empty-elements no -qe $RELEASE_STAGING/doc/langref.html |
ci/linux/build-x86_64-debug.sh+49-35| ... | @@ -1,56 +1,70 @@ | ... | @@ -1,56 +1,70 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # Requires cmake ninja-build | ||
| 4 | |||
| 3 | set -x | 5 | set -x |
| 4 | set -e | 6 | set -e |
| 5 | 7 | ||
| 6 | ZIGDIR="$(pwd)" | ||
| 7 | ARCH="$(uname -m)" | 8 | ARCH="$(uname -m)" |
| 8 | DEPS_LOCAL="$HOME/local" | 9 | TARGET="$ARCH-linux-musl" |
| 9 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | 10 | MCPU="baseline" |
| 10 | TARGET="${ARCH}-linux-musl" | 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1" |
| 11 | 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | |
| 12 | mkdir -p "$DEPS_LOCAL" | 13 | ZIG="$PREFIX/bin/zig" |
| 13 | cd "$DEPS_LOCAL" | ||
| 14 | 14 | ||
| 15 | OLD_ZIG_VERSION="0.11.0-dev.256+271cc52a1" | 15 | export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH" |
| 16 | wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz | ||
| 17 | tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz | ||
| 18 | 16 | ||
| 19 | wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz | 17 | # Make the `zig version` number consistent. |
| 20 | tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz | 18 | # This will affect the cmake command below. |
| 19 | git config core.abbrev 9 | ||
| 20 | git fetch --unshallow || true | ||
| 21 | git fetch --tags | ||
| 21 | 22 | ||
| 22 | wget https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.2/wasmtime-v2.0.2-x86_64-linux.tar.xz | 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" |
| 23 | tar x --strip-components=1 -f wasmtime-v2.0.2-x86_64-linux.tar.xz | 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" |
| 24 | rm -f LICENSE README.md | ||
| 25 | mv wasmtime bin/ | ||
| 26 | 25 | ||
| 27 | export PATH=$DEPS_LOCAL/bin:$PATH | 26 | rm -rf build-debug |
| 27 | mkdir build-debug | ||
| 28 | cd build-debug | ||
| 29 | cmake .. \ | ||
| 30 | -DCMAKE_INSTALL_PREFIX="stage3-debug" \ | ||
| 31 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | ||
| 32 | -DCMAKE_BUILD_TYPE=Debug \ | ||
| 33 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 34 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 35 | -DZIG_STATIC=ON \ | ||
| 36 | -GNinja | ||
| 28 | 37 | ||
| 29 | cd "$ZIGDIR" | 38 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables |
| 30 | echo "building stage3-debug with zig version $($OLD_ZIG version)" | 39 | # so that installation and testing do not get affected by them. |
| 40 | unset CC | ||
| 41 | unset CXX | ||
| 31 | 42 | ||
| 32 | "$OLD_ZIG" build \ | 43 | ninja install |
| 33 | --prefix stage3 \ | ||
| 34 | --search-prefix "$DEPS_LOCAL" \ | ||
| 35 | --zig-lib-dir lib \ | ||
| 36 | -Denable-stage1 \ | ||
| 37 | -Dstatic-llvm \ | ||
| 38 | -Drelease \ | ||
| 39 | -Duse-zig-libcxx \ | ||
| 40 | -Dtarget="$TARGET" | ||
| 41 | 44 | ||
| 42 | echo "Looking for non-conforming code formatting..." | 45 | echo "Looking for non-conforming code formatting..." |
| 43 | stage3/bin/zig fmt --check . \ | 46 | stage3-debug/bin/zig fmt --check .. \ |
| 44 | --exclude test/cases/ \ | 47 | --exclude ../test/cases/ \ |
| 45 | --exclude build | 48 | --exclude ../build-debug \ |
| 49 | --exclude ../build-release | ||
| 46 | 50 | ||
| 47 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | 51 | # simultaneously test building self-hosted without LLVM and with 32-bit arm |
| 48 | stage3/bin/zig build -Dtarget=arm-linux-musleabihf | 52 | stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf |
| 49 | 53 | ||
| 50 | stage3/bin/zig build test docs \ | 54 | stage3-debug/bin/zig build test docs \ |
| 51 | -fqemu \ | 55 | -fqemu \ |
| 52 | -fwasmtime \ | 56 | -fwasmtime \ |
| 53 | -Dstatic-llvm \ | 57 | -Dstatic-llvm \ |
| 54 | -Dtarget=native-native-musl \ | 58 | -Dtarget=native-native-musl \ |
| 55 | --search-prefix "$DEPS_LOCAL" \ | 59 | --search-prefix "$PREFIX" \ |
| 56 | --zig-lib-dir lib | 60 | --zig-lib-dir "$(pwd)/../lib" |
| 61 | |||
| 62 | # Look for HTML errors. | ||
| 63 | tidy --drop-empty-elements no -qe zig-cache/langref.html | ||
| 64 | |||
| 65 | # Produce the experimental std lib documentation. | ||
| 66 | mkdir -p "stage3-debug/doc/std" | ||
| 67 | stage3-debug/bin/zig test ../lib/std/std.zig \ | ||
| 68 | -femit-docs=stage3-debug/doc/std \ | ||
| 69 | -fno-emit-bin \ | ||
| 70 | --zig-lib-dir "$(pwd)/../lib" |
ci/linux/build-x86_64-release.sh+47-36| ... | @@ -1,75 +1,86 @@ | ... | @@ -1,75 +1,86 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # Requires cmake ninja-build | ||
| 4 | |||
| 3 | set -x | 5 | set -x |
| 4 | set -e | 6 | set -e |
| 5 | 7 | ||
| 6 | ZIGDIR="$(pwd)" | ||
| 7 | ARCH="$(uname -m)" | 8 | ARCH="$(uname -m)" |
| 8 | DEPS_LOCAL="$HOME/local" | 9 | TARGET="$ARCH-linux-musl" |
| 9 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | ||
| 10 | TARGET="${ARCH}-linux-musl" | ||
| 11 | MCPU="baseline" | 10 | MCPU="baseline" |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1" | ||
| 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" | ||
| 13 | ZIG="$PREFIX/bin/zig" | ||
| 12 | 14 | ||
| 13 | mkdir -p "$DEPS_LOCAL" | 15 | export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH" |
| 14 | cd "$DEPS_LOCAL" | ||
| 15 | |||
| 16 | OLD_ZIG_VERSION="0.11.0-dev.256+271cc52a1" | ||
| 17 | wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz | ||
| 18 | tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz | ||
| 19 | |||
| 20 | wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz | ||
| 21 | tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz | ||
| 22 | |||
| 23 | wget https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.2/wasmtime-v2.0.2-x86_64-linux.tar.xz | ||
| 24 | tar x --strip-components=1 -f wasmtime-v2.0.2-x86_64-linux.tar.xz | ||
| 25 | rm -f LICENSE README.md | ||
| 26 | mv wasmtime bin/ | ||
| 27 | |||
| 28 | export PATH=$DEPS_LOCAL/bin:$PATH | ||
| 29 | 16 | ||
| 30 | cd "$ZIGDIR" | 17 | # Make the `zig version` number consistent. |
| 31 | echo "building stage3-release with zig version $($OLD_ZIG version)" | 18 | # This will affect the cmake command below. |
| 19 | git config core.abbrev 9 | ||
| 20 | git fetch --unshallow || true | ||
| 21 | git fetch --tags | ||
| 32 | 22 | ||
| 33 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" |
| 34 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" |
| 35 | 25 | ||
| 36 | mkdir build | 26 | rm -rf build-release |
| 37 | cd build | 27 | mkdir build-release |
| 28 | cd build-release | ||
| 38 | cmake .. \ | 29 | cmake .. \ |
| 39 | -DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \ | 30 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ |
| 40 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | 31 | -DCMAKE_PREFIX_PATH="$PREFIX" \ |
| 41 | -DCMAKE_BUILD_TYPE=Release \ | 32 | -DCMAKE_BUILD_TYPE=Release \ |
| 42 | -DZIG_TARGET_TRIPLE="$TARGET" \ | 33 | -DZIG_TARGET_TRIPLE="$TARGET" \ |
| 43 | -DZIG_TARGET_MCPU="$MCPU" \ | 34 | -DZIG_TARGET_MCPU="$MCPU" \ |
| 44 | -DZIG_STATIC=ON | 35 | -DZIG_STATIC=ON \ |
| 36 | -GNinja | ||
| 45 | 37 | ||
| 46 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | 38 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables |
| 47 | # so that installation and testing do not get affected by them. | 39 | # so that installation and testing do not get affected by them. |
| 48 | unset CC | 40 | unset CC |
| 49 | unset CXX | 41 | unset CXX |
| 50 | 42 | ||
| 51 | make -j2 install | 43 | ninja install |
| 52 | 44 | ||
| 53 | "stage3/bin/zig" build test \ | 45 | echo "Looking for non-conforming code formatting..." |
| 46 | stage3-release/bin/zig fmt --check .. \ | ||
| 47 | --exclude ../test/cases/ \ | ||
| 48 | --exclude ../build-debug \ | ||
| 49 | --exclude ../build-release | ||
| 50 | |||
| 51 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | ||
| 52 | stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf | ||
| 53 | |||
| 54 | stage3-release/bin/zig build test docs \ | ||
| 54 | -fqemu \ | 55 | -fqemu \ |
| 55 | -fwasmtime \ | 56 | -fwasmtime \ |
| 56 | -Dstatic-llvm \ | 57 | -Dstatic-llvm \ |
| 57 | -Dtarget=native-native-musl \ | 58 | -Dtarget=native-native-musl \ |
| 58 | --search-prefix "$DEPS_LOCAL" \ | 59 | --search-prefix "$PREFIX" \ |
| 60 | --zig-lib-dir "$(pwd)/../lib" | ||
| 61 | |||
| 62 | # Look for HTML errors. | ||
| 63 | tidy --drop-empty-elements no -qe zig-cache/langref.html | ||
| 64 | |||
| 65 | # Produce the experimental std lib documentation. | ||
| 66 | mkdir -p "stage3-release/doc/std" | ||
| 67 | stage3-release/bin/zig test ../lib/std/std.zig \ | ||
| 68 | -femit-docs=stage3-release/doc/std \ | ||
| 69 | -fno-emit-bin \ | ||
| 59 | --zig-lib-dir "$(pwd)/../lib" | 70 | --zig-lib-dir "$(pwd)/../lib" |
| 60 | 71 | ||
| 61 | "stage3/bin/zig" build \ | 72 | "stage3/bin/zig" build \ |
| 62 | --prefix stage4 \ | 73 | --prefix stage4-release \ |
| 63 | -Denable-llvm \ | 74 | -Denable-llvm \ |
| 64 | -Denable-stage1 \ | 75 | -Denable-stage1 \ |
| 65 | -Dno-lib \ | 76 | -Dno-lib \ |
| 66 | -Drelease \ | 77 | -Drelease \ |
| 67 | -Dstrip \ | 78 | -Dstrip \ |
| 68 | -Dtarget=x86_64-linux-musl \ | 79 | -Dtarget=$TARGET \ |
| 69 | -Duse-zig-libcxx \ | 80 | -Duse-zig-libcxx \ |
| 70 | -Dversion-string="$(stage3/bin/zig version)" | 81 | -Dversion-string="$(stage3-release/bin/zig version)" |
| 71 | 82 | ||
| 72 | # diff returns an error code if the files differ. | 83 | # diff returns an error code if the files differ. |
| 73 | echo "If the following command fails, it means nondeterminism has been" | 84 | echo "If the following command fails, it means nondeterminism has been" |
| 74 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | 85 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." |
| 75 | diff stage3/bin/zig stage4/bin/zig | 86 | diff stage3-release/bin/zig stage4-release/bin/zig |