| author | |
| committer | |
| log | e21b6a712d7e5c7acb19a7d522406a705223d325 |
| tree | c316aa4c36833db50e63445e35ed0e0051c9d613 |
| parent | f3d987dc87cce25c4c0a75b654c4a71b8365fac9 |
22 files changed, 215 insertions(+), 1136 deletions(-)
.builds/freebsd.yml deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | image: freebsd/latest | |
| 2 | secrets: | |
| 3 | - 51bfddf5-86a6-4e01-8576-358c72a4a0a4 | |
| 4 | - be22288f-b1bc-4243-abe3-43d8f0e7079b | |
| 5 | sources: | |
| 6 | - https://github.com/ziglang/zig | |
| 7 | tasks: | |
| 8 | - build: cd zig && ./ci/srht/freebsd_script |
.github/workflows/ci.yaml+16-2| ... | ... | @@ -10,8 +10,22 @@ jobs: |
| 10 | 10 | steps: |
| 11 | 11 | - name: Checkout |
| 12 | 12 | uses: actions/checkout@v3 |
| 13 | - name: Run Build Script | |
| 13 | - name: Build and Test | |
| 14 | 14 | run: sh ./ci/linux/build-aarch64.sh |
| 15 | x86_64-linux-debug: | |
| 16 | runs-on: ubuntu-latest | |
| 17 | steps: | |
| 18 | - name: Checkout | |
| 19 | uses: actions/checkout@v3 | |
| 20 | - name: Build and Test | |
| 21 | run: sh ./ci/linux/build-x86_64-debug.sh | |
| 22 | x86_64-linux-release: | |
| 23 | runs-on: ubuntu-latest | |
| 24 | steps: | |
| 25 | - name: Checkout | |
| 26 | uses: actions/checkout@v3 | |
| 27 | - name: Build and Test | |
| 28 | run: sh ./ci/linux/build-x86_64-release.sh | |
| 15 | 29 | x86_64-macos: |
| 16 | 30 | strategy: |
| 17 | 31 | matrix: |
| ... | ... | @@ -47,7 +61,7 @@ jobs: |
| 47 | 61 | - name: Run Build Script |
| 48 | 62 | run: ./ci/windows/build.ps1 |
| 49 | 63 | build-tarballs: |
| 50 | needs: [aarch64-linux, x86_64-macos, aarch64-macos, x86_64-windows] | |
| 64 | needs: [aarch64-linux, x86_64-macos, aarch64-macos, x86_64-windows, x86_64-linux-debug, x86_64-linux-release] | |
| 51 | 65 | runs-on: [self-hosted, Linux, aarch64] |
| 52 | 66 | steps: |
| 53 | 67 | - name: Checkout |
ci/azure/macos_script deleted-106| ... | ... | @@ -1,106 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | brew update && brew install ncurses s3cmd | |
| 7 | ||
| 8 | ZIGDIR="$(pwd)" | |
| 9 | ARCH="x86_64" | |
| 10 | TARGET="$ARCH-macos-none" | |
| 11 | MCPU="baseline" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0" | |
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 14 | JOBS="-j2" | |
| 15 | ||
| 16 | rm -rf $PREFIX | |
| 17 | cd $HOME | |
| 18 | ||
| 19 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 20 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 21 | ||
| 22 | ZIG="$PREFIX/bin/zig" | |
| 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 25 | ||
| 26 | cd $ZIGDIR | |
| 27 | ||
| 28 | # Make the `zig version` number consistent. | |
| 29 | # This will affect the cmake command below. | |
| 30 | git config core.abbrev 9 | |
| 31 | git fetch --unshallow || true | |
| 32 | git fetch --tags | |
| 33 | ||
| 34 | mkdir build | |
| 35 | cd build | |
| 36 | cmake .. \ | |
| 37 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | |
| 38 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 39 | -DCMAKE_BUILD_TYPE=Release \ | |
| 40 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 41 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 42 | -DZIG_STATIC=ON | |
| 43 | ||
| 44 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 45 | # so that installation and testing do not get affected by them. | |
| 46 | unset CC | |
| 47 | unset CXX | |
| 48 | ||
| 49 | make $JOBS install | |
| 50 | ||
| 51 | stage3-release/bin/zig build test docs \ | |
| 52 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 53 | -Denable-macos-sdk \ | |
| 54 | -Dstatic-llvm \ | |
| 55 | -Dskip-non-native \ | |
| 56 | --search-prefix "$PREFIX" | |
| 57 | ||
| 58 | # Produce the experimental std lib documentation. | |
| 59 | mkdir -p "stage3-release/doc/std" | |
| 60 | stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 61 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 62 | -femit-docs="$(pwd)/stage3-release/doc/std" \ | |
| 63 | -fno-emit-bin | |
| 64 | ||
| 65 | if [ "${BUILD_REASON}" != "PullRequest" ]; then | |
| 66 | # Remove the unnecessary bin dir in stage3-release/bin/zig | |
| 67 | mv stage3-release/bin/zig stage3-release/ | |
| 68 | rmdir stage3-release/bin | |
| 69 | ||
| 70 | # Remove the unnecessary zig dir in stage3-release/lib/zig/std/std.zig | |
| 71 | mv stage3-release/lib/zig stage3-release/lib2 | |
| 72 | rmdir stage3-release/lib | |
| 73 | mv stage3-release/lib2 stage3-release/lib | |
| 74 | ||
| 75 | mv ../LICENSE stage3-release/ | |
| 76 | mv ../zig-cache/langref.html stage3-release/doc | |
| 77 | ||
| 78 | VERSION=$(stage3-release/zig version) | |
| 79 | DIRNAME="zig-macos-$ARCH-$VERSION" | |
| 80 | TARBALL="$DIRNAME.tar.xz" | |
| 81 | mv stage3-release "$DIRNAME" | |
| 82 | tar cfJ "$TARBALL" "$DIRNAME" | |
| 83 | ||
| 84 | mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg" | |
| 85 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | |
| 86 | ||
| 87 | SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1) | |
| 88 | BYTESIZE=$(wc -c < $TARBALL) | |
| 89 | ||
| 90 | JSONFILE="macos-$GITBRANCH.json" | |
| 91 | touch $JSONFILE | |
| 92 | echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE | |
| 93 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE | |
| 94 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE | |
| 95 | ||
| 96 | s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE" | |
| 97 | s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/$ARCH-macos-$VERSION.json" | |
| 98 | ||
| 99 | # `set -x` causes these variables to be mangled. | |
| 100 | # See https://developercommunity.visualstudio.com/content/problem/375679/pipeline-variable-incorrectly-inserts-single-quote.html | |
| 101 | set +x | |
| 102 | echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL" | |
| 103 | echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM" | |
| 104 | echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE" | |
| 105 | echo "##vso[task.setvariable variable=version;isOutput=true]$VERSION" | |
| 106 | fi |
ci/azure/on_master_success deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | # We do not set -x because this would leak the oauth access token. | |
| 4 | set +x | |
| 5 | ||
| 6 | set -e | |
| 7 | ||
| 8 | sudo apt-get update -y | |
| 9 | sudo apt-get install -y curl jq | |
| 10 | ||
| 11 | OAUTH_TOKEN="$(cat "$DOWNLOADSECUREFILE_SECUREFILEPATH")" | |
| 12 | ./ci/srht/on_master_success "$VERSION" "$OAUTH_TOKEN" |
ci/azure/pipelines.yml deleted-169| ... | ... | @@ -1,169 +0,0 @@ |
| 1 | jobs: | |
| 2 | - job: BuildMacOS | |
| 3 | pool: | |
| 4 | vmImage: 'macOS-11' | |
| 5 | timeoutInMinutes: 360 | |
| 6 | steps: | |
| 7 | - task: DownloadSecureFile@1 | |
| 8 | inputs: | |
| 9 | secureFile: s3cfg | |
| 10 | - script: ci/azure/macos_script | |
| 11 | name: main | |
| 12 | displayName: 'Build and test' | |
| 13 | - job: BuildWindows | |
| 14 | timeoutInMinutes: 360 | |
| 15 | pool: | |
| 16 | vmImage: 'windows-2019' | |
| 17 | variables: | |
| 18 | TARGET: 'x86_64-windows-gnu' | |
| 19 | ZIG_LLVM_CLANG_LLD_NAME: 'zig+llvm+lld+clang-${{ variables.TARGET }}-0.11.0-dev.25+499dddb4c' | |
| 20 | ZIG_LLVM_CLANG_LLD_URL: 'https://ziglang.org/deps/${{ variables.ZIG_LLVM_CLANG_LLD_NAME }}.zip' | |
| 21 | steps: | |
| 22 | - pwsh: | | |
| 23 | (New-Object Net.WebClient).DownloadFile("$(ZIG_LLVM_CLANG_LLD_URL)", "${ZIG_LLVM_CLANG_LLD_NAME}.zip") | |
| 24 | & 'C:\Program Files\7-Zip\7z.exe' x "${ZIG_LLVM_CLANG_LLD_NAME}.zip" | |
| 25 | name: install | |
| 26 | displayName: 'Install ZIG/LLVM/CLANG/LLD' | |
| 27 | ||
| 28 | - pwsh: | | |
| 29 | Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib" | |
| 30 | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release" | |
| 31 | Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(ZIG_LLVM_CLANG_LLD_NAME)" | |
| 32 | ||
| 33 | function CheckLastExitCode { | |
| 34 | if (!$?) { | |
| 35 | exit 1 | |
| 36 | } | |
| 37 | return 0 | |
| 38 | } | |
| 39 | ||
| 40 | # Make the `zig version` number consistent. | |
| 41 | # This will affect the `zig build` command below which uses `git describe`. | |
| 42 | git config core.abbrev 9 | |
| 43 | git fetch --tags | |
| 44 | if ((git rev-parse --is-shallow-repository) -eq "true") { | |
| 45 | git fetch --unshallow # `git describe` won't work on a shallow repo | |
| 46 | } | |
| 47 | ||
| 48 | & "$ZIGPREFIXPATH\bin\zig.exe" build ` | |
| 49 | --prefix "$ZIGINSTALLDIR" ` | |
| 50 | --search-prefix "$ZIGPREFIXPATH" ` | |
| 51 | --zig-lib-dir "$ZIGLIBDIR" ` | |
| 52 | -Denable-stage1 ` | |
| 53 | -Dstatic-llvm ` | |
| 54 | -Drelease ` | |
| 55 | -Dstrip ` | |
| 56 | -Duse-zig-libcxx ` | |
| 57 | -Dtarget=$(TARGET) | |
| 58 | CheckLastExitCode | |
| 59 | name: build | |
| 60 | displayName: 'Build' | |
| 61 | ||
| 62 | - pwsh: | | |
| 63 | Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib" | |
| 64 | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release" | |
| 65 | Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(ZIG_LLVM_CLANG_LLD_NAME)" | |
| 66 | ||
| 67 | function CheckLastExitCode { | |
| 68 | if (!$?) { | |
| 69 | exit 1 | |
| 70 | } | |
| 71 | return 0 | |
| 72 | } | |
| 73 | ||
| 74 | & "$ZIGINSTALLDIR\bin\zig.exe" build test docs ` | |
| 75 | --search-prefix "$ZIGPREFIXPATH" ` | |
| 76 | -Dstatic-llvm ` | |
| 77 | -Dskip-non-native | |
| 78 | CheckLastExitCode | |
| 79 | ||
| 80 | # Produce the experimental std lib documentation. | |
| 81 | mkdir "$ZIGINSTALLDIR\doc\std" -force | |
| 82 | & "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" ` | |
| 83 | --zig-lib-dir "$ZIGLIBDIR" ` | |
| 84 | -femit-docs="$ZIGINSTALLDIR\doc\std" ` | |
| 85 | -fno-emit-bin | |
| 86 | ||
| 87 | name: test | |
| 88 | displayName: 'Test' | |
| 89 | ||
| 90 | - task: DownloadSecureFile@1 | |
| 91 | inputs: | |
| 92 | name: aws_credentials | |
| 93 | secureFile: aws_credentials | |
| 94 | ||
| 95 | - pwsh: | | |
| 96 | $Env:AWS_SHARED_CREDENTIALS_FILE = "$Env:DOWNLOADSECUREFILE_SECUREFILEPATH" | |
| 97 | ||
| 98 | # Workaround Azure networking issue | |
| 99 | # https://github.com/aws/aws-cli/issues/5749 | |
| 100 | $Env:AWS_EC2_METADATA_DISABLED = "true" | |
| 101 | $Env:AWS_REGION = "us-west-2" | |
| 102 | ||
| 103 | mv LICENSE stage3-release/ | |
| 104 | mv zig-cache/langref.html stage3-release/ | |
| 105 | mv stage3-release/bin/zig.exe stage3-release/ | |
| 106 | rmdir stage3-release/bin | |
| 107 | ||
| 108 | # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig | |
| 109 | mv stage3-release/lib/zig stage3-release/lib2 | |
| 110 | rmdir stage3-release/lib | |
| 111 | mv stage3-release/lib2 stage3-release/lib | |
| 112 | ||
| 113 | Set-Variable -Name VERSION -Value $(./stage3-release/zig.exe version) | |
| 114 | Set-Variable -Name DIRNAME -Value "zig-windows-x86_64-$VERSION" | |
| 115 | Set-Variable -Name TARBALL -Value "$DIRNAME.zip" | |
| 116 | mv stage3-release "$DIRNAME" | |
| 117 | 7z a "$TARBALL" "$DIRNAME" | |
| 118 | ||
| 119 | aws s3 cp ` | |
| 120 | "$TARBALL" ` | |
| 121 | s3://ziglang.org/builds/ ` | |
| 122 | --acl public-read ` | |
| 123 | --cache-control 'public, max-age=31536000, immutable' | |
| 124 | ||
| 125 | Set-Variable -Name SHASUM -Value (Get-FileHash "$TARBALL" -Algorithm SHA256 | select-object -ExpandProperty Hash).ToLower() | |
| 126 | Set-Variable -Name BYTESIZE -Value (Get-Item "$TARBALL").length | |
| 127 | ||
| 128 | Set-Variable -Name JSONFILE -Value "windows-${Env:BUILD_SOURCEBRANCHNAME}.json" | |
| 129 | echo $null > $JSONFILE | |
| 130 | echo ('{"tarball": "' + $TARBALL + '",') >> $JSONFILE | |
| 131 | echo ('"shasum": "' + $SHASUM + '",') >> $JSONFILE | |
| 132 | echo ('"size": ' + $BYTESIZE + '}' ) >> $JSONFILE | |
| 133 | ||
| 134 | aws s3 cp ` | |
| 135 | "$JSONFILE" ` | |
| 136 | s3://ziglang.org/builds/ ` | |
| 137 | --acl public-read ` | |
| 138 | --cache-control 'max-age=0, must-revalidate' | |
| 139 | ||
| 140 | aws s3 cp ` | |
| 141 | "$JSONFILE" ` | |
| 142 | "s3://ziglang.org/builds/x86_64-windows-${VERSION}.json" ` | |
| 143 | --acl public-read | |
| 144 | ||
| 145 | echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL" | |
| 146 | echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM" | |
| 147 | echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE" | |
| 148 | ||
| 149 | name: upload | |
| 150 | condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) | |
| 151 | displayName: 'Upload' | |
| 152 | ||
| 153 | - job: OnMasterSuccess | |
| 154 | dependsOn: | |
| 155 | - BuildMacOS | |
| 156 | - BuildWindows | |
| 157 | condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) | |
| 158 | strategy: | |
| 159 | maxParallel: 1 | |
| 160 | pool: | |
| 161 | vmImage: 'ubuntu-20.04' | |
| 162 | variables: | |
| 163 | version: $[ dependencies.BuildMacOS.outputs['main.version'] ] | |
| 164 | steps: | |
| 165 | - task: DownloadSecureFile@1 | |
| 166 | inputs: | |
| 167 | secureFile: oauth_token | |
| 168 | - script: ci/azure/on_master_success | |
| 169 | displayName: 'master branch success hook' |
ci/index.json+5| ... | ... | @@ -33,6 +33,11 @@ |
| 33 | 33 | "tarball": "https://ziglang.org/builds/{{X86_64_LINUX_TARBALL}}", |
| 34 | 34 | "shasum": "{{X86_64_LINUX_SHASUM}}", |
| 35 | 35 | "size": "{{X86_64_LINUX_BYTESIZE}}" |
| 36 | }, | |
| 37 | "aarch64-linux": { | |
| 38 | "tarball": "https://ziglang.org/builds/{{AARCH64_LINUX_TARBALL}}", | |
| 39 | "shasum": "{{AARCH64_LINUX_SHASUM}}", | |
| 40 | "size": "{{AARCH64_LINUX_BYTESIZE}}" | |
| 36 | 41 | } |
| 37 | 42 | }, |
| 38 | 43 | "0.10.0": { |
ci/linux/build-tarballs.sh+54-49| ... | ... | @@ -12,7 +12,7 @@ WORKDIR="$(pwd)" |
| 12 | 12 | ARCH="$(uname -m)" |
| 13 | 13 | TARGET="$ARCH-linux-musl" |
| 14 | 14 | MCPU="baseline" |
| 15 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0" | |
| 15 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.256+271cc52a1" | |
| 16 | 16 | PREFIX="$HOME/deps/$CACHE_BASENAME" |
| 17 | 17 | ZIG="$PREFIX/bin/zig" |
| 18 | 18 | |
| ... | ... | @@ -45,7 +45,6 @@ unset CXX |
| 45 | 45 | |
| 46 | 46 | ninja install |
| 47 | 47 | |
| 48 | # Make sure our ZIG_VERSION below is correct. | |
| 49 | 48 | ZIG_VERSION="$(stage3-release/bin/zig version)" |
| 50 | 49 | BOOTSTRAP_SRC="$WORKDIR/zig-bootstrap" |
| 51 | 50 | TARBALLS_DIR="$WORKDIR/tarballs" |
| ... | ... | @@ -56,29 +55,46 @@ rm -rf zig |
| 56 | 55 | cp -r "$ZIGDIR" ./ |
| 57 | 56 | sed -i "/^ZIG_VERSION=\".*\"\$/c\\ZIG_VERSION=\"$ZIG_VERSION\"" build |
| 58 | 57 | |
| 59 | CMAKE_GENERATOR=Ninja ./build aarch64-linux-musl baseline | |
| 60 | CMAKE_GENERATOR=Ninja ./build x86_64-linux-musl baseline | |
| 61 | #CMAKE_GENERATOR=Ninja ./build x86-linux-musl baseline | |
| 62 | #CMAKE_GENERATOR=Ninja ./build riscv64-linux-musl baseline | |
| 63 | #CMAKE_GENERATOR=Ninja ./build arm-linux-musleabihf generic+v7a | |
| 64 | CMAKE_GENERATOR=Ninja ./build x86_64-macos-none baseline | |
| 65 | CMAKE_GENERATOR=Ninja ./build aarch64-macos-none apple_a14 | |
| 66 | CMAKE_GENERATOR=Ninja ./build x86_64-windows-gnu baseline | |
| 67 | #CMAKE_GENERATOR=Ninja ./build x86-windows-gnu baseline | |
| 68 | #CMAKE_GENERATOR=Ninja ./build aarch64-windows-gnu baseline | |
| 58 | # Unfortunately Debian's cmake (3.14.4) is too old for zig-bootstrap. | |
| 59 | PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build aarch64-linux-musl baseline | |
| 60 | PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build x86_64-linux-musl baseline | |
| 61 | #PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build x86-linux-musl baseline | |
| 62 | #PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build riscv64-linux-musl baseline | |
| 63 | #PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build arm-linux-musleabihf generic+v7a | |
| 64 | PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build x86_64-macos-none baseline | |
| 65 | PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build aarch64-macos-none apple_a14 | |
| 66 | PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build x86_64-windows-gnu baseline | |
| 67 | #PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build x86-windows-gnu baseline | |
| 68 | #PATH="$HOME/local/bin:$PATH" CMAKE_GENERATOR=Ninja ./build aarch64-windows-gnu baseline | |
| 69 | 69 | |
| 70 | 70 | ZIG="$BOOTSTRAP_SRC/out/host/bin/zig" |
| 71 | 71 | |
| 72 | cd "$ZIGDIR" | |
| 73 | SRC_TARBALL="$TARBALLS_DIR/zig-$ZIG_VERSION.tar.xz" | |
| 74 | git archive --format=tar.xz -o "$SRC_TARBALL" --prefix=zig-$ZIG_VERSION/ $ZIG_VERSION | |
| 72 | rm -rf "$TARBALLS_DIR" | |
| 73 | mkdir "$TARBALLS_DIR" | |
| 74 | cd "$TARBALLS_DIR" | |
| 75 | ||
| 76 | cp -r "$ZIGDIR" ./ | |
| 77 | rm -rf \ | |
| 78 | "zig/.github" \ | |
| 79 | "zig/.gitignore" \ | |
| 80 | "zig/.git" \ | |
| 81 | "zig/ci" \ | |
| 82 | "zig/CODE_OF_CONDUCT.md" \ | |
| 83 | "zig/CONTRIBUTING.md" \ | |
| 84 | "zig/.builds" \ | |
| 85 | "zig/build" \ | |
| 86 | "zig/build-release" \ | |
| 87 | "zig/build-debug" \ | |
| 88 | "zig/zig-cache" | |
| 89 | mv zig "zig-$ZIG_VERSION" | |
| 90 | tar cfJ "zig-$ZIG_VERSION.tar.xz" "zig-$ZIG_VERSION" | |
| 75 | 91 | |
| 76 | 92 | cd "$BOOTSTRAP_SRC" |
| 77 | 93 | "$ZIG" build --build-file zig/build.zig docs |
| 78 | 94 | LANGREF_HTML="$BOOTSTRAP_SRC/zig/zig-cache/langref.html" |
| 95 | # Look for HTML errors. | |
| 96 | tidy --drop-empty-elements no -qe "$LANGREF_HTML" | |
| 79 | 97 | |
| 80 | rm -rf "$TARBALLS_DIR" | |
| 81 | mkdir "$TARBALLS_DIR" | |
| 82 | 98 | cd "$TARBALLS_DIR" |
| 83 | 99 | |
| 84 | 100 | cp -r $BOOTSTRAP_SRC/out/zig-aarch64-linux-musl-baseline zig-linux-aarch64-$ZIG_VERSION/ |
| ... | ... | @@ -166,17 +182,17 @@ mkdir zig-macos-x86_64-$ZIG_VERSION/doc/ |
| 166 | 182 | #mkdir zig-freebsd-x86_64-$ZIG_VERSION/doc/ |
| 167 | 183 | |
| 168 | 184 | cd $REL_SRC_BUILD |
| 169 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-aarch64 -target aarch64-linux-musl -fno-emit-bin | |
| 170 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-armv7a -target arm-linux-musl -mcpu=generic+v7a -fno-emit-bin | |
| 171 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-x86 -target x86-linux-musl -fno-emit-bin | |
| 172 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-riscv64 -target riscv64-linux-musl -fno-emit-bin | |
| 173 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-x86_64 -target x86_64-linux-musl -fno-emit-bin | |
| 174 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-x86 -target x86-windows-gnu -fno-emit-bin | |
| 175 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-x86_64 -target x86_64-windows-gnu -fno-emit-bin | |
| 176 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-aarch64 -target aarch64-windows-gnu -fno-emit-bin | |
| 177 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-macos-x86_64 -target x86_64-macos -fno-emit-bin | |
| 178 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-macos-aarch64 -target aarch64-macos -fno-emit-bin | |
| 179 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-freebsd-x86_64 -target x86_64-freebsd -fno-emit-bin | |
| 185 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-aarch64 -target aarch64-linux-musl -fno-emit-bin --zig-lib-dir ../lib | |
| 186 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-armv7a -target arm-linux-musl -mcpu=generic+v7a -fno-emit-bin --zig-lib-dir ../lib | |
| 187 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-x86 -target x86-linux-musl -fno-emit-bin --zig-lib-dir ../lib | |
| 188 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-riscv64 -target riscv64-linux-musl -fno-emit-bin --zig-lib-dir ../lib | |
| 189 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-x86_64 -target x86_64-linux-musl -fno-emit-bin --zig-lib-dir ../lib | |
| 190 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-x86 -target x86-windows-gnu -fno-emit-bin --zig-lib-dir ../lib | |
| 191 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-x86_64 -target x86_64-windows-gnu -fno-emit-bin --zig-lib-dir ../lib | |
| 192 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-aarch64 -target aarch64-windows-gnu -fno-emit-bin --zig-lib-dir ../lib | |
| 193 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-macos-x86_64 -target x86_64-macos -fno-emit-bin --zig-lib-dir ../lib | |
| 194 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-macos-aarch64 -target aarch64-macos -fno-emit-bin --zig-lib-dir ../lib | |
| 195 | #stage3-release/bin/zig test ../lib/std/std.zig -femit-docs=doc-freebsd-x86_64 -target x86_64-freebsd -fno-emit-bin --zig-lib-dir ../lib | |
| 180 | 196 | |
| 181 | 197 | cd "$TARBALLS_DIR" |
| 182 | 198 | cp -r $REL_SRC_BUILD/doc-linux-aarch64 zig-linux-aarch64-$ZIG_VERSION/doc/std |
| ... | ... | @@ -203,18 +219,6 @@ cp $LANGREF_HTML zig-macos-aarch64-$ZIG_VERSION/doc/ |
| 203 | 219 | cp $LANGREF_HTML zig-macos-x86_64-$ZIG_VERSION/doc/ |
| 204 | 220 | #cp $LANGREF_HTML zig-freebsd-x86_64-$ZIG_VERSION/doc/ |
| 205 | 221 | |
| 206 | #rm -rf zig-linux-aarch64-$ZIG_VERSION/doc/std/src | |
| 207 | #rm -rf zig-linux-armv7a-$ZIG_VERSION/doc/std/src | |
| 208 | #rm -rf zig-linux-x86-$ZIG_VERSION/doc/std/src | |
| 209 | #rm -rf zig-linux-riscv64-$ZIG_VERSION/doc/std/src | |
| 210 | #rm -rf zig-linux-x86_64-$ZIG_VERSION/doc/std/src | |
| 211 | ##rm -rf zig-windows-x86-$ZIG_VERSION/doc/std/src | |
| 212 | #rm -rf zig-windows-x86_64-$ZIG_VERSION/doc/std/src | |
| 213 | #rm -rf zig-windows-aarch64-$ZIG_VERSION/doc/std/src | |
| 214 | #rm -rf zig-macos-aarch64-$ZIG_VERSION/doc/std/src | |
| 215 | #rm -rf zig-macos-x86_64-$ZIG_VERSION/doc/std/src | |
| 216 | #rm -rf zig-freebsd-x86_64-$ZIG_VERSION/doc/std/src | |
| 217 | ||
| 218 | 222 | tar cJf zig-linux-aarch64-$ZIG_VERSION.tar.xz zig-linux-aarch64-$ZIG_VERSION/ |
| 219 | 223 | #tar cJf zig-linux-armv7a-$ZIG_VERSION.tar.xz zig-linux-armv7a-$ZIG_VERSION/ |
| 220 | 224 | #tar cJf zig-linux-x86-$ZIG_VERSION.tar.xz zig-linux-x86-$ZIG_VERSION/ |
| ... | ... | @@ -241,8 +245,9 @@ s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" z |
| 241 | 245 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-macos-x86_64-$ZIG_VERSION.tar.xz s3://ziglang.org/builds/$ZIG_VERSION/ |
| 242 | 246 | #s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-freebsd-x86_64-$ZIG_VERSION.tar.xz s3://ziglang.org/builds/$ZIG_VERSION/ |
| 243 | 247 | |
| 244 | export SRC_SHASUM=$(sha256sum $SRC_TARBALL | cut '-d ' -f1) | |
| 245 | export SRC_BYTESIZE=$(wc -c < $SRC_TARBALL) | |
| 248 | export SRC_TARBALL="zig-$ZIG_VERSION.tar.xz" | |
| 249 | export SRC_SHASUM=$(sha256sum "zig-$ZIG_VERSION.tar.xz" | cut '-d ' -f1) | |
| 250 | export SRC_BYTESIZE=$(wc -c < "zig-$ZIG_VERSION.tar.xz") | |
| 246 | 251 | |
| 247 | 252 | export X86_64_WINDOWS_TARBALL="zig-windows-x86_64-$ZIG_VERSION.zip" |
| 248 | 253 | export X86_64_WINDOWS_BYTESIZE=$(wc -c < "zig-windows-x86_64-$ZIG_VERSION.zip") |
| ... | ... | @@ -260,9 +265,9 @@ export X86_64_LINUX_TARBALL="zig-linux-x86_64-$ZIG_VERSION.tar.xz" |
| 260 | 265 | export X86_64_LINUX_BYTESIZE=$(wc -c < "zig-linux-x86_64-$ZIG_VERSION.tar.xz") |
| 261 | 266 | export X86_64_LINUX_SHASUM="$(sha256sum "zig-linux-x86_64-$ZIG_VERSION.tar.xz" | cut '-d ' -f1)" |
| 262 | 267 | |
| 263 | #export AARCH64_LINUX_TARBALL="zig-linux-aarch64-$ZIG_VERSION.tar.xz" | |
| 264 | #export AARCH64_LINUX_BYTESIZE=$(wc -c < "zig-linux-aarch64-$ZIG_VERSION.tar.xz") | |
| 265 | #export AARCH64_LINUX_SHASUM="$(sha256sum "zig-linux-aarch64-$ZIG_VERSION.tar.xz" | cut '-d ' -f1)" | |
| 268 | export AARCH64_LINUX_TARBALL="zig-linux-aarch64-$ZIG_VERSION.tar.xz" | |
| 269 | export AARCH64_LINUX_BYTESIZE=$(wc -c < "zig-linux-aarch64-$ZIG_VERSION.tar.xz") | |
| 270 | export AARCH64_LINUX_SHASUM="$(sha256sum "zig-linux-aarch64-$ZIG_VERSION.tar.xz" | cut '-d ' -f1)" | |
| 266 | 271 | |
| 267 | 272 | #export X86_64_FREEBSD_TARBALL="zig-freebsd-x86_64-$ZIG_VERSION.tar.xz" |
| 268 | 273 | #export X86_64_FREEBSD_BYTESIZE=$(wc -c < "zig-freebsd-x86_64-$ZIG_VERSION.tar.xz") |
| ... | ... | @@ -276,9 +281,9 @@ export MASTER_DATE="$(date +%Y-%m-%d)" |
| 276 | 281 | export MASTER_VERSION="$ZIG_VERSION" |
| 277 | 282 | |
| 278 | 283 | # Create index.json and update the website repo. |
| 279 | CIDIR="$ZIGDIR/ci" | |
| 280 | cd "$CIDIR" | |
| 284 | cd "$ZIGDIR/ci" | |
| 281 | 285 | "$ZIG" run update-download-page.zig |
| 286 | mv out "$TARBALLS_DIR/out" | |
| 282 | 287 | |
| 283 | 288 | cd "$WORKDIR/www.ziglang.org" |
| 284 | 289 | # This is the user when pushing to the website repo. |
| ... | ... | @@ -286,7 +291,7 @@ git config user.email "ziggy@ziglang.org" |
| 286 | 291 | git config user.name "Ziggy" |
| 287 | 292 | git pull |
| 288 | 293 | |
| 289 | cp "$CIDIR/out/index.json" data/releases.json | |
| 294 | cp "$TARBALLS_DIR/out/index.json" data/releases.json | |
| 290 | 295 | git add data/releases.json |
| 291 | 296 | git commit -m "CI: update releases" |
| 292 | 297 | git push origin master |
| ... | ... | @@ -304,7 +309,7 @@ git push origin master |
| 304 | 309 | # * Figure out how to adjust the Cloudfront settings to increase the max size for |
| 305 | 310 | # auto-compressed objects. |
| 306 | 311 | # * Migrate to fastly. |
| 307 | DOCDIR="$REL_SRC_BUILD/doc-linux-aarch64" | |
| 312 | DOCDIR="$TARBALLS_DIR/zig-linux-aarch64-$ZIG_VERSION/doc" | |
| 308 | 313 | s3cmd put -P --no-mime-magic \ |
| 309 | 314 | --add-header="Cache-Control: max-age=0, must-revalidate" \ |
| 310 | 315 | "$LANGREF_HTML" s3://ziglang.org/documentation/master/index.html |
ci/linux/build-x86_64-debug.sh created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ZIGDIR="$(pwd)" | |
| 7 | ARCH="$(uname -m)" | |
| 8 | DEPS_LOCAL="$HOME/local" | |
| 9 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | |
| 10 | TARGET="${ARCH}-linux-musl" | |
| 11 | MCPU="baseline" | |
| 12 | ||
| 13 | mkdir -p "$DEPS_LOCAL" | |
| 14 | cd "$DEPS_LOCAL" | |
| 15 | ||
| 16 | wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz | |
| 17 | tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz | |
| 18 | ||
| 19 | wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz | |
| 20 | tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz | |
| 21 | ||
| 22 | wget https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.2/wasmtime-v2.0.2-x86_64-linux.tar.xz | |
| 23 | tar x --strip-components=1 -f wasmtime-v2.0.2-x86_64-linux.tar.xz | |
| 24 | rm -f LICENSE README.md | |
| 25 | mv wasmtime bin/ | |
| 26 | ||
| 27 | export PATH=$DEPS_LOCAL/bin:$PATH | |
| 28 | ||
| 29 | cd "$ZIGDIR" | |
| 30 | echo "building stage3-debug with zig version $($OLD_ZIG version)" | |
| 31 | ||
| 32 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 33 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 34 | ||
| 35 | mkdir build | |
| 36 | cd build | |
| 37 | cmake .. \ | |
| 38 | -DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \ | |
| 39 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | |
| 40 | -DCMAKE_BUILD_TYPE=Debug \ | |
| 41 | -DZIG_STATIC=ON \ | |
| 42 | -DZIG_USE_LLVM_CONFIG=OFF | |
| 43 | ||
| 44 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 45 | # so that installation and testing do not get affected by them. | |
| 46 | unset CC | |
| 47 | unset CXX | |
| 48 | ||
| 49 | make -j2 install | |
| 50 | ||
| 51 | echo "Looking for non-conforming code formatting..." | |
| 52 | stage3/bin/zig fmt --check .. \ | |
| 53 | --exclude ../test/cases/ \ | |
| 54 | --exclude ../build | |
| 55 | ||
| 56 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | |
| 57 | stage3/bin/zig build -Dtarget=arm-linux-musleabihf | |
| 58 | ||
| 59 | stage3/bin/zig build test \ | |
| 60 | -fqemu \ | |
| 61 | -fwasmtime \ | |
| 62 | -Dstatic-llvm \ | |
| 63 | -Dtarget=native-native-musl \ | |
| 64 | --search-prefix "$DEPS_LOCAL" \ | |
| 65 | --zig-lib-dir "$(pwd)/../lib" |
ci/linux/build-x86_64-release.sh created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ZIGDIR="$(pwd)" | |
| 7 | ARCH="$(uname -m)" | |
| 8 | DEPS_LOCAL="$HOME/local" | |
| 9 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | |
| 10 | TARGET="${ARCH}-linux-musl" | |
| 11 | MCPU="baseline" | |
| 12 | ||
| 13 | mkdir -p "$DEPS_LOCAL" | |
| 14 | cd "$DEPS_LOCAL" | |
| 15 | ||
| 16 | wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz | |
| 17 | tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz | |
| 18 | ||
| 19 | wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz | |
| 20 | tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz | |
| 21 | ||
| 22 | wget https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.2/wasmtime-v2.0.2-x86_64-linux.tar.xz | |
| 23 | tar x --strip-components=1 -f wasmtime-v2.0.2-x86_64-linux.tar.xz | |
| 24 | rm -f LICENSE README.md | |
| 25 | mv wasmtime bin/ | |
| 26 | ||
| 27 | export PATH=$DEPS_LOCAL/bin:$PATH | |
| 28 | ||
| 29 | cd "$ZIGDIR" | |
| 30 | echo "building stage3-release with zig version $($OLD_ZIG version)" | |
| 31 | ||
| 32 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 33 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 34 | ||
| 35 | mkdir build | |
| 36 | cd build | |
| 37 | cmake .. \ | |
| 38 | -DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \ | |
| 39 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | |
| 40 | -DCMAKE_BUILD_TYPE=Release \ | |
| 41 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 42 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 43 | -DZIG_STATIC=ON | |
| 44 | ||
| 45 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 46 | # so that installation and testing do not get affected by them. | |
| 47 | unset CC | |
| 48 | unset CXX | |
| 49 | ||
| 50 | make -j2 install | |
| 51 | ||
| 52 | "stage3/bin/zig" build test \ | |
| 53 | -fqemu \ | |
| 54 | -fwasmtime \ | |
| 55 | -Dstatic-llvm \ | |
| 56 | -Dtarget=native-native-musl \ | |
| 57 | --search-prefix "$DEPS_LOCAL" \ | |
| 58 | --zig-lib-dir "$(pwd)/../lib" | |
| 59 | ||
| 60 | "stage3/bin/zig" build \ | |
| 61 | --prefix stage4 \ | |
| 62 | -Dconfig_h="build/config.h" \ | |
| 63 | -Denable-llvm \ | |
| 64 | -Denable-stage1 \ | |
| 65 | -Dno-lib \ | |
| 66 | -Drelease \ | |
| 67 | -Dstrip \ | |
| 68 | -Dtarget=x86_64-linux-musl \ | |
| 69 | -Duse-zig-libcxx \ | |
| 70 | -Dversion-string="$(stage3/bin/zig version)" | |
| 71 | ||
| 72 | # diff returns an error code if the files differ. | |
| 73 | echo "If the following command fails, it means nondeterminism has been" | |
| 74 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 75 | diff stage3/bin/zig stage4/bin/zig |
ci/srht/freebsd_script deleted-114| ... | ... | @@ -1,114 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | sudo pkg update -fq | |
| 7 | sudo pkg install -y cmake py39-s3cmd wget curl jq samurai | |
| 8 | ||
| 9 | ZIGDIR="$(pwd)" | |
| 10 | TARGET="x86_64-freebsd-gnu" | |
| 11 | MCPU="baseline" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0" | |
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 14 | ||
| 15 | cd $HOME | |
| 16 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 17 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 18 | ||
| 19 | cd $ZIGDIR | |
| 20 | ||
| 21 | # Make the `zig version` number consistent. | |
| 22 | # This will affect the cmake command below. | |
| 23 | git config core.abbrev 9 | |
| 24 | git fetch --unshallow || true | |
| 25 | git fetch --tags | |
| 26 | ||
| 27 | # SourceHut reports that it is a terminal that supports escape codes, but it | |
| 28 | # is a filthy liar. Here we tell Zig to not try to send any terminal escape | |
| 29 | # codes to show progress. | |
| 30 | export TERM=dumb | |
| 31 | ||
| 32 | mkdir build | |
| 33 | cd build | |
| 34 | ||
| 35 | ||
| 36 | cmake .. \ | |
| 37 | -DCMAKE_BUILD_TYPE=Release \ | |
| 38 | -DCMAKE_PREFIX_PATH=$PREFIX \ | |
| 39 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 40 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 41 | -DZIG_STATIC=ON \ | |
| 42 | -GNinja | |
| 43 | ||
| 44 | # TODO: eliminate this workaround. Without this, zig does not end up passing | |
| 45 | # -isystem /usr/include when building libc++, resulting in #include <sys/endian.h> | |
| 46 | # "file not found" errors. | |
| 47 | echo "include_dir=/usr/include" >>libc.txt | |
| 48 | echo "sys_include_dir=/usr/include" >>libc.txt | |
| 49 | echo "crt_dir=/usr/lib" >>libc.txt | |
| 50 | echo "msvc_lib_dir=" >>libc.txt | |
| 51 | echo "kernel32_lib_dir=" >>libc.txt | |
| 52 | echo "gcc_dir=" >>libc.txt | |
| 53 | ZIG_LIBC_TXT="$(pwd)/libc.txt" | |
| 54 | ||
| 55 | ZIG_LIBC="$ZIG_LIBC_TXT" samu install | |
| 56 | ||
| 57 | # Here we skip some tests to save time. | |
| 58 | stage3/bin/zig build test docs \ | |
| 59 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 60 | -Dstatic-llvm \ | |
| 61 | --search-prefix "$PREFIX" \ | |
| 62 | -Dskip-stage1 \ | |
| 63 | -Dskip-non-native | |
| 64 | ||
| 65 | # Produce the experimental std lib documentation. | |
| 66 | mkdir -p "stage3/doc/std" | |
| 67 | stage3/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 68 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 69 | -femit-docs="$(pwd)/stage3/doc/std/" \ | |
| 70 | -fno-emit-bin | |
| 71 | ||
| 72 | if [ -f ~/.s3cfg ]; then | |
| 73 | # Remove the unnecessary bin dir in stage3/bin/zig | |
| 74 | mv stage3/bin/zig stage3/ | |
| 75 | rmdir stage3/bin | |
| 76 | ||
| 77 | # Remove the unnecessary zig dir in stage3/lib/zig/std/std.zig | |
| 78 | mv stage3/lib/zig stage3/lib2 | |
| 79 | rmdir stage3/lib | |
| 80 | mv stage3/lib2 stage3/lib | |
| 81 | ||
| 82 | mv ../LICENSE stage3/ | |
| 83 | mv ../zig-cache/langref.html stage3/doc/ | |
| 84 | ||
| 85 | GITBRANCH=$(basename $GITHUB_REF) | |
| 86 | VERSION=$(stage3/zig version) | |
| 87 | DIRNAME="zig-freebsd-x86_64-$VERSION" | |
| 88 | TARBALL="$DIRNAME.tar.xz" | |
| 89 | mv stage3 "$DIRNAME" | |
| 90 | tar cfJ "$TARBALL" "$DIRNAME" | |
| 91 | ||
| 92 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | |
| 93 | ||
| 94 | SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1) | |
| 95 | BYTESIZE=$(wc -c < $TARBALL) | |
| 96 | ||
| 97 | JSONFILE="freebsd-$GITBRANCH.json" | |
| 98 | touch $JSONFILE | |
| 99 | echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE | |
| 100 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE | |
| 101 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE | |
| 102 | ||
| 103 | s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE" | |
| 104 | s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/x86_64-freebsd-$VERSION.json" | |
| 105 | ||
| 106 | if [ "$GITBRANCH" = "master" ]; then | |
| 107 | # avoid leaking oauth token | |
| 108 | set +x | |
| 109 | ||
| 110 | OAUTH_TOKEN="$(cat ~/.oauth_token)" | |
| 111 | cd "$ZIGDIR" | |
| 112 | ./ci/srht/on_master_success "$VERSION" "$OAUTH_TOKEN" | |
| 113 | fi | |
| 114 | fi |
ci/srht/netbsd_script deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | sudo pkgin -y update | |
| 7 | sudo pkgin -y upgrade | |
| 8 | sudo pkgin -y install cmake samurai curl jq py27-s3cmd wget clang | |
| 9 | ||
| 10 | ZIGDIR="$(pwd)" | |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-x86_64-netbsd-gnu-0.8.0" | |
| 12 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 13 | ||
| 14 | cd $HOME | |
| 15 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 16 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 17 | ||
| 18 | cd $ZIGDIR | |
| 19 | ||
| 20 | # Make the `zig version` number consistent. | |
| 21 | # This will affect the cmake command below. | |
| 22 | git config core.abbrev 9 | |
| 23 | git fetch --unshallow || true | |
| 24 | git fetch --tags | |
| 25 | ||
| 26 | # SourceHut reports that it is a terminal that supports escape codes, but it | |
| 27 | # is a filthy liar. Here we tell Zig to not try to send any terminal escape | |
| 28 | # codes to show progress. | |
| 29 | export TERM=dumb | |
| 30 | ||
| 31 | mkdir build | |
| 32 | cd build | |
| 33 | export CC="$PREFIX/bin/zigcc" | |
| 34 | export CXX="$PREFIX/bin/zigcxx" | |
| 35 | echo "#!/bin/sh | |
| 36 | env CC=\"clang\" $PREFIX/bin/zig cc \"\$@\"" > $CC | |
| 37 | echo "#!/bin/sh | |
| 38 | env CC=\"clang\" $PREFIX/bin/zig c++ \"\$@\"" > $CXX | |
| 39 | chmod +x $CC | |
| 40 | chmod +x $CXX | |
| 41 | ||
| 42 | cmake .. \ | |
| 43 | -DCMAKE_BUILD_TYPE=Release \ | |
| 44 | -DCMAKE_PREFIX_PATH=$PREFIX \ | |
| 45 | "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \ | |
| 46 | -DZIG_STATIC=ON \ | |
| 47 | -DZIG_TARGET_TRIPLE=x86_64-netbsd-none \ | |
| 48 | -GNinja | |
| 49 | samu install | |
| 50 | ||
| 51 | unset CC | |
| 52 | unset CXX | |
| 53 | ||
| 54 | # TODO ld.lld: error: undefined symbol: main | |
| 55 | #>>> referenced by crt0-common.c | |
| 56 | #>>> /usr/lib/crt0.o:(___start) | |
| 57 | #release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test | |
| 58 | ||
| 59 | # Here we skip some tests to save time. | |
| 60 | release/bin/zig build test -Dskip-stage1 -Dskip-non-native | |
| 61 | ||
| 62 | if [ -f ~/.s3cfg ]; then | |
| 63 | mv ../LICENSE release/ | |
| 64 | mv ../zig-cache/langref.html release/ | |
| 65 | mv release/bin/zig release/ | |
| 66 | rmdir release/bin | |
| 67 | ||
| 68 | GITBRANCH=$(basename $GITHUB_REF) | |
| 69 | VERSION=$(release/zig version) | |
| 70 | DIRNAME="zig-netbsd-x86_64-$VERSION" | |
| 71 | TARBALL="$DIRNAME.tar.xz" | |
| 72 | mv release "$DIRNAME" | |
| 73 | tar cfJ "$TARBALL" "$DIRNAME" | |
| 74 | ||
| 75 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | |
| 76 | ||
| 77 | SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1) | |
| 78 | BYTESIZE=$(wc -c < $TARBALL) | |
| 79 | ||
| 80 | JSONFILE="netbsd-$GITBRANCH.json" | |
| 81 | touch $JSONFILE | |
| 82 | echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE | |
| 83 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE | |
| 84 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE | |
| 85 | ||
| 86 | s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE" | |
| 87 | s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/x86_64-netbsd-$VERSION.json" | |
| 88 | ||
| 89 | if [ "$GITBRANCH" = "master" ]; then | |
| 90 | # avoid leaking oauth token | |
| 91 | set +x | |
| 92 | ||
| 93 | OAUTH_TOKEN="$(cat ~/.oauth_token)" | |
| 94 | cd "$ZIGDIR" | |
| 95 | ./ci/srht/on_master_success "$VERSION" "$OAUTH_TOKEN" | |
| 96 | fi | |
| 97 | fi |
ci/srht/on_master_success deleted-50| ... | ... | @@ -1,50 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | # This script must run on a lot of different platforms. | |
| 4 | # It assumes that the following things are installed: | |
| 5 | # * curl | |
| 6 | # * jq | |
| 7 | # * cat | |
| 8 | ||
| 9 | # We do not set -x because this would leak the oauth access token. | |
| 10 | set +x | |
| 11 | ||
| 12 | set -e | |
| 13 | ||
| 14 | VERSION="$1" | |
| 15 | OAUTH_TOKEN="$2" | |
| 16 | YML_FILE="tmp.yml" | |
| 17 | ||
| 18 | if [ -z "$VERSION" ]; then | |
| 19 | echo "missing VERSION parameter" | |
| 20 | exit 1 | |
| 21 | fi | |
| 22 | ||
| 23 | if [ -z "$OAUTH_TOKEN" ]; then | |
| 24 | echo "missing OAUTH_TOKEN parameter" | |
| 25 | exit 1 | |
| 26 | fi | |
| 27 | ||
| 28 | cat <<EOF >"$YML_FILE" | |
| 29 | image: alpine/latest | |
| 30 | packages: | |
| 31 | - py3-pip | |
| 32 | - curl | |
| 33 | - jq | |
| 34 | - xz | |
| 35 | secrets: | |
| 36 | - 51bfddf5-86a6-4e01-8576-358c72a4a0a4 | |
| 37 | - 44e2bd57-1d07-42bf-925e-22a36119041d | |
| 38 | sources: | |
| 39 | - https://github.com/ziglang/zig | |
| 40 | tasks: | |
| 41 | - build: cd zig && ./ci/srht/update_download_page $VERSION | |
| 42 | EOF | |
| 43 | ||
| 44 | jq <$YML_FILE -sR '{ | |
| 45 | "manifest": ., | |
| 46 | }' | curl \ | |
| 47 | -H Authorization:"token $OAUTH_TOKEN" \ | |
| 48 | -H Content-Type:application/json \ | |
| 49 | -X POST \ | |
| 50 | -d @- "https://builds.hut.lavatech.top/api/jobs" |
ci/srht/update_download_page deleted-150| ... | ... | @@ -1,150 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | VERSION="$1" | |
| 7 | SRCDIR="$(pwd)" | |
| 8 | NATIVE_TARBALL="zig-linux-$(uname -m)-$VERSION.tar.xz" | |
| 9 | ||
| 10 | # Check for all the builds being completed. It's expected that this script is run several times | |
| 11 | # before they are all complete. | |
| 12 | #AARCH64_LINUX_JSON_URL="https://ziglang.org/builds/aarch64-linux-$VERSION.json" | |
| 13 | X86_64_LINUX_JSON_URL="https://ziglang.org/builds/x86_64-linux-$VERSION.json" | |
| 14 | X86_64_WINDOWS_JSON_URL="https://ziglang.org/builds/x86_64-windows-$VERSION.json" | |
| 15 | AARCH64_MACOS_JSON_URL="https://ziglang.org/builds/aarch64-macos-$VERSION.json" | |
| 16 | X86_64_MACOS_JSON_URL="https://ziglang.org/builds/x86_64-macos-$VERSION.json" | |
| 17 | X86_64_FREEBSD_JSON_URL="https://ziglang.org/builds/x86_64-freebsd-$VERSION.json" | |
| 18 | #X86_64_NETBSD_JSON_URL="https://ziglang.org/builds/x86_64-netbsd-$VERSION.json" | |
| 19 | ||
| 20 | # If any of these fail, it's not really this job failing; rather we have detected | |
| 21 | # that this job will be called again later when other jobs have completed. | |
| 22 | #curl --fail -I "$AARCH64_LINUX_JSON_URL" >/dev/null || exit 0 | |
| 23 | curl --fail -I "$X86_64_LINUX_JSON_URL" >/dev/null || exit 0 | |
| 24 | curl --fail -I "$X86_64_WINDOWS_JSON_URL" >/dev/null || exit 0 | |
| 25 | curl --fail -I "$AARCH64_MACOS_JSON_URL" >/dev/null || exit 0 | |
| 26 | curl --fail -I "$X86_64_MACOS_JSON_URL" >/dev/null || exit 0 | |
| 27 | curl --fail -I "$X86_64_FREEBSD_JSON_URL" >/dev/null || exit 0 | |
| 28 | #curl --fail -I "$X86_64_NETBSD_JSON_URL" >/dev/null || exit 0 | |
| 29 | ||
| 30 | # Without --user, this gave me: | |
| 31 | # ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied | |
| 32 | pip3 install s3cmd --user | |
| 33 | S3CMD="$HOME/.local/bin/s3cmd" | |
| 34 | ||
| 35 | # Refresh this with `ssh-keyscan github.com` from a trusted Internet connection. | |
| 36 | # We hard code the public key here to detect man-in-the-middle attacks. | |
| 37 | echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts | |
| 38 | ||
| 39 | # We don't want the .git folder inside the tarball. | |
| 40 | rm -rf .git | |
| 41 | ||
| 42 | cd "$HOME" | |
| 43 | wget "https://ziglang.org/builds/$NATIVE_TARBALL" | |
| 44 | tar xf "$NATIVE_TARBALL" | |
| 45 | ZIGDIR="$(pwd)/$(basename $NATIVE_TARBALL .tar.xz)" | |
| 46 | ZIG="$ZIGDIR/zig" | |
| 47 | LANGREF="$ZIGDIR/doc/langref.html" | |
| 48 | SRCTARBALLDIR="zig-$VERSION" | |
| 49 | export SRC_TARBALL="$SRCTARBALLDIR.tar.xz" | |
| 50 | mv "$SRCDIR" "$SRCTARBALLDIR" | |
| 51 | tar cfJ "$SRC_TARBALL" "$SRCTARBALLDIR" | |
| 52 | export SRC_SHASUM=$(sha256sum $SRC_TARBALL | cut '-d ' -f1) | |
| 53 | export SRC_BYTESIZE=$(wc -c < $SRC_TARBALL) | |
| 54 | ||
| 55 | X86_64_WINDOWS_JSON=$(curl --fail "$X86_64_WINDOWS_JSON_URL" || exit 1) | |
| 56 | export X86_64_WINDOWS_TARBALL="$(echo "$X86_64_WINDOWS_JSON" | jq .tarball -r)" | |
| 57 | export X86_64_WINDOWS_BYTESIZE="$(echo "$X86_64_WINDOWS_JSON" | jq .size -r)" | |
| 58 | export X86_64_WINDOWS_SHASUM="$(echo "$X86_64_WINDOWS_JSON" | jq .shasum -r)" | |
| 59 | ||
| 60 | AARCH64_MACOS_JSON=$(curl --fail "$AARCH64_MACOS_JSON_URL" || exit 1) | |
| 61 | export AARCH64_MACOS_TARBALL="$(echo "$AARCH64_MACOS_JSON" | jq .tarball -r)" | |
| 62 | export AARCH64_MACOS_BYTESIZE="$(echo "$AARCH64_MACOS_JSON" | jq .size -r)" | |
| 63 | export AARCH64_MACOS_SHASUM="$(echo "$AARCH64_MACOS_JSON" | jq .shasum -r)" | |
| 64 | ||
| 65 | X86_64_MACOS_JSON=$(curl --fail "$X86_64_MACOS_JSON_URL" || exit 1) | |
| 66 | export X86_64_MACOS_TARBALL="$(echo "$X86_64_MACOS_JSON" | jq .tarball -r)" | |
| 67 | export X86_64_MACOS_BYTESIZE="$(echo "$X86_64_MACOS_JSON" | jq .size -r)" | |
| 68 | export X86_64_MACOS_SHASUM="$(echo "$X86_64_MACOS_JSON" | jq .shasum -r)" | |
| 69 | ||
| 70 | X86_64_LINUX_JSON=$(curl --fail "$X86_64_LINUX_JSON_URL" || exit 1) | |
| 71 | export X86_64_LINUX_TARBALL="$(echo "$X86_64_LINUX_JSON" | jq .tarball -r)" | |
| 72 | export X86_64_LINUX_BYTESIZE="$(echo "$X86_64_LINUX_JSON" | jq .size -r)" | |
| 73 | export X86_64_LINUX_SHASUM="$(echo "$X86_64_LINUX_JSON" | jq .shasum -r)" | |
| 74 | ||
| 75 | #AARCH64_LINUX_JSON=$(curl --fail "$AARCH64_LINUX_JSON_URL" || exit 1) | |
| 76 | #export AARCH64_LINUX_TARBALL="$(echo "$AARCH64_LINUX_JSON" | jq .tarball -r)" | |
| 77 | #export AARCH64_LINUX_BYTESIZE="$(echo "$AARCH64_LINUX_JSON" | jq .size -r)" | |
| 78 | #export AARCH64_LINUX_SHASUM="$(echo "$AARCH64_LINUX_JSON" | jq .shasum -r)" | |
| 79 | ||
| 80 | X86_64_FREEBSD_JSON=$(curl --fail "$X86_64_FREEBSD_JSON_URL" || exit 1) | |
| 81 | export X86_64_FREEBSD_TARBALL="$(echo "$X86_64_FREEBSD_JSON" | jq .tarball -r)" | |
| 82 | export X86_64_FREEBSD_BYTESIZE="$(echo "$X86_64_FREEBSD_JSON" | jq .size -r)" | |
| 83 | export X86_64_FREEBSD_SHASUM="$(echo "$X86_64_FREEBSD_JSON" | jq .shasum -r)" | |
| 84 | ||
| 85 | #X86_64_NETBSD_JSON=$(curl --fail "$X86_64_NETBSD_JSON_URL" || exit 1) | |
| 86 | #export X86_64_NETBSD_TARBALL="$(echo "$X86_64_NETBSD_JSON" | jq .tarball -r)" | |
| 87 | #export X86_64_NETBSD_BYTESIZE="$(echo "$X86_64_NETBSD_JSON" | jq .size -r)" | |
| 88 | #export X86_64_NETBSD_SHASUM="$(echo "$X86_64_NETBSD_JSON" | jq .shasum -r)" | |
| 89 | ||
| 90 | export MASTER_DATE="$(date +%Y-%m-%d)" | |
| 91 | export MASTER_VERSION="$VERSION" | |
| 92 | ||
| 93 | # Create index.json and update the website repo. | |
| 94 | cd "$SRCTARBALLDIR/ci/srht" | |
| 95 | "$ZIG" run update-download-page.zig | |
| 96 | CIDIR="$(pwd)" | |
| 97 | ||
| 98 | cd "$HOME" | |
| 99 | ||
| 100 | # Update autodocs and langref directly to S3 in order to prevent the | |
| 101 | # www.ziglang.org git repo from growing too big. | |
| 102 | ||
| 103 | # Please do not edit this script to pre-compress the artifacts before they hit | |
| 104 | # S3. This prevents the website from working on browsers that do not support gzip | |
| 105 | # encoding. Cloudfront will automatically compress files if they are less than | |
| 106 | # 9.5 MiB, and the client advertises itself as capable of decompressing. | |
| 107 | # The data.js file is currently 16 MiB. In order to fix this problem, we need to do | |
| 108 | # one of the following things: | |
| 109 | # * Reduce the size of data.js to less than 9.5 MiB. | |
| 110 | # * Figure out how to adjust the Cloudfront settings to increase the max size for | |
| 111 | # auto-compressed objects. | |
| 112 | # * Migrate to fastly. | |
| 113 | $S3CMD put -P --no-mime-magic \ | |
| 114 | --add-header="Cache-Control: max-age=0, must-revalidate" \ | |
| 115 | "$LANGREF" s3://ziglang.org/documentation/master/index.html | |
| 116 | ||
| 117 | $S3CMD put -P --no-mime-magic \ | |
| 118 | --add-header="Cache-Control: max-age=0, must-revalidate" \ | |
| 119 | "$ZIGDIR/doc/std/index.html" s3://ziglang.org/documentation/master/std/index.html | |
| 120 | ||
| 121 | $S3CMD put -P --no-mime-magic \ | |
| 122 | --add-header="Cache-Control: max-age=0, must-revalidate" \ | |
| 123 | "$ZIGDIR/doc/std/main.js" s3://ziglang.org/documentation/master/std/main.js | |
| 124 | ||
| 125 | $S3CMD put -P --no-mime-magic \ | |
| 126 | --add-header="Cache-Control: max-age=0, must-revalidate" \ | |
| 127 | "$ZIGDIR/doc/std/data.js" s3://ziglang.org/documentation/master/std/data.js | |
| 128 | ||
| 129 | $S3CMD put -P --no-mime-magic --recursive \ | |
| 130 | --add-header="Cache-Control: max-age=0, must-revalidate" \ | |
| 131 | -m "text/html" \ | |
| 132 | "$ZIGDIR/doc/std/src/" s3://ziglang.org/documentation/master/std/src/ | |
| 133 | ||
| 134 | $S3CMD put -P --no-mime-magic \ | |
| 135 | --add-header="cache-control: public, max-age=31536000, immutable" \ | |
| 136 | "$HOME/$SRC_TARBALL" s3://ziglang.org/builds/ | |
| 137 | ||
| 138 | git clone --depth 1 git@github.com:ziglang/www.ziglang.org.git | |
| 139 | cd www.ziglang.org | |
| 140 | WWWDIR="$(pwd)" | |
| 141 | # This is the user when pushing to the website repo. | |
| 142 | git config user.email "ziggy@ziglang.org" | |
| 143 | git config user.name "Ziggy" | |
| 144 | ||
| 145 | ||
| 146 | cd "$WWWDIR" | |
| 147 | cp "$CIDIR/out/index.json" data/releases.json | |
| 148 | git add data/releases.json | |
| 149 | git commit -m "CI: update releases" | |
| 150 | git push origin master |
ci/zinc/build_aarch64_macos deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | RELEASE_STAGING="$DRONE_WORKSPACE/_release/staging" | |
| 7 | TARGET="aarch64-macos-none" | |
| 8 | MCPU="apple_a14" | |
| 9 | INSTALL_PREFIX="$DRONE_WORKSPACE/$TARGET" | |
| 10 | SEARCH_PREFIX="/deps/$TARGET" | |
| 11 | ||
| 12 | "$RELEASE_STAGING/bin/zig" build \ | |
| 13 | --prefix "$INSTALL_PREFIX" \ | |
| 14 | --search-prefix "$SEARCH_PREFIX" \ | |
| 15 | -Dstatic-llvm \ | |
| 16 | -Drelease \ | |
| 17 | -Dstrip \ | |
| 18 | -Dtarget="$TARGET" \ | |
| 19 | -Dcpu="$MCPU" \ | |
| 20 | -Denable-stage1 |
ci/zinc/configure_git deleted-10| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | # Make the `zig version` number consistent. | |
| 7 | # This will affect the cmake commands that follow. | |
| 8 | # This is in its own script because git does not support this command | |
| 9 | # being run concurrently with itself. | |
| 10 | git config core.abbrev 9 |
ci/zinc/drone.yml deleted-96| ... | ... | @@ -1,96 +0,0 @@ |
| 1 | --- | |
| 2 | kind: pipeline | |
| 3 | type: docker | |
| 4 | name: x86_64-linux | |
| 5 | platform: | |
| 6 | os: linux | |
| 7 | arch: amd64 | |
| 8 | workspace: | |
| 9 | path: /workspace | |
| 10 | ||
| 11 | steps: | |
| 12 | - name: configure_git | |
| 13 | image: ci/debian-amd64:11.1-12 | |
| 14 | commands: | |
| 15 | - ./ci/zinc/configure_git | |
| 16 | ||
| 17 | - name: test_stage3_debug | |
| 18 | depends_on: | |
| 19 | - configure_git | |
| 20 | image: ci/debian-amd64:11.1-12 | |
| 21 | commands: | |
| 22 | - ./ci/zinc/linux_test_stage3_debug | |
| 23 | ||
| 24 | - name: test_stage3_release | |
| 25 | depends_on: | |
| 26 | - configure_git | |
| 27 | image: ci/debian-amd64:11.1-12 | |
| 28 | commands: | |
| 29 | - ./ci/zinc/linux_test_stage3_release | |
| 30 | ||
| 31 | - name: build_aarch64_macos | |
| 32 | depends_on: | |
| 33 | - test_stage3_release | |
| 34 | image: ci/debian-amd64:11.1-12 | |
| 35 | commands: | |
| 36 | - ./ci/zinc/build_aarch64_macos | |
| 37 | ||
| 38 | - name: test_determinism | |
| 39 | depends_on: | |
| 40 | - test_stage3_release | |
| 41 | image: ci/debian-amd64:11.1-12 | |
| 42 | commands: | |
| 43 | - ./ci/zinc/linux_test_determinism | |
| 44 | ||
| 45 | - name: linux_package | |
| 46 | depends_on: | |
| 47 | - test_stage3_debug | |
| 48 | - test_stage3_release | |
| 49 | - test_determinism | |
| 50 | when: | |
| 51 | branch: | |
| 52 | - master | |
| 53 | event: | |
| 54 | - push | |
| 55 | image: ci/debian-amd64:11.1-12 | |
| 56 | environment: | |
| 57 | AWS_ACCESS_KEY_ID: | |
| 58 | from_secret: AWS_ACCESS_KEY_ID | |
| 59 | AWS_SECRET_ACCESS_KEY: | |
| 60 | from_secret: AWS_SECRET_ACCESS_KEY | |
| 61 | commands: | |
| 62 | - ./ci/zinc/linux_package | |
| 63 | ||
| 64 | - name: macos_package | |
| 65 | depends_on: | |
| 66 | - test_stage3_debug | |
| 67 | - build_aarch64_macos | |
| 68 | when: | |
| 69 | branch: | |
| 70 | - master | |
| 71 | event: | |
| 72 | - push | |
| 73 | image: ci/debian-amd64:11.1-12 | |
| 74 | environment: | |
| 75 | AWS_ACCESS_KEY_ID: | |
| 76 | from_secret: AWS_ACCESS_KEY_ID | |
| 77 | AWS_SECRET_ACCESS_KEY: | |
| 78 | from_secret: AWS_SECRET_ACCESS_KEY | |
| 79 | commands: | |
| 80 | - ./ci/zinc/macos_package | |
| 81 | ||
| 82 | - name: notify_lavahut | |
| 83 | depends_on: | |
| 84 | - macos_package | |
| 85 | - linux_package | |
| 86 | when: | |
| 87 | branch: | |
| 88 | - master | |
| 89 | event: | |
| 90 | - push | |
| 91 | image: ci/debian-amd64:11.1-12 | |
| 92 | environment: | |
| 93 | SRHT_OAUTH_TOKEN: | |
| 94 | from_secret: SRHT_OAUTH_TOKEN | |
| 95 | commands: | |
| 96 | - ./ci/zinc/notify_lavahut |
ci/zinc/linux_package deleted-45| ... | ... | @@ -1,45 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ARCH="$(uname -m)" | |
| 7 | OS="linux" | |
| 8 | RELEASE_STAGING="$DRONE_WORKSPACE/_release/staging" | |
| 9 | VERSION=$($RELEASE_STAGING/bin/zig version) | |
| 10 | BASENAME="zig-$OS-$ARCH-$VERSION" | |
| 11 | TARBALL="$BASENAME.tar.xz" | |
| 12 | ||
| 13 | # This runs concurrently with the macos_package script, so it should not make | |
| 14 | # any changes to the filesystem that will cause problems for the other script. | |
| 15 | ||
| 16 | cp -r "$RELEASE_STAGING" "$BASENAME" | |
| 17 | ||
| 18 | # Remove the unnecessary bin dir in $prefix/bin/zig | |
| 19 | mv $BASENAME/bin/zig $BASENAME/ | |
| 20 | rmdir $BASENAME/bin | |
| 21 | ||
| 22 | # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig | |
| 23 | mv $BASENAME/lib/zig $BASENAME/lib2 | |
| 24 | rmdir $BASENAME/lib | |
| 25 | mv $BASENAME/lib2 $BASENAME/lib | |
| 26 | ||
| 27 | tar cfJ "$TARBALL" "$BASENAME" | |
| 28 | ||
| 29 | SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1) | |
| 30 | BYTESIZE=$(wc -c < $TARBALL) | |
| 31 | ||
| 32 | MANIFEST="manifest-$TARGET.json" | |
| 33 | touch $MANIFEST | |
| 34 | echo "{\"tarball\": \"$TARBALL\"," >>$MANIFEST | |
| 35 | echo "\"shasum\": \"$SHASUM\"," >>$MANIFEST | |
| 36 | echo "\"size\": \"$BYTESIZE\"}" >>$MANIFEST | |
| 37 | ||
| 38 | # Publish artifact. | |
| 39 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | |
| 40 | ||
| 41 | # Publish manifest. | |
| 42 | s3cmd put -P --add-header="cache-control: max-age=0, must-revalidate" "$MANIFEST" "s3://ziglang.org/builds/$ARCH-$OS-$VERSION.json" | |
| 43 | ||
| 44 | # Explicit exit helps show last command duration. | |
| 45 | exit |
ci/zinc/linux_test_determinism deleted-28| ... | ... | @@ -1,28 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | DEPS_LOCAL="/deps/local" | |
| 7 | ZIG_PREFIX="$DRONE_WORKSPACE/_release/staging" | |
| 8 | VERSION=$($ZIG_PREFIX/bin/zig version) | |
| 9 | ||
| 10 | "$ZIG_PREFIX/bin/zig" build \ | |
| 11 | --prefix stage4 \ | |
| 12 | -Dconfig_h="build-release/config.h" \ | |
| 13 | -Denable-llvm \ | |
| 14 | -Denable-stage1 \ | |
| 15 | -Dno-lib \ | |
| 16 | -Drelease \ | |
| 17 | -Dstrip \ | |
| 18 | -Dtarget=x86_64-linux-musl \ | |
| 19 | -Duse-zig-libcxx \ | |
| 20 | -Dversion-string="$VERSION" | |
| 21 | ||
| 22 | # diff returns an error code if the files differ. | |
| 23 | echo "If the following command fails, it means nondeterminism has been" | |
| 24 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 25 | diff "$ZIG_PREFIX/bin/zig" "stage4/bin/zig" | |
| 26 | ||
| 27 | # Explicit exit helps show last command duration. | |
| 28 | exit |
ci/zinc/linux_test_stage3_debug deleted-62| ... | ... | @@ -1,62 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ARCH="$(uname -m)" | |
| 7 | DEPS_LOCAL="/deps/local" | |
| 8 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | |
| 9 | TARGET="${ARCH}-linux-musl" | |
| 10 | MCPU="baseline" | |
| 11 | ||
| 12 | export PATH=$DEPS_LOCAL/bin:$PATH | |
| 13 | ||
| 14 | echo "building stage3-debug with zig version $($OLD_ZIG version)" | |
| 15 | ||
| 16 | # Override the cache directories so that we don't clobber with the release | |
| 17 | # testing script which is running concurrently and in the same directory. | |
| 18 | # Normally we want processes to cooperate, but in this case we want them isolated. | |
| 19 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-cache-local-debug" | |
| 20 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-cache-global-debug" | |
| 21 | ||
| 22 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 23 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 24 | ||
| 25 | mkdir build-debug | |
| 26 | cd build-debug | |
| 27 | cmake .. \ | |
| 28 | -DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \ | |
| 29 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | |
| 30 | -DCMAKE_BUILD_TYPE=Debug \ | |
| 31 | -DZIG_STATIC=ON \ | |
| 32 | -DZIG_USE_LLVM_CONFIG=OFF \ | |
| 33 | -GNinja | |
| 34 | ||
| 35 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 36 | # so that installation and testing do not get affected by them. | |
| 37 | unset CC | |
| 38 | unset CXX | |
| 39 | ||
| 40 | ninja install | |
| 41 | ||
| 42 | echo "Looking for non-conforming code formatting..." | |
| 43 | stage3/bin/zig fmt --check .. \ | |
| 44 | --exclude ../test/cases/ \ | |
| 45 | --exclude ../build-debug \ | |
| 46 | --exclude ../build-release \ | |
| 47 | --exclude "$ZIG_LOCAL_CACHE_DIR" \ | |
| 48 | --exclude "$ZIG_GLOBAL_CACHE_DIR" | |
| 49 | ||
| 50 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | |
| 51 | stage3/bin/zig build -Dtarget=arm-linux-musleabihf | |
| 52 | ||
| 53 | stage3/bin/zig build test \ | |
| 54 | -fqemu \ | |
| 55 | -fwasmtime \ | |
| 56 | -Dstatic-llvm \ | |
| 57 | -Dtarget=native-native-musl \ | |
| 58 | --search-prefix "$DEPS_LOCAL" \ | |
| 59 | --zig-lib-dir "$(pwd)/../lib" | |
| 60 | ||
| 61 | # Explicit exit helps show last command duration. | |
| 62 | exit |
ci/zinc/linux_test_stage3_release deleted-60| ... | ... | @@ -1,60 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ARCH="$(uname -m)" | |
| 7 | DEPS_LOCAL="/deps/local" | |
| 8 | RELEASE_STAGING="$DRONE_WORKSPACE/_release/staging" | |
| 9 | OLD_ZIG="$DEPS_LOCAL/bin/zig" | |
| 10 | TARGET="${ARCH}-linux-musl" | |
| 11 | MCPU="baseline" | |
| 12 | ||
| 13 | export PATH=$DEPS_LOCAL/bin:$PATH | |
| 14 | ||
| 15 | echo "building stage3-release with zig version $($OLD_ZIG version)" | |
| 16 | ||
| 17 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 18 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 19 | ||
| 20 | mkdir build-release | |
| 21 | cd build-release | |
| 22 | cmake .. \ | |
| 23 | -DCMAKE_INSTALL_PREFIX="$RELEASE_STAGING" \ | |
| 24 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | |
| 25 | -DCMAKE_BUILD_TYPE=Release \ | |
| 26 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 27 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 28 | -DZIG_STATIC=ON \ | |
| 29 | -GNinja | |
| 30 | ||
| 31 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 32 | # so that installation and testing do not get affected by them. | |
| 33 | unset CC | |
| 34 | unset CXX | |
| 35 | ||
| 36 | ninja install | |
| 37 | ||
| 38 | "$RELEASE_STAGING/bin/zig" build test docs \ | |
| 39 | -fqemu \ | |
| 40 | -fwasmtime \ | |
| 41 | -Dstatic-llvm \ | |
| 42 | -Dtarget=native-native-musl \ | |
| 43 | --search-prefix "$DEPS_LOCAL" \ | |
| 44 | --zig-lib-dir "$(pwd)/../lib" | |
| 45 | ||
| 46 | # Produce the experimental std lib documentation. | |
| 47 | mkdir -p "$RELEASE_STAGING/doc/std" | |
| 48 | "$RELEASE_STAGING/bin/zig" test ../lib/std/std.zig \ | |
| 49 | -femit-docs=$RELEASE_STAGING/doc/std \ | |
| 50 | -fno-emit-bin \ | |
| 51 | --zig-lib-dir "$(pwd)/../lib" | |
| 52 | ||
| 53 | cp ../LICENSE $RELEASE_STAGING/ | |
| 54 | cp ../zig-cache/langref.html $RELEASE_STAGING/doc/ | |
| 55 | ||
| 56 | # Look for HTML errors. | |
| 57 | tidy --drop-empty-elements no -qe $RELEASE_STAGING/doc/langref.html | |
| 58 | ||
| 59 | # Explicit exit helps show last command duration. | |
| 60 | exit |
ci/zinc/macos_package deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ARCH="aarch64" | |
| 7 | OS=macos | |
| 8 | ZIG_PREFIX="$DRONE_WORKSPACE/_release/staging" | |
| 9 | VERSION=$($ZIG_PREFIX/bin/zig version) | |
| 10 | TARGET="$ARCH-$OS-none" | |
| 11 | INSTALL_PREFIX="$DRONE_WORKSPACE/$TARGET" | |
| 12 | BASENAME="zig-$OS-$ARCH-$VERSION" | |
| 13 | TARBALL="$BASENAME.tar.xz" | |
| 14 | ||
| 15 | # This runs concurrently with the linux_package script, so it should not make | |
| 16 | # any changes to the filesystem that will cause problems for the other script. | |
| 17 | ||
| 18 | # Remove the unnecessary bin dir in $prefix/bin/zig | |
| 19 | mv $INSTALL_PREFIX/bin/zig $INSTALL_PREFIX/ | |
| 20 | rmdir $INSTALL_PREFIX/bin | |
| 21 | ||
| 22 | # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig | |
| 23 | mv $INSTALL_PREFIX/lib/zig $INSTALL_PREFIX/lib2 | |
| 24 | rmdir $INSTALL_PREFIX/lib | |
| 25 | mv $INSTALL_PREFIX/lib2 $INSTALL_PREFIX/lib | |
| 26 | ||
| 27 | cp -r "$ZIG_PREFIX/doc" "$INSTALL_PREFIX/" | |
| 28 | cp "$ZIG_PREFIX/LICENSE" "$INSTALL_PREFIX/" | |
| 29 | ||
| 30 | mv "$INSTALL_PREFIX" "$BASENAME" | |
| 31 | tar cfJ "$TARBALL" "$BASENAME" | |
| 32 | ||
| 33 | SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1) | |
| 34 | BYTESIZE=$(wc -c < $TARBALL) | |
| 35 | ||
| 36 | MANIFEST="manifest-$TARGET.json" | |
| 37 | touch $MANIFEST | |
| 38 | echo "{\"tarball\": \"$TARBALL\"," >>$MANIFEST | |
| 39 | echo "\"shasum\": \"$SHASUM\"," >>$MANIFEST | |
| 40 | echo "\"size\": \"$BYTESIZE\"}" >>$MANIFEST | |
| 41 | ||
| 42 | # Publish artifact. | |
| 43 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | |
| 44 | ||
| 45 | # Publish manifest. | |
| 46 | s3cmd put -P --add-header="cache-control: max-age=0, must-revalidate" "$MANIFEST" "s3://ziglang.org/builds/$ARCH-$OS-$VERSION.json" | |
| 47 | ||
| 48 | # Explicit exit helps show last command duration. | |
| 49 | exit |
ci/zinc/notify_lavahut deleted-9| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set +x # Avoid leaking oauth token. | |
| 4 | set -e | |
| 5 | ||
| 6 | ZIG_PREFIX="$DRONE_WORKSPACE/_release/staging" | |
| 7 | VERSION=$($ZIG_PREFIX/bin/zig version) | |
| 8 | cd $DRONE_WORKSPACE | |
| 9 | ./ci/srht/on_master_success "$VERSION" "$SRHT_OAUTH_TOKEN" |