| author | |
| committer | |
| log | 06c42a0c68b5e3ce54135738704cc7c6c5b92565 |
| tree | 70d814109caa3efeea96b089915a90d9db62c6f5 |
| parent | 507aae4a1a3db498ece2a3a89d74e9e24d952923 |
4 files changed, 170 insertions(+), 94 deletions(-)
ci/zinc/drone.yml+9-3| ... | @@ -9,14 +9,20 @@ workspace: | ... | @@ -9,14 +9,20 @@ workspace: |
| 9 | path: /workspace | 9 | path: /workspace |
| 10 | 10 | ||
| 11 | steps: | 11 | steps: |
| 12 | - name: test | 12 | - name: test_stage3_debug |
| 13 | image: ci/debian-amd64:11.1-6 | 13 | image: ci/debian-amd64:11.1-6 |
| 14 | commands: | 14 | commands: |
| 15 | - ./ci/zinc/linux_test.sh | 15 | - ./ci/zinc/linux_test_stage3_debug.sh |
| 16 | |||
| 17 | - name: test_stage3_release | ||
| 18 | image: ci/debian-amd64:11.1-6 | ||
| 19 | commands: | ||
| 20 | - ./ci/zinc/linux_test_stage3_release.sh | ||
| 16 | 21 | ||
| 17 | - name: package | 22 | - name: package |
| 18 | depends_on: | 23 | depends_on: |
| 19 | - test | 24 | - test_stage3_debug |
| 25 | - test_stage3_release | ||
| 20 | when: | 26 | when: |
| 21 | branch: | 27 | branch: |
| 22 | - master | 28 | - master |
ci/zinc/linux_test.sh deleted-91| ... | @@ -1,91 +0,0 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | . ./ci/zinc/linux_base.sh | ||
| 4 | |||
| 5 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | ||
| 6 | TARGET="${ARCH}-linux-musl" | ||
| 7 | MCPU="baseline" | ||
| 8 | |||
| 9 | # Make the `zig version` number consistent. | ||
| 10 | # This will affect the cmake command below. | ||
| 11 | git config core.abbrev 9 | ||
| 12 | |||
| 13 | echo "building debug zig with zig version $($OLD_ZIG version)" | ||
| 14 | |||
| 15 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 16 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 17 | |||
| 18 | mkdir _debug | ||
| 19 | cd _debug | ||
| 20 | cmake .. \ | ||
| 21 | -DCMAKE_INSTALL_PREFIX="$DEBUG_STAGING" \ | ||
| 22 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | ||
| 23 | -DCMAKE_BUILD_TYPE=Debug \ | ||
| 24 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 25 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 26 | -DZIG_STATIC=ON \ | ||
| 27 | -GNinja | ||
| 28 | |||
| 29 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | ||
| 30 | # so that installation and testing do not get affected by them. | ||
| 31 | unset CC | ||
| 32 | unset CXX | ||
| 33 | |||
| 34 | ninja install | ||
| 35 | |||
| 36 | # Here we rebuild zig but this time using the Zig binary we just now produced to | ||
| 37 | # build zig1.o rather than relying on the one built with stage0. See | ||
| 38 | # https://github.com/ziglang/zig/issues/6830 for more details. | ||
| 39 | cmake .. -DZIG_EXECUTABLE="$DEBUG_STAGING/bin/zig" | ||
| 40 | ninja install | ||
| 41 | |||
| 42 | cd $WORKSPACE | ||
| 43 | |||
| 44 | "$DEBUG_STAGING/bin/zig" build -p stage3 -Denable-stage1 -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 45 | |||
| 46 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | ||
| 47 | stage3/bin/zig build -Dtarget=arm-linux-musleabihf | ||
| 48 | |||
| 49 | echo "Looking for non-conforming code formatting..." | ||
| 50 | echo "Formatting errors can be fixed by running 'zig fmt' on the files printed here." | ||
| 51 | stage3/bin/zig fmt --check . --exclude test/cases/ | ||
| 52 | |||
| 53 | stage3/bin/zig build test-compiler-rt -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 54 | stage3/bin/zig build test-behavior -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 55 | stage3/bin/zig build test-std -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 56 | stage3/bin/zig build test-universal-libc -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 57 | stage3/bin/zig build test-compare-output -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 58 | stage3/bin/zig build test-asm-link -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 59 | stage3/bin/zig build test-fmt -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 60 | stage3/bin/zig build test-translate-c -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 61 | stage3/bin/zig build test-run-translated-c -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 62 | stage3/bin/zig build test-standalone -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 63 | stage3/bin/zig build test-cli -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 64 | stage3/bin/zig build test-cases -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 65 | stage3/bin/zig build test-link -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 66 | stage3/bin/zig build docs -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 67 | |||
| 68 | stage3/bin/zig build test-stack-traces -fqemu -fwasmtime -fstage1 | ||
| 69 | |||
| 70 | # Produce the experimental std lib documentation. | ||
| 71 | mkdir -p "$RELEASE_STAGING/docs/std" | ||
| 72 | stage3/bin/zig test lib/std/std.zig \ | ||
| 73 | --zig-lib-dir lib \ | ||
| 74 | -femit-docs=$RELEASE_STAGING/docs/std \ | ||
| 75 | -fno-emit-bin | ||
| 76 | |||
| 77 | # Look for HTML errors. | ||
| 78 | tidy --drop-empty-elements no -qe zig-cache/langref.html | ||
| 79 | |||
| 80 | # Build release zig. | ||
| 81 | stage3/bin/zig build \ | ||
| 82 | --prefix "$RELEASE_STAGING" \ | ||
| 83 | --search-prefix "$DEPS_LOCAL" \ | ||
| 84 | -Dstatic-llvm \ | ||
| 85 | -Drelease \ | ||
| 86 | -Dstrip \ | ||
| 87 | -Dtarget="$TARGET" \ | ||
| 88 | -Denable-stage1 | ||
| 89 | |||
| 90 | # Explicit exit helps show last command duration. | ||
| 91 | exit | ||
ci/zinc/linux_test_stage3_debug.sh created+70| ... | @@ -0,0 +1,70 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | . ./ci/zinc/linux_base.sh | ||
| 4 | |||
| 5 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | ||
| 6 | TARGET="${ARCH}-linux-musl" | ||
| 7 | MCPU="baseline" | ||
| 8 | |||
| 9 | # Make the `zig version` number consistent. | ||
| 10 | # This will affect the cmake command below. | ||
| 11 | git config core.abbrev 9 | ||
| 12 | |||
| 13 | echo "building stage3-debug with zig version $($OLD_ZIG version)" | ||
| 14 | |||
| 15 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 16 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 17 | |||
| 18 | mkdir build-debug | ||
| 19 | cd build-debug | ||
| 20 | cmake .. \ | ||
| 21 | -DCMAKE_INSTALL_PREFIX="$DEBUG_STAGING" \ | ||
| 22 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | ||
| 23 | -DCMAKE_BUILD_TYPE=Debug \ | ||
| 24 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 25 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 26 | -DZIG_STATIC=ON \ | ||
| 27 | -GNinja | ||
| 28 | |||
| 29 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | ||
| 30 | # so that installation and testing do not get affected by them. | ||
| 31 | unset CC | ||
| 32 | unset CXX | ||
| 33 | |||
| 34 | ninja install | ||
| 35 | |||
| 36 | # Here we rebuild zig but this time using the Zig binary we just now produced to | ||
| 37 | # build zig1.o rather than relying on the one built with stage0. See | ||
| 38 | # https://github.com/ziglang/zig/issues/6830 for more details. | ||
| 39 | cmake .. -DZIG_EXECUTABLE="$DEBUG_STAGING/bin/zig" | ||
| 40 | ninja install | ||
| 41 | |||
| 42 | cd $WORKSPACE | ||
| 43 | |||
| 44 | "$DEBUG_STAGING/bin/zig" build -p stage3 -Denable-stage1 -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 45 | |||
| 46 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | ||
| 47 | stage3/bin/zig build -Dtarget=arm-linux-musleabihf | ||
| 48 | |||
| 49 | echo "Looking for non-conforming code formatting..." | ||
| 50 | echo "Formatting errors can be fixed by running 'zig fmt' on the files printed here." | ||
| 51 | stage3/bin/zig fmt --check . --exclude test/cases/ | ||
| 52 | |||
| 53 | stage3/bin/zig build test-compiler-rt -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 54 | stage3/bin/zig build test-behavior -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 55 | stage3/bin/zig build test-std -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 56 | stage3/bin/zig build test-universal-libc -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 57 | stage3/bin/zig build test-compare-output -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 58 | stage3/bin/zig build test-asm-link -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 59 | stage3/bin/zig build test-fmt -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 60 | stage3/bin/zig build test-translate-c -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 61 | stage3/bin/zig build test-run-translated-c -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 62 | stage3/bin/zig build test-standalone -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 63 | stage3/bin/zig build test-cli -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 64 | stage3/bin/zig build test-cases -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 65 | stage3/bin/zig build test-link -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 66 | stage3/bin/zig build test-stack-traces -fqemu -fwasmtime -fstage1 | ||
| 67 | stage3/bin/zig build docs -fqemu -fwasmtime -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL" | ||
| 68 | |||
| 69 | # Explicit exit helps show last command duration. | ||
| 70 | exit | ||
ci/zinc/linux_test_stage3_release.sh created+91| ... | @@ -0,0 +1,91 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | . ./ci/zinc/linux_base.sh | ||
| 4 | |||
| 5 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | ||
| 6 | TARGET="${ARCH}-linux-musl" | ||
| 7 | MCPU="baseline" | ||
| 8 | |||
| 9 | # Make the `zig version` number consistent. | ||
| 10 | # This will affect the cmake command below. | ||
| 11 | git config core.abbrev 9 | ||
| 12 | |||
| 13 | echo "building stage3-release with zig version $($OLD_ZIG version)" | ||
| 14 | |||
| 15 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 16 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 17 | |||
| 18 | mkdir build-release | ||
| 19 | cd build-release | ||
| 20 | STAGE2_PREFIX="$(pwd)/stage2" | ||
| 21 | cmake .. \ | ||
| 22 | -DCMAKE_INSTALL_PREFIX="$STAGE2_PREFIX" \ | ||
| 23 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | ||
| 24 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 25 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 26 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 27 | -DZIG_STATIC=ON \ | ||
| 28 | -GNinja | ||
| 29 | |||
| 30 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | ||
| 31 | # so that installation and testing do not get affected by them. | ||
| 32 | unset CC | ||
| 33 | unset CXX | ||
| 34 | |||
| 35 | ninja install | ||
| 36 | |||
| 37 | # Here we rebuild zig but this time using the Zig binary we just now produced to | ||
| 38 | # build zig1.o rather than relying on the one built with stage0. See | ||
| 39 | # https://github.com/ziglang/zig/issues/6830 for more details. | ||
| 40 | cmake .. -DZIG_EXECUTABLE="$STAGE2_PREFIX/bin/zig" | ||
| 41 | ninja install | ||
| 42 | |||
| 43 | # This is the binary we will distribute. We intentionally test this one in this | ||
| 44 | # script. If any test failures occur, hopefully they also occur in the debug | ||
| 45 | # version of this script for easier troubleshooting. This prevents distribution | ||
| 46 | # of a Zig binary that passes tests in debug mode but has a miscompilation in | ||
| 47 | # release mode. | ||
| 48 | "$STAGE2_PREFIX/bin/zig" build \ | ||
| 49 | --prefix "$RELEASE_STAGING" \ | ||
| 50 | --search-prefix "$DEPS_LOCAL" \ | ||
| 51 | -Dstatic-llvm \ | ||
| 52 | -Drelease \ | ||
| 53 | -Dstrip \ | ||
| 54 | -Dtarget="$TARGET" \ | ||
| 55 | -Denable-stage1 | ||
| 56 | |||
| 57 | cd $WORKSPACE | ||
| 58 | |||
| 59 | ZIG="$RELEASE_STAGING/bin/zig" | ||
| 60 | |||
| 61 | $ZIG build \ | ||
| 62 | test-compiler-rt \ | ||
| 63 | test-behavior \ | ||
| 64 | test-std \ | ||
| 65 | test-universal-libc \ | ||
| 66 | test-compare-output \ | ||
| 67 | test-asm-link \ | ||
| 68 | test-translate-c \ | ||
| 69 | test-run-translated-c \ | ||
| 70 | test-standalone \ | ||
| 71 | test-cli \ | ||
| 72 | test-cases \ | ||
| 73 | test-link \ | ||
| 74 | -fqemu \ | ||
| 75 | -fwasmtime \ | ||
| 76 | -Dstatic-llvm \ | ||
| 77 | -Dtarget=native-native-musl \ | ||
| 78 | --search-prefix "$DEPS_LOCAL" | ||
| 79 | |||
| 80 | # Produce the experimental std lib documentation. | ||
| 81 | mkdir -p "$RELEASE_STAGING/docs/std" | ||
| 82 | $ZIG test lib/std/std.zig \ | ||
| 83 | --zig-lib-dir lib \ | ||
| 84 | -femit-docs=$RELEASE_STAGING/docs/std \ | ||
| 85 | -fno-emit-bin | ||
| 86 | |||
| 87 | # Look for HTML errors. | ||
| 88 | tidy --drop-empty-elements no -qe zig-cache/langref.html | ||
| 89 | |||
| 90 | # Explicit exit helps show last command duration. | ||
| 91 | exit | ||