| author | |
| committer | |
| log | 8583e88db522f0f94f2110f1d255406e5e7e99fd |
| tree | 8c04379ff1e0ebedc5b41551b1b9349a3b913f02 |
| parent | da96e7efccba51ad3749636d32f82b4193a590b8 |
8 files changed, 73 insertions(+), 100 deletions(-)
.github/workflows/ci.yaml+2-12| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | 1 | name: ci |
| 2 | 2 | on: |
| 3 | pull_request: | |
| 4 | 3 | push: |
| 5 | 4 | branches: |
| 6 | - master | |
| 5 | - 0.10.x | |
| 7 | 6 | concurrency: |
| 8 | 7 | # Cancels pending runs when a PR gets updated. |
| 9 | 8 | group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} |
| ... | ... | @@ -39,22 +38,13 @@ jobs: |
| 39 | 38 | run: sh ci/aarch64-linux-release.sh |
| 40 | 39 | x86_64-macos: |
| 41 | 40 | runs-on: "macos-11" |
| 42 | env: | |
| 41 | env: | |
| 43 | 42 | ARCH: "x86_64" |
| 44 | 43 | steps: |
| 45 | 44 | - name: Checkout |
| 46 | 45 | uses: actions/checkout@v3 |
| 47 | 46 | - name: Build and Test |
| 48 | 47 | run: ci/x86_64-macos.sh |
| 49 | aarch64-macos: | |
| 50 | runs-on: [self-hosted, macOS, aarch64] | |
| 51 | env: | |
| 52 | ARCH: "aarch64" | |
| 53 | steps: | |
| 54 | - name: Checkout | |
| 55 | uses: actions/checkout@v3 | |
| 56 | - name: Build and Test | |
| 57 | run: ci/aarch64-macos.sh | |
| 58 | 48 | x86_64-windows: |
| 59 | 49 | runs-on: windows-latest |
| 60 | 50 | env: |
ci/aarch64-linux-debug.sh+2-4| ... | ... | @@ -8,7 +8,7 @@ set -e |
| 8 | 8 | ARCH="$(uname -m)" |
| 9 | 9 | TARGET="$ARCH-linux-musl" |
| 10 | 10 | MCPU="baseline" |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68" | |
| 12 | 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" |
| 13 | 13 | ZIG="$PREFIX/bin/zig" |
| 14 | 14 | |
| ... | ... | @@ -57,8 +57,6 @@ stage3-debug/bin/zig fmt --check .. \ |
| 57 | 57 | # simultaneously test building self-hosted without LLVM and with 32-bit arm |
| 58 | 58 | stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf |
| 59 | 59 | |
| 60 | # TODO: add -fqemu back to this line | |
| 61 | ||
| 62 | 60 | stage3-debug/bin/zig build test docs \ |
| 63 | 61 | -fwasmtime \ |
| 64 | 62 | -Dstatic-llvm \ |
| ... | ... | @@ -67,7 +65,7 @@ stage3-debug/bin/zig build test docs \ |
| 67 | 65 | --zig-lib-dir "$(pwd)/../lib" |
| 68 | 66 | |
| 69 | 67 | # Look for HTML errors. |
| 70 | tidy --drop-empty-elements no -qe ../zig-cache/langref.html | |
| 68 | tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html" | |
| 71 | 69 | |
| 72 | 70 | # Produce the experimental std lib documentation. |
| 73 | 71 | stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |
ci/aarch64-linux-release.sh+4-9| ... | ... | @@ -8,9 +8,9 @@ set -e |
| 8 | 8 | ARCH="$(uname -m)" |
| 9 | 9 | TARGET="$ARCH-linux-musl" |
| 10 | 10 | MCPU="baseline" |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68" | |
| 12 | 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 14 | 14 | |
| 15 | 15 | export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$PATH" |
| 16 | 16 | |
| ... | ... | @@ -57,8 +57,6 @@ stage3-release/bin/zig fmt --check .. \ |
| 57 | 57 | # simultaneously test building self-hosted without LLVM and with 32-bit arm |
| 58 | 58 | stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf |
| 59 | 59 | |
| 60 | # TODO: add -fqemu back to this line | |
| 61 | ||
| 62 | 60 | stage3-release/bin/zig build test docs \ |
| 63 | 61 | -fwasmtime \ |
| 64 | 62 | -Dstatic-llvm \ |
| ... | ... | @@ -67,10 +65,7 @@ stage3-release/bin/zig build test docs \ |
| 67 | 65 | --zig-lib-dir "$(pwd)/../lib" |
| 68 | 66 | |
| 69 | 67 | # Look for HTML errors. |
| 70 | tidy --drop-empty-elements no -qe ../zig-cache/langref.html | |
| 68 | tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html" | |
| 71 | 69 | |
| 72 | 70 | # Produce the experimental std lib documentation. |
| 73 | stage3-release/bin/zig test ../lib/std/std.zig \ | |
| 74 | -femit-docs \ | |
| 75 | -fno-emit-bin \ | |
| 76 | --zig-lib-dir "$(pwd)/../lib" | |
| 71 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |
ci/aarch64-macos.sh+19-7| ... | ... | @@ -4,12 +4,12 @@ set -x |
| 4 | 4 | set -e |
| 5 | 5 | |
| 6 | 6 | # Script assumes the presence of the following: |
| 7 | # s3cmd | |
| 7 | # s3cmd | |
| 8 | 8 | |
| 9 | 9 | ZIGDIR="$(pwd)" |
| 10 | 10 | TARGET="$ARCH-macos-none" |
| 11 | 11 | MCPU="baseline" |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.534+b0b1cc356-1" | |
| 13 | 13 | PREFIX="$HOME/$CACHE_BASENAME" |
| 14 | 14 | ZIG="$PREFIX/bin/zig" |
| 15 | 15 | |
| ... | ... | @@ -51,8 +51,20 @@ stage3-release/bin/zig build test docs \ |
| 51 | 51 | --search-prefix "$PREFIX" |
| 52 | 52 | |
| 53 | 53 | # Produce the experimental std lib documentation. |
| 54 | mkdir -p "stage3-release/doc/std" | |
| 55 | stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 56 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 57 | -femit-docs="$(pwd)/stage3-release/doc/std" \ | |
| 58 | -fno-emit-bin | |
| 54 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib | |
| 55 | ||
| 56 | # Ensure that stage3 and stage4 are byte-for-byte identical. | |
| 57 | stage3-release/bin/zig build \ | |
| 58 | --prefix stage4-release \ | |
| 59 | -Denable-llvm \ | |
| 60 | -Dno-lib \ | |
| 61 | -Drelease \ | |
| 62 | -Dstrip \ | |
| 63 | -Dtarget=$TARGET \ | |
| 64 | -Duse-zig-libcxx \ | |
| 65 | -Dversion-string="$(stage3-release/bin/zig version)" | |
| 66 | ||
| 67 | # diff returns an error code if the files differ. | |
| 68 | echo "If the following command fails, it means nondeterminism has been" | |
| 69 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 70 | diff stage3-release/bin/zig stage4-release/bin/zig |
ci/x86_64-linux-debug.sh+3-6| ... | ... | @@ -8,7 +8,7 @@ set -e |
| 8 | 8 | ARCH="$(uname -m)" |
| 9 | 9 | TARGET="$ARCH-linux-musl" |
| 10 | 10 | MCPU="baseline" |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68" | |
| 12 | 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" |
| 13 | 13 | ZIG="$PREFIX/bin/zig" |
| 14 | 14 | |
| ... | ... | @@ -66,10 +66,7 @@ stage3-debug/bin/zig build test docs \ |
| 66 | 66 | --zig-lib-dir "$(pwd)/../lib" |
| 67 | 67 | |
| 68 | 68 | # Look for HTML errors. |
| 69 | tidy --drop-empty-elements no -qe ../zig-cache/langref.html | |
| 69 | tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html" | |
| 70 | 70 | |
| 71 | 71 | # Produce the experimental std lib documentation. |
| 72 | stage3-debug/bin/zig test ../lib/std/std.zig \ | |
| 73 | -femit-docs \ | |
| 74 | -fno-emit-bin \ | |
| 75 | --zig-lib-dir "$(pwd)/../lib" | |
| 72 | stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |
ci/x86_64-linux-release.sh+4-23| ... | ... | @@ -8,9 +8,9 @@ set -e |
| 8 | 8 | ARCH="$(uname -m)" |
| 9 | 9 | TARGET="$ARCH-linux-musl" |
| 10 | 10 | MCPU="baseline" |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.971+19056cb68" | |
| 12 | 12 | PREFIX="$HOME/deps/$CACHE_BASENAME" |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 13 | ZIG="$PREFIX/bin/zig" | |
| 14 | 14 | |
| 15 | 15 | export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-6.1.0.1/bin:$PATH" |
| 16 | 16 | |
| ... | ... | @@ -67,26 +67,7 @@ stage3-release/bin/zig build test docs \ |
| 67 | 67 | --zig-lib-dir "$(pwd)/../lib" |
| 68 | 68 | |
| 69 | 69 | # Look for HTML errors. |
| 70 | tidy --drop-empty-elements no -qe ../zig-cache/langref.html | |
| 70 | tidy --drop-empty-elements no -qe "$ZIG_LOCAL_CACHE_DIR/langref.html" | |
| 71 | 71 | |
| 72 | 72 | # Produce the experimental std lib documentation. |
| 73 | stage3-release/bin/zig test ../lib/std/std.zig \ | |
| 74 | -femit-docs \ | |
| 75 | -fno-emit-bin \ | |
| 76 | --zig-lib-dir "$(pwd)/../lib" | |
| 77 | ||
| 78 | stage3-release/bin/zig build \ | |
| 79 | --prefix stage4-release \ | |
| 80 | -Denable-llvm \ | |
| 81 | -Denable-stage1 \ | |
| 82 | -Dno-lib \ | |
| 83 | -Drelease \ | |
| 84 | -Dstrip \ | |
| 85 | -Dtarget=$TARGET \ | |
| 86 | -Duse-zig-libcxx \ | |
| 87 | -Dversion-string="$(stage3-release/bin/zig version)" | |
| 88 | ||
| 89 | # diff returns an error code if the files differ. | |
| 90 | echo "If the following command fails, it means nondeterminism has been" | |
| 91 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 92 | diff stage3-release/bin/zig stage4-release/bin/zig | |
| 73 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |
ci/x86_64-macos.sh+3-7| ... | ... | @@ -4,12 +4,12 @@ set -x |
| 4 | 4 | set -e |
| 5 | 5 | |
| 6 | 6 | # Script assumes the presence of the following: |
| 7 | # s3cmd | |
| 7 | # s3cmd | |
| 8 | 8 | |
| 9 | 9 | ZIGDIR="$(pwd)" |
| 10 | 10 | TARGET="$ARCH-macos-none" |
| 11 | 11 | MCPU="baseline" |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.534+b0b1cc356" | |
| 13 | 13 | PREFIX="$HOME/$CACHE_BASENAME" |
| 14 | 14 | JOBS="-j3" |
| 15 | 15 | |
| ... | ... | @@ -59,8 +59,4 @@ stage3-release/bin/zig build test docs \ |
| 59 | 59 | --search-prefix "$PREFIX" |
| 60 | 60 | |
| 61 | 61 | # Produce the experimental std lib documentation. |
| 62 | mkdir -p "stage3-release/doc/std" | |
| 63 | stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 64 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 65 | -femit-docs="$(pwd)/stage3-release/doc/std" \ | |
| 66 | -fno-emit-bin | |
| 62 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |
ci/x86_64-windows.ps1+36-32| ... | ... | @@ -1,20 +1,18 @@ |
| 1 | 1 | $TARGET = "$($Env:ARCH)-windows-gnu" |
| 2 | 2 | $ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e" |
| 3 | $MCPU = "baseline" | |
| 3 | 4 | $ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip" |
| 5 | $PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME" | |
| 6 | $ZIG = "$PREFIX_PATH\bin\zig.exe" | |
| 7 | $ZIG_LIB_DIR = "$(Get-Location)\lib" | |
| 4 | 8 | |
| 5 | 9 | Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL" |
| 6 | ||
| 7 | 10 | Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip" |
| 8 | 11 | |
| 9 | 12 | Write-Output "Extracting..." |
| 10 | ||
| 11 | Add-Type -AssemblyName System.IO.Compression.FileSystem ; | |
| 13 | Add-Type -AssemblyName System.IO.Compression.FileSystem ; | |
| 12 | 14 | [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD") |
| 13 | 15 | |
| 14 | Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib" | |
| 15 | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release" | |
| 16 | Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME" | |
| 17 | ||
| 18 | 16 | function CheckLastExitCode { |
| 19 | 17 | if (!$?) { |
| 20 | 18 | exit 1 |
| ... | ... | @@ -31,35 +29,41 @@ if ((git rev-parse --is-shallow-repository) -eq "true") { |
| 31 | 29 | git fetch --unshallow # `git describe` won't work on a shallow repo |
| 32 | 30 | } |
| 33 | 31 | |
| 34 | Write-Output "Building Zig..." | |
| 32 | Write-Output "Building from source..." | |
| 33 | Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore | |
| 34 | New-Item -Path 'build-release' -ItemType Directory | |
| 35 | Set-Location -Path 'build-release' | |
| 35 | 36 | |
| 36 | & "$ZIGPREFIXPATH\bin\zig.exe" build ` | |
| 37 | --prefix "$ZIGINSTALLDIR" ` | |
| 38 | --search-prefix "$ZIGPREFIXPATH" ` | |
| 39 | --zig-lib-dir "$ZIGLIBDIR" ` | |
| 40 | -Denable-stage1 ` | |
| 41 | -Dstatic-llvm ` | |
| 42 | -Drelease ` | |
| 43 | -Duse-zig-libcxx ` | |
| 44 | -Dtarget="$TARGET" | |
| 37 | # CMake gives a syntax error when file paths with backward slashes are used. | |
| 38 | # Here, we use forward slashes only to work around this. | |
| 39 | & cmake .. ` | |
| 40 | -GNinja ` | |
| 41 | -DCMAKE_INSTALL_PREFIX="stage3-release" ` | |
| 42 | -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" ` | |
| 43 | -DCMAKE_BUILD_TYPE=Release ` | |
| 44 | -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` | |
| 45 | -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` | |
| 46 | -DZIG_TARGET_TRIPLE="$TARGET" ` | |
| 47 | -DZIG_TARGET_MCPU="$MCPU" ` | |
| 48 | -DZIG_STATIC=ON | |
| 45 | 49 | CheckLastExitCode |
| 46 | 50 | |
| 47 | Write-Output " zig build test docs..." | |
| 48 | ||
| 49 | & "$ZIGINSTALLDIR\bin\zig.exe" build test docs ` | |
| 50 | --search-prefix "$ZIGPREFIXPATH" ` | |
| 51 | -Dstatic-llvm ` | |
| 52 | -Dskip-non-native ` | |
| 53 | -Denable-symlinks-windows | |
| 51 | ninja install | |
| 54 | 52 | CheckLastExitCode |
| 55 | 53 | |
| 56 | # Produce the experimental std lib documentation. | |
| 57 | mkdir "$ZIGINSTALLDIR\doc\std" -force | |
| 58 | ||
| 59 | Write-Output "zig test std/std.zig..." | |
| 54 | Write-Output "Main test suite..." | |
| 55 | & "stage3-release\bin\zig.exe" build test docs ` | |
| 56 | --zig-lib-dir "$ZIG_LIB_DIR" ` | |
| 57 | --search-prefix "$PREFIX_PATH" ` | |
| 58 | -Dstatic-llvm ` | |
| 59 | -Dskip-non-native ` | |
| 60 | -Denable-symlinks-windows | |
| 61 | CheckLastExitCode | |
| 60 | 62 | |
| 61 | & "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" ` | |
| 62 | --zig-lib-dir "$ZIGLIBDIR" ` | |
| 63 | -femit-docs="$ZIGINSTALLDIR\doc\std" ` | |
| 64 | -fno-emit-bin | |
| 63 | Write-Output "Testing Autodocs..." | |
| 64 | & "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" ` | |
| 65 | --zig-lib-dir "$ZIG_LIB_DIR" ` | |
| 66 | -femit-docs ` | |
| 67 | -fno-emit-bin | |
| 65 | 68 | CheckLastExitCode |
| 69 |