| author | |
| committer | |
| log | 532cfb65e018c216972cb50a82c7a0379934c8cc |
| tree | 5e4e011efd5b6554a3a3bf19ef6398895b2a1cab |
| parent | aee53e2ffdd8c68a9b505f8aaad318bfbb459965 |
* CMakeLists: pass `-Dstrip` for release zig builds
* pass -target and -mcpu to zig1. works around llvm on freebsd
incorrectly detecting "freestanding" instead of "freebsd" for the
native OS.
* ci.ziglang.org is now responsible for creating aarch64-macos tarballs
rather than Azure.27 files changed, 417 insertions(+), 445 deletions(-)
CMakeLists.txt+11-7| ... | @@ -959,9 +959,11 @@ else() | ... | @@ -959,9 +959,11 @@ else() |
| 959 | set(ZIG2_OBJECT "${CMAKE_BINARY_DIR}/zig2.o") | 959 | set(ZIG2_OBJECT "${CMAKE_BINARY_DIR}/zig2.o") |
| 960 | endif() | 960 | endif() |
| 961 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") | 961 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") |
| 962 | set(ZIG_RELEASE_ARG "") | 962 | set(ZIG_RELEASE_ARG "") |
| 963 | elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") | ||
| 964 | set(ZIG_RELEASE_ARG -Drelease) | ||
| 963 | else() | 965 | else() |
| 964 | set(ZIG_RELEASE_ARG -Drelease) | 966 | set(ZIG_RELEASE_ARG -Drelease -Dstrip) |
| 965 | endif() | 967 | endif() |
| 966 | if(ZIG_SKIP_INSTALL_LIB_FILES) | 968 | if(ZIG_SKIP_INSTALL_LIB_FILES) |
| 967 | set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files") | 969 | set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files") |
| ... | @@ -985,7 +987,9 @@ set(BUILD_ZIG2_ARGS | ... | @@ -985,7 +987,9 @@ set(BUILD_ZIG2_ARGS |
| 985 | --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib" | 987 | --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib" |
| 986 | "-femit-bin=${ZIG2_OBJECT}" | 988 | "-femit-bin=${ZIG2_OBJECT}" |
| 987 | -fcompiler-rt | 989 | -fcompiler-rt |
| 988 | "${ZIG_SINGLE_THREADED_ARG}" | 990 | ${ZIG_SINGLE_THREADED_ARG} |
| 991 | -target "${ZIG_TARGET_TRIPLE}" | ||
| 992 | -mcpu "${ZIG_TARGET_MCPU}" | ||
| 989 | -lc | 993 | -lc |
| 990 | --pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}" | 994 | --pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}" |
| 991 | --pkg-end | 995 | --pkg-end |
| ... | @@ -1042,10 +1046,10 @@ set(ZIG_INSTALL_ARGS "build" | ... | @@ -1042,10 +1046,10 @@ set(ZIG_INSTALL_ARGS "build" |
| 1042 | "-Dconfig_h=${ZIG_CONFIG_H_OUT}" | 1046 | "-Dconfig_h=${ZIG_CONFIG_H_OUT}" |
| 1043 | "-Denable-llvm" | 1047 | "-Denable-llvm" |
| 1044 | "-Denable-stage1" | 1048 | "-Denable-stage1" |
| 1045 | "${ZIG_RELEASE_ARG}" | 1049 | ${ZIG_RELEASE_ARG} |
| 1046 | "${ZIG_STATIC_ARG}" | 1050 | ${ZIG_STATIC_ARG} |
| 1047 | "${ZIG_SKIP_INSTALL_LIB_FILES_ARG}" | 1051 | ${ZIG_SKIP_INSTALL_LIB_FILES_ARG} |
| 1048 | "${ZIG_SINGLE_THREADED_ARG}" | 1052 | ${ZIG_SINGLE_THREADED_ARG} |
| 1049 | "-Dtarget=${ZIG_TARGET_TRIPLE}" | 1053 | "-Dtarget=${ZIG_TARGET_TRIPLE}" |
| 1050 | "-Dcpu=${ZIG_TARGET_MCPU}" | 1054 | "-Dcpu=${ZIG_TARGET_MCPU}" |
| 1051 | ) | 1055 | ) |
ci/azure/macos_arm64_script deleted-132| ... | @@ -1,132 +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 | |||
| 10 | HOST_ARCH="x86_64" | ||
| 11 | HOST_TARGET="$HOST_ARCH-macos-none" | ||
| 12 | HOST_MCPU="baseline" | ||
| 13 | HOST_CACHE_BASENAME="zig+llvm+lld+clang-$HOST_TARGET-0.10.0-dev.2931+bdf3fa12f" | ||
| 14 | HOST_PREFIX="$HOME/$HOST_CACHE_BASENAME" | ||
| 15 | |||
| 16 | ARCH="aarch64" | ||
| 17 | TARGET="$ARCH-macos-none" | ||
| 18 | MCPU="apple_a14" | ||
| 19 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.2931+bdf3fa12f" | ||
| 20 | PREFIX="$HOME/$CACHE_BASENAME" | ||
| 21 | |||
| 22 | JOBS="-j2" | ||
| 23 | |||
| 24 | rm -rf $HOST_PREFIX $PREFIX | ||
| 25 | cd $HOME | ||
| 26 | |||
| 27 | wget -nv "https://ziglang.org/deps/$HOST_CACHE_BASENAME.tar.xz" | ||
| 28 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | ||
| 29 | tar xf "$HOST_CACHE_BASENAME.tar.xz" | ||
| 30 | tar xf "$CACHE_BASENAME.tar.xz" | ||
| 31 | |||
| 32 | cd $ZIGDIR | ||
| 33 | |||
| 34 | # Make the `zig version` number consistent. | ||
| 35 | # This will affect the cmake command below. | ||
| 36 | git config core.abbrev 9 | ||
| 37 | git fetch --unshallow || true | ||
| 38 | git fetch --tags | ||
| 39 | |||
| 40 | # Build host zig compiler in debug so that we can get the | ||
| 41 | # current version when packaging | ||
| 42 | |||
| 43 | ZIG="$HOST_PREFIX/bin/zig" | ||
| 44 | |||
| 45 | export CC="$ZIG cc -target $HOST_TARGET -mcpu=$HOST_MCPU" | ||
| 46 | export CXX="$ZIG c++ -target $HOST_TARGET -mcpu=$HOST_MCPU" | ||
| 47 | |||
| 48 | mkdir build.host | ||
| 49 | cd build.host | ||
| 50 | cmake .. \ | ||
| 51 | -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \ | ||
| 52 | -DCMAKE_PREFIX_PATH="$HOST_PREFIX" \ | ||
| 53 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 54 | -DZIG_TARGET_TRIPLE="$HOST_TARGET" \ | ||
| 55 | -DZIG_TARGET_MCPU="$HOST_MCPU" \ | ||
| 56 | -DZIG_STATIC=ON \ | ||
| 57 | -DZIG_OMIT_STAGE2=ON | ||
| 58 | |||
| 59 | unset CC | ||
| 60 | unset CXX | ||
| 61 | |||
| 62 | make $JOBS install | ||
| 63 | |||
| 64 | # Build zig compiler cross-compiled for arm64 | ||
| 65 | cd $ZIGDIR | ||
| 66 | |||
| 67 | ZIG="$ZIGDIR/build.host/release/bin/zig" | ||
| 68 | |||
| 69 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 70 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 71 | |||
| 72 | mkdir build | ||
| 73 | cd build | ||
| 74 | cmake .. \ | ||
| 75 | -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \ | ||
| 76 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | ||
| 77 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 78 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 79 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 80 | -DZIG_EXECUTABLE="$ZIG" \ | ||
| 81 | -DZIG_STATIC=ON | ||
| 82 | |||
| 83 | unset CC | ||
| 84 | unset CXX | ||
| 85 | |||
| 86 | make $JOBS install | ||
| 87 | |||
| 88 | if [ "${BUILD_REASON}" != "PullRequest" ]; then | ||
| 89 | mv ../LICENSE release/ | ||
| 90 | |||
| 91 | # We do not run test suite but still need langref. | ||
| 92 | mkdir -p release/docs | ||
| 93 | $ZIG run ../doc/docgen.zig -- $ZIG ../doc/langref.html.in release/docs/langref.html | ||
| 94 | |||
| 95 | # Produce the experimental std lib documentation. | ||
| 96 | mkdir -p release/docs/std | ||
| 97 | $ZIG test ../lib/std/std.zig \ | ||
| 98 | --zig-lib-dir ../lib \ | ||
| 99 | -femit-docs=release/docs/std \ | ||
| 100 | -fno-emit-bin | ||
| 101 | |||
| 102 | mv release/bin/zig release/ | ||
| 103 | rmdir release/bin | ||
| 104 | |||
| 105 | VERSION=$(../build.host/release/bin/zig version) | ||
| 106 | DIRNAME="zig-macos-$ARCH-$VERSION" | ||
| 107 | TARBALL="$DIRNAME.tar.xz" | ||
| 108 | mv release "$DIRNAME" | ||
| 109 | tar cfJ "$TARBALL" "$DIRNAME" | ||
| 110 | |||
| 111 | mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg" | ||
| 112 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | ||
| 113 | |||
| 114 | SHASUM=$(shasum -a 256 $TARBALL | cut '-d ' -f1) | ||
| 115 | BYTESIZE=$(wc -c < $TARBALL) | ||
| 116 | |||
| 117 | JSONFILE="macos-$GITBRANCH.json" | ||
| 118 | touch $JSONFILE | ||
| 119 | echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE | ||
| 120 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE | ||
| 121 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE | ||
| 122 | |||
| 123 | s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE" | ||
| 124 | s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/$ARCH-macos-$VERSION.json" | ||
| 125 | |||
| 126 | # `set -x` causes these variables to be mangled. | ||
| 127 | # See https://developercommunity.visualstudio.com/content/problem/375679/pipeline-variable-incorrectly-inserts-single-quote.html | ||
| 128 | set +x | ||
| 129 | echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL" | ||
| 130 | echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM" | ||
| 131 | echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE" | ||
| 132 | fi | ||
ci/azure/macos_script+1-9| ... | @@ -34,6 +34,7 @@ git fetch --tags | ... | @@ -34,6 +34,7 @@ git fetch --tags |
| 34 | mkdir build | 34 | mkdir build |
| 35 | cd build | 35 | cd build |
| 36 | cmake .. \ | 36 | cmake .. \ |
| 37 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | ||
| 37 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | 38 | -DCMAKE_PREFIX_PATH="$PREFIX" \ |
| 38 | -DCMAKE_BUILD_TYPE=Release \ | 39 | -DCMAKE_BUILD_TYPE=Release \ |
| 39 | -DZIG_TARGET_TRIPLE="$TARGET" \ | 40 | -DZIG_TARGET_TRIPLE="$TARGET" \ |
| ... | @@ -47,15 +48,6 @@ unset CXX | ... | @@ -47,15 +48,6 @@ unset CXX |
| 47 | 48 | ||
| 48 | make $JOBS install | 49 | make $JOBS install |
| 49 | 50 | ||
| 50 | stage2/bin/zig build \ | ||
| 51 | --prefix stage3-release \ | ||
| 52 | --search-prefix "$PREFIX" \ | ||
| 53 | -Dstatic-llvm \ | ||
| 54 | -Drelease \ | ||
| 55 | -Dstrip \ | ||
| 56 | -Dtarget="$TARGET" \ | ||
| 57 | -Denable-stage1 | ||
| 58 | |||
| 59 | stage3-release/bin/zig build test docs \ | 51 | stage3-release/bin/zig build test docs \ |
| 60 | -Denable-macos-sdk \ | 52 | -Denable-macos-sdk \ |
| 61 | -Dstatic-llvm \ | 53 | -Dstatic-llvm \ |
ci/azure/pipelines.yml-12| ... | @@ -10,17 +10,6 @@ jobs: | ... | @@ -10,17 +10,6 @@ jobs: |
| 10 | - script: ci/azure/macos_script | 10 | - script: ci/azure/macos_script |
| 11 | name: main | 11 | name: main |
| 12 | displayName: 'Build and test' | 12 | displayName: 'Build and test' |
| 13 | - job: BuildMacOS_arm64 | ||
| 14 | pool: | ||
| 15 | vmImage: 'macOS-11' | ||
| 16 | timeoutInMinutes: 180 | ||
| 17 | steps: | ||
| 18 | - task: DownloadSecureFile@1 | ||
| 19 | inputs: | ||
| 20 | secureFile: s3cfg | ||
| 21 | - script: ci/azure/macos_arm64_script | ||
| 22 | name: main | ||
| 23 | displayName: 'Build' | ||
| 24 | - job: BuildWindows | 13 | - job: BuildWindows |
| 25 | timeoutInMinutes: 360 | 14 | timeoutInMinutes: 360 |
| 26 | pool: | 15 | pool: |
| ... | @@ -155,7 +144,6 @@ jobs: | ... | @@ -155,7 +144,6 @@ jobs: |
| 155 | - job: OnMasterSuccess | 144 | - job: OnMasterSuccess |
| 156 | dependsOn: | 145 | dependsOn: |
| 157 | - BuildMacOS | 146 | - BuildMacOS |
| 158 | - BuildMacOS_arm64 | ||
| 159 | - BuildWindows | 147 | - BuildWindows |
| 160 | condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) | 148 | condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
| 161 | strategy: | 149 | strategy: |
ci/drone/linux_script_base deleted-22| ... | @@ -1,22 +0,0 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # https://docs.drone.io/pipeline/docker/syntax/workspace/ | ||
| 4 | # | ||
| 5 | # Drone automatically creates a temporary volume, known as your workspace, | ||
| 6 | # where it clones your repository. The workspace is the current working | ||
| 7 | # directory for each step in your pipeline. | ||
| 8 | # | ||
| 9 | # Because the workspace is a volume, filesystem changes are persisted between | ||
| 10 | # pipeline steps. In other words, individual steps can communicate and share | ||
| 11 | # state using the filesystem. | ||
| 12 | # | ||
| 13 | # Workspace volumes are ephemeral. They are created when the pipeline starts | ||
| 14 | # and destroyed after the pipeline completes. | ||
| 15 | |||
| 16 | set -x | ||
| 17 | set -e | ||
| 18 | |||
| 19 | TRIPLEARCH="$(uname -m)" | ||
| 20 | DISTDIR="$DRONE_WORKSPACE/dist" | ||
| 21 | |||
| 22 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
ci/drone/linux_script_build+10-19| ... | @@ -1,17 +1,16 @@ | ... | @@ -1,17 +1,16 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | # Probe CPU/brand details. | 6 | ARCH="$(uname -m)" |
| 6 | # TODO: `lscpu` is changing package names in EDGE to `util-linux-misc` | 7 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 7 | apk update | 8 | |
| 8 | apk add util-linux | 9 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" |
| 9 | echo "lscpu:" | ||
| 10 | lscpu | sed 's,^, : ,' | ||
| 11 | 10 | ||
| 12 | PREFIX="/deps/local" | 11 | PREFIX="/deps/local" |
| 13 | ZIG="$PREFIX/bin/zig" | 12 | ZIG="$PREFIX/bin/zig" |
| 14 | TARGET="$TRIPLEARCH-linux-musl" | 13 | TARGET="$ARCH-linux-musl" |
| 15 | MCPU="baseline" | 14 | MCPU="baseline" |
| 16 | 15 | ||
| 17 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | 16 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" |
| ... | @@ -30,8 +29,8 @@ cat <<'ENDFILE' >$PREFIX/bin/ranlib | ... | @@ -30,8 +29,8 @@ cat <<'ENDFILE' >$PREFIX/bin/ranlib |
| 30 | /deps/local/bin/zig ranlib $@ | 29 | /deps/local/bin/zig ranlib $@ |
| 31 | ENDFILE | 30 | ENDFILE |
| 32 | 31 | ||
| 33 | chmod +x $PREFIX/bin/ar | 32 | chmod +x "$PREFIX/bin/ar" |
| 34 | chmod +x $PREFIX/bin/ranlib | 33 | chmod +x "$PREFIX/bin/ranlib" |
| 35 | 34 | ||
| 36 | # Make the `zig version` number consistent. | 35 | # Make the `zig version` number consistent. |
| 37 | # This will affect the cmake command below. | 36 | # This will affect the cmake command below. |
| ... | @@ -43,6 +42,7 @@ mkdir build | ... | @@ -43,6 +42,7 @@ mkdir build |
| 43 | cd build | 42 | cd build |
| 44 | cmake .. \ | 43 | cmake .. \ |
| 45 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | 44 | -DCMAKE_PREFIX_PATH="$PREFIX" \ |
| 45 | -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \ | ||
| 46 | -DCMAKE_BUILD_TYPE=Release \ | 46 | -DCMAKE_BUILD_TYPE=Release \ |
| 47 | -DCMAKE_AR="$PREFIX/bin/ar" \ | 47 | -DCMAKE_AR="$PREFIX/bin/ar" \ |
| 48 | -DCMAKE_RANLIB="$PREFIX/bin/ranlib" \ | 48 | -DCMAKE_RANLIB="$PREFIX/bin/ranlib" \ |
| ... | @@ -56,12 +56,3 @@ cmake .. \ | ... | @@ -56,12 +56,3 @@ cmake .. \ |
| 56 | unset CC | 56 | unset CC |
| 57 | unset CXX | 57 | unset CXX |
| 58 | samu install | 58 | samu install |
| 59 | |||
| 60 | stage2/bin/zig build \ | ||
| 61 | --prefix "$DISTDIR" \ | ||
| 62 | --search-prefix "$PREFIX" \ | ||
| 63 | -Dstatic-llvm \ | ||
| 64 | -Drelease \ | ||
| 65 | -Dstrip \ | ||
| 66 | -Dtarget="$TARGET" \ | ||
| 67 | -Denable-stage1 |
ci/drone/linux_script_finalize+15-9| ... | @@ -1,6 +1,12 @@ | ... | @@ -1,6 +1,12 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 5 | |||
| 6 | ARCH="$(uname -m)" | ||
| 7 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" | ||
| 8 | |||
| 9 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
| 4 | 10 | ||
| 5 | if [ -n "$DRONE_PULL_REQUEST" ]; then | 11 | if [ -n "$DRONE_PULL_REQUEST" ]; then |
| 6 | exit 0 | 12 | exit 0 |
| ... | @@ -12,16 +18,16 @@ pip3 install s3cmd | ... | @@ -12,16 +18,16 @@ pip3 install s3cmd |
| 12 | 18 | ||
| 13 | cd build | 19 | cd build |
| 14 | 20 | ||
| 15 | mv ../LICENSE "$DISTDIR/" | 21 | mv ../LICENSE "$INSTALL_PREFIX/" |
| 16 | mv ../zig-cache/langref.html "$DISTDIR/" | 22 | mv ../zig-cache/langref.html "$INSTALL_PREFIX/" |
| 17 | mv "$DISTDIR/bin/zig" "$DISTDIR/" | 23 | mv "$INSTALL_PREFIX/bin/zig" "$INSTALL_PREFIX/" |
| 18 | rmdir "$DISTDIR/bin" | 24 | rmdir "$INSTALL_PREFIX/bin" |
| 19 | 25 | ||
| 20 | GITBRANCH="$DRONE_BRANCH" | 26 | GITBRANCH="$DRONE_BRANCH" |
| 21 | VERSION="$("$DISTDIR/zig" version)" | 27 | VERSION="$("$INSTALL_PREFIX/zig" version)" |
| 22 | DIRNAME="zig-linux-$TRIPLEARCH-$VERSION" | 28 | DIRNAME="zig-linux-$ARCH-$VERSION" |
| 23 | TARBALL="$DIRNAME.tar.xz" | 29 | TARBALL="$DIRNAME.tar.xz" |
| 24 | mv "$DISTDIR" "$DIRNAME" | 30 | mv "$INSTALL_PREFIX" "$DIRNAME" |
| 25 | tar cfJ "$TARBALL" "$DIRNAME" | 31 | tar cfJ "$TARBALL" "$DIRNAME" |
| 26 | 32 | ||
| 27 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | 33 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ |
| ... | @@ -35,7 +41,7 @@ echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE | ... | @@ -35,7 +41,7 @@ echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE |
| 35 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE | 41 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE |
| 36 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE | 42 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE |
| 37 | 43 | ||
| 38 | s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/$TRIPLEARCH-linux-$VERSION.json" | 44 | s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/$ARCH-linux-$VERSION.json" |
| 39 | if [ "$GITBRANCH" = "master" ]; then | 45 | if [ "$GITBRANCH" = "master" ]; then |
| 40 | # avoid leaking oauth token | 46 | # avoid leaking oauth token |
| 41 | set +x | 47 | set +x |
ci/drone/test_linux_behavior+10-5| ... | @@ -1,8 +1,13 @@ | ... | @@ -1,8 +1,13 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | ./build/zig build test-behavior -Dskip-non-native | 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 6 | ./build/zig build test-compiler-rt -Dskip-non-native | 7 | ZIG="$INSTALL_PREFIX/bin/zig" |
| 7 | ./build/zig build test-fmt | 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" |
| 8 | ./build/zig build docs | 9 | |
| 10 | $ZIG build test-behavior -Dskip-non-native | ||
| 11 | $ZIG build test-compiler-rt -Dskip-non-native | ||
| 12 | $ZIG build test-fmt | ||
| 13 | $ZIG build docs |
ci/drone/test_linux_cases+8-3| ... | @@ -1,6 +1,11 @@ | ... | @@ -1,6 +1,11 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | ./build/zig build -Dskip-non-native # test building self-hosted without LLVM | 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 6 | ./build/zig build -Dskip-non-native test-cases | 7 | ZIG="$INSTALL_PREFIX/bin/zig" |
| 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
| 9 | |||
| 10 | $ZIG build -Dskip-non-native # test building self-hosted without LLVM | ||
| 11 | $ZIG build -Dskip-non-native test-cases |
ci/drone/test_linux_misc+13-8| ... | @@ -1,11 +1,16 @@ | ... | @@ -1,11 +1,16 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | ./build/zig build test-universal-libc -Dskip-non-native | 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 6 | ./build/zig build test-compare-output -Dskip-non-native | 7 | ZIG="$INSTALL_PREFIX/bin/zig" |
| 7 | ./build/zig build test-standalone -Dskip-non-native -Dskip-release-safe | 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" |
| 8 | ./build/zig build test-stack-traces -Dskip-non-native | 9 | |
| 9 | ./build/zig build test-cli -Dskip-non-native | 10 | $ZIG build test-universal-libc -Dskip-non-native |
| 10 | ./build/zig build test-asm-link -Dskip-non-native | 11 | $ZIG build test-compare-output -Dskip-non-native |
| 11 | ./build/zig build test-translate-c -Dskip-non-native | 12 | $ZIG build test-standalone -Dskip-non-native -Dskip-release-safe |
| 13 | $ZIG build test-stack-traces -Dskip-non-native | ||
| 14 | $ZIG build test-cli -Dskip-non-native | ||
| 15 | $ZIG build test-asm-link -Dskip-non-native | ||
| 16 | $ZIG build test-translate-c -Dskip-non-native |
ci/drone/test_linux_std_Debug+7-2| ... | @@ -1,5 +1,10 @@ | ... | @@ -1,5 +1,10 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | ./build/zig build test-std -Dskip-release-safe -Dskip-release-fast -Dskip-release-small -Dskip-non-native | 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 7 | ZIG="$INSTALL_PREFIX/bin/zig" | ||
| 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
| 9 | |||
| 10 | $ZIG build test-std -Dskip-release-safe -Dskip-release-fast -Dskip-release-small -Dskip-non-native |
ci/drone/test_linux_std_ReleaseFast+7-2| ... | @@ -1,5 +1,10 @@ | ... | @@ -1,5 +1,10 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | ./build/zig build test-std -Dskip-debug -Dskip-release-safe -Dskip-release-small -Dskip-non-native -Dskip-single-threaded | 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 7 | ZIG="$INSTALL_PREFIX/bin/zig" | ||
| 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
| 9 | |||
| 10 | $ZIG build test-std -Dskip-debug -Dskip-release-safe -Dskip-release-small -Dskip-non-native -Dskip-single-threaded |
ci/drone/test_linux_std_ReleaseSafe+7-2| ... | @@ -1,5 +1,10 @@ | ... | @@ -1,5 +1,10 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 4 | 5 | ||
| 5 | ./build/zig build test-std -Dskip-debug -Dskip-release-fast -Dskip-release-small -Dskip-non-native -Dskip-single-threaded | 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" |
| 7 | ZIG="$INSTALL_PREFIX/bin/zig" | ||
| 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
| 9 | |||
| 10 | $ZIG build test-std -Dskip-debug -Dskip-release-fast -Dskip-release-small -Dskip-non-native -Dskip-single-threaded |
ci/drone/test_linux_std_ReleaseSmall+9-4| ... | @@ -1,11 +1,16 @@ | ... | @@ -1,11 +1,16 @@ |
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | . ./ci/drone/linux_script_base | 3 | set -x |
| 4 | set -e | ||
| 5 | |||
| 6 | INSTALL_PREFIX="$DRONE_WORKSPACE/stage3-release" | ||
| 7 | ZIG="$INSTALL_PREFIX/bin/zig" | ||
| 8 | export ZIG_GLOBAL_CACHE_DIR="$DRONE_WORKSPACE/zig-cache" | ||
| 4 | 9 | ||
| 5 | # Empirically, this takes about 55 minutes on the CI, and is the bottleneck | 10 | # Empirically, this takes about 55 minutes on the CI, and is the bottleneck |
| 6 | # causing timeouts. So this is disabled in favor of running a smaller set | 11 | # causing timeouts. So this is disabled in favor of running a smaller set |
| 7 | # of ReleaseSmall std lib tests. | 12 | # of ReleaseSmall std lib tests. |
| 8 | # ./build/zig build test-std -Dskip-debug -Dskip-release-safe -Dskip-release-fast -Dskip-non-native | 13 | # $ZIG build test-std -Dskip-debug -Dskip-release-safe -Dskip-release-fast -Dskip-non-native |
| 9 | 14 | ||
| 10 | ./build/zig test lib/std/std.zig -OReleaseSmall | 15 | $ZIG test lib/std/std.zig -OReleaseSmall |
| 11 | ./build/zig test lib/std/std.zig -OReleaseSmall -lc | 16 | $ZIG test lib/std/std.zig -OReleaseSmall -lc |
ci/srht/freebsd_script+17-17| ... | @@ -31,6 +31,8 @@ export TERM=dumb | ... | @@ -31,6 +31,8 @@ export TERM=dumb |
| 31 | 31 | ||
| 32 | mkdir build | 32 | mkdir build |
| 33 | cd build | 33 | cd build |
| 34 | |||
| 35 | |||
| 34 | cmake .. \ | 36 | cmake .. \ |
| 35 | -DCMAKE_BUILD_TYPE=Release \ | 37 | -DCMAKE_BUILD_TYPE=Release \ |
| 36 | -DCMAKE_PREFIX_PATH=$PREFIX \ | 38 | -DCMAKE_PREFIX_PATH=$PREFIX \ |
| ... | @@ -38,40 +40,38 @@ cmake .. \ | ... | @@ -38,40 +40,38 @@ cmake .. \ |
| 38 | -DZIG_TARGET_MCPU="$MCPU" \ | 40 | -DZIG_TARGET_MCPU="$MCPU" \ |
| 39 | -DZIG_STATIC=ON \ | 41 | -DZIG_STATIC=ON \ |
| 40 | -GNinja | 42 | -GNinja |
| 41 | samu install | ||
| 42 | 43 | ||
| 43 | # TODO: eliminate this workaround. Without this, zig does not end up passing | 44 | # TODO: eliminate this workaround. Without this, zig does not end up passing |
| 44 | # -isystem /usr/include when building libc++, resulting in #include <sys/endian.h> | 45 | # -isystem /usr/include when building libc++, resulting in #include <sys/endian.h> |
| 45 | # "file not found" errors. | 46 | # "file not found" errors. |
| 46 | stage2/bin/zig libc >libc.txt | 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" | ||
| 47 | 54 | ||
| 48 | ZIG_LIBC=libc.txt stage2/bin/zig build \ | 55 | ZIG_LIBC="$ZIG_LIBC_TXT" samu install |
| 49 | --prefix stage3-release \ | ||
| 50 | --search-prefix "$PREFIX" \ | ||
| 51 | -Dstatic-llvm \ | ||
| 52 | -Drelease \ | ||
| 53 | -Dstrip \ | ||
| 54 | -Dtarget="$TARGET" \ | ||
| 55 | -Denable-stage1 | ||
| 56 | 56 | ||
| 57 | # Here we skip some tests to save time. | 57 | # Here we skip some tests to save time. |
| 58 | stage3-release/bin/zig build test docs \ | 58 | stage3/bin/zig build test docs \ |
| 59 | -Dstatic-llvm \ | 59 | -Dstatic-llvm \ |
| 60 | --search-prefix "$PREFIX" \ | 60 | --search-prefix "$PREFIX" \ |
| 61 | -Dskip-stage1 \ | 61 | -Dskip-stage1 \ |
| 62 | -Dskip-non-native | 62 | -Dskip-non-native |
| 63 | 63 | ||
| 64 | if [ -f ~/.s3cfg ]; then | 64 | if [ -f ~/.s3cfg ]; then |
| 65 | mv ../LICENSE stage3-release/ | 65 | mv ../LICENSE stage3/ |
| 66 | mv ../zig-cache/langref.html stage3-release/ | 66 | mv ../zig-cache/langref.html stage3/ |
| 67 | mv stage3-release/bin/zig stage3-release/ | 67 | mv stage3/bin/zig stage3/ |
| 68 | rmdir stage3-release/bin | 68 | rmdir stage3/bin |
| 69 | 69 | ||
| 70 | GITBRANCH=$(basename $GITHUB_REF) | 70 | GITBRANCH=$(basename $GITHUB_REF) |
| 71 | VERSION=$(stage3-release/zig version) | 71 | VERSION=$(stage3/zig version) |
| 72 | DIRNAME="zig-freebsd-x86_64-$VERSION" | 72 | DIRNAME="zig-freebsd-x86_64-$VERSION" |
| 73 | TARBALL="$DIRNAME.tar.xz" | 73 | TARBALL="$DIRNAME.tar.xz" |
| 74 | mv stage3-release "$DIRNAME" | 74 | mv stage3 "$DIRNAME" |
| 75 | tar cfJ "$TARBALL" "$DIRNAME" | 75 | tar cfJ "$TARBALL" "$DIRNAME" |
| 76 | 76 | ||
| 77 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | 77 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ |
ci/zinc/build_aarch64_macos created+20| ... | @@ -0,0 +1,20 @@ | ||
| 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 | -Dmcpu="$MCPU" \ | ||
| 20 | -Denable-stage1 | ||
ci/zinc/configure_git created+10| ... | @@ -0,0 +1,10 @@ | ||
| 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+50-7| ... | @@ -9,17 +9,33 @@ workspace: | ... | @@ -9,17 +9,33 @@ workspace: |
| 9 | path: /workspace | 9 | path: /workspace |
| 10 | 10 | ||
| 11 | steps: | 11 | steps: |
| 12 | - name: configure_git | ||
| 13 | image: ci/debian-amd64:11.1-9 | ||
| 14 | commands: | ||
| 15 | - ./ci/zinc/configure_git | ||
| 16 | |||
| 12 | - name: test_stage3_debug | 17 | - name: test_stage3_debug |
| 13 | image: ci/debian-amd64:11.1-8 | 18 | depends_on: |
| 19 | - configure_git | ||
| 20 | image: ci/debian-amd64:11.1-9 | ||
| 14 | commands: | 21 | commands: |
| 15 | - ./ci/zinc/linux_test_stage3_debug.sh | 22 | - ./ci/zinc/linux_test_stage3_debug |
| 16 | 23 | ||
| 17 | - name: test_stage3_release | 24 | - name: test_stage3_release |
| 18 | image: ci/debian-amd64:11.1-8 | 25 | depends_on: |
| 26 | - configure_git | ||
| 27 | image: ci/debian-amd64:11.1-9 | ||
| 19 | commands: | 28 | commands: |
| 20 | - ./ci/zinc/linux_test_stage3_release.sh | 29 | - ./ci/zinc/linux_test_stage3_release |
| 21 | 30 | ||
| 22 | - name: package | 31 | - name: build_aarch64_macos |
| 32 | depends_on: | ||
| 33 | - test_stage3_release | ||
| 34 | image: ci/debian-amd64:11.1-9 | ||
| 35 | commands: | ||
| 36 | - ./ci/zinc/build_aarch64_macos | ||
| 37 | |||
| 38 | - name: linux_package | ||
| 23 | depends_on: | 39 | depends_on: |
| 24 | - test_stage3_debug | 40 | - test_stage3_debug |
| 25 | - test_stage3_release | 41 | - test_stage3_release |
| ... | @@ -28,13 +44,40 @@ steps: | ... | @@ -28,13 +44,40 @@ steps: |
| 28 | - master | 44 | - master |
| 29 | event: | 45 | event: |
| 30 | - push | 46 | - push |
| 31 | image: ci/debian-amd64:11.1-8 | 47 | image: ci/debian-amd64:11.1-9 |
| 48 | environment: | ||
| 49 | AWS_ACCESS_KEY_ID: | ||
| 50 | from_secret: AWS_ACCESS_KEY_ID | ||
| 51 | AWS_SECRET_ACCESS_KEY: | ||
| 52 | from_secret: AWS_SECRET_ACCESS_KEY | ||
| 53 | commands: | ||
| 54 | - ./ci/zinc/linux_package | ||
| 55 | |||
| 56 | - name: macos_package | ||
| 57 | depends_on: | ||
| 58 | - test_stage3_debug | ||
| 59 | - build_aarch64_macos | ||
| 60 | when: | ||
| 61 | branch: | ||
| 62 | - master | ||
| 63 | event: | ||
| 64 | - push | ||
| 65 | image: ci/debian-amd64:11.1-9 | ||
| 32 | environment: | 66 | environment: |
| 33 | AWS_ACCESS_KEY_ID: | 67 | AWS_ACCESS_KEY_ID: |
| 34 | from_secret: AWS_ACCESS_KEY_ID | 68 | from_secret: AWS_ACCESS_KEY_ID |
| 35 | AWS_SECRET_ACCESS_KEY: | 69 | AWS_SECRET_ACCESS_KEY: |
| 36 | from_secret: AWS_SECRET_ACCESS_KEY | 70 | from_secret: AWS_SECRET_ACCESS_KEY |
| 71 | commands: | ||
| 72 | - ./ci/zinc/macos_package | ||
| 73 | |||
| 74 | - name: notify_lavahut | ||
| 75 | depends_on: | ||
| 76 | - macos_package | ||
| 77 | - linux_package | ||
| 78 | image: ci/debian-amd64:11.1-9 | ||
| 79 | environment: | ||
| 37 | SRHT_OAUTH_TOKEN: | 80 | SRHT_OAUTH_TOKEN: |
| 38 | from_secret: SRHT_OAUTH_TOKEN | 81 | from_secret: SRHT_OAUTH_TOKEN |
| 39 | commands: | 82 | commands: |
| 40 | - ./ci/zinc/linux_package.sh | 83 | - ./ci/zinc/notify_lavahut |
ci/zinc/linux_base.sh deleted-31| ... | @@ -1,31 +0,0 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # https://docs.drone.io/pipeline/docker/syntax/workspace/ | ||
| 4 | # | ||
| 5 | # Drone automatically creates a temporary volume, known as your workspace, | ||
| 6 | # where it clones your repository. The workspace is the current working | ||
| 7 | # directory for each step in your pipeline. | ||
| 8 | # | ||
| 9 | # Because the workspace is a volume, filesystem changes are persisted between | ||
| 10 | # pipeline steps. In other words, individual steps can communicate and share | ||
| 11 | # state using the filesystem. | ||
| 12 | # | ||
| 13 | # Workspace volumes are ephemeral. They are created when the pipeline starts | ||
| 14 | # and destroyed after the pipeline completes. | ||
| 15 | |||
| 16 | set -x | ||
| 17 | set -e | ||
| 18 | |||
| 19 | ARCH="$(uname -m)" | ||
| 20 | |||
| 21 | DEPS_LOCAL="/deps/local" | ||
| 22 | WORKSPACE="$DRONE_WORKSPACE" | ||
| 23 | |||
| 24 | DEBUG_STAGING="$WORKSPACE/_debug/staging" | ||
| 25 | RELEASE_STAGING="$WORKSPACE/_release/staging" | ||
| 26 | |||
| 27 | export PATH=$DEPS_LOCAL/bin:$PATH | ||
| 28 | |||
| 29 | # Make the `zig version` number consistent. | ||
| 30 | # This will affect the cmake commands that follow. | ||
| 31 | git config core.abbrev 9 | ||
ci/zinc/linux_package created+45| ... | @@ -0,0 +1,45 @@ | ||
| 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.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_package.sh deleted-45| ... | @@ -1,45 +0,0 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | . ./ci/zinc/linux_base.sh | ||
| 4 | |||
| 5 | # Remove the unnecessary bin dir in $prefix/bin/zig | ||
| 6 | mv $RELEASE_STAGING/bin/zig $RELEASE_STAGING/ | ||
| 7 | rmdir $RELEASE_STAGING/bin | ||
| 8 | |||
| 9 | # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig | ||
| 10 | mv $RELEASE_STAGING/lib/zig $RELEASE_STAGING/lib2 | ||
| 11 | rmdir $RELEASE_STAGING/lib | ||
| 12 | mv $RELEASE_STAGING/lib2 $RELEASE_STAGING/lib | ||
| 13 | |||
| 14 | VERSION=$($RELEASE_STAGING/zig version) | ||
| 15 | BASENAME="zig-linux-$ARCH-$VERSION" | ||
| 16 | TARBALL="$BASENAME.tar.xz" | ||
| 17 | mv "$RELEASE_STAGING" "$BASENAME" | ||
| 18 | tar cfJ "$TARBALL" "$BASENAME" | ||
| 19 | ls -l "$TARBALL" | ||
| 20 | |||
| 21 | SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1) | ||
| 22 | BYTESIZE=$(wc -c < $TARBALL) | ||
| 23 | |||
| 24 | MANIFEST="manifest.json" | ||
| 25 | touch $MANIFEST | ||
| 26 | echo "{\"tarball\": \"$TARBALL\"," >>$MANIFEST | ||
| 27 | echo "\"shasum\": \"$SHASUM\"," >>$MANIFEST | ||
| 28 | echo "\"size\": \"$BYTESIZE\"}" >>$MANIFEST | ||
| 29 | |||
| 30 | # Publish artifact. | ||
| 31 | s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | ||
| 32 | |||
| 33 | # Publish manifest. | ||
| 34 | s3cmd put -P --add-header="cache-control: max-age=0, must-revalidate" "$MANIFEST" "s3://ziglang.org/builds/$ARCH-linux-$VERSION.json" | ||
| 35 | |||
| 36 | # Avoid leaking oauth token. | ||
| 37 | set +x | ||
| 38 | |||
| 39 | cd $WORKSPACE | ||
| 40 | ./ci/srht/on_master_success "$VERSION" "$SRHT_OAUTH_TOKEN" | ||
| 41 | |||
| 42 | set -x | ||
| 43 | |||
| 44 | # Explicit exit helps show last command duration. | ||
| 45 | exit | ||
ci/zinc/linux_test_stage3_debug created+61| ... | @@ -0,0 +1,61 @@ | ||
| 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 | |||
| 60 | # Explicit exit helps show last command duration. | ||
| 61 | exit | ||
ci/zinc/linux_test_stage3_debug.sh deleted-56| ... | @@ -1,56 +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 | echo "building stage3-debug with zig version $($OLD_ZIG version)" | ||
| 10 | |||
| 11 | # Override the cache directories so that we don't clobber with the release | ||
| 12 | # testing script which is running concurrently and in the same directory. | ||
| 13 | # Normally we want processes to cooperate, but in this case we want them isolated. | ||
| 14 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-cache-local-debug" | ||
| 15 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-cache-global-debug" | ||
| 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-debug | ||
| 21 | cd build-debug | ||
| 22 | cmake .. \ | ||
| 23 | -DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \ | ||
| 24 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | ||
| 25 | -DCMAKE_BUILD_TYPE=Debug \ | ||
| 26 | -DZIG_STATIC=ON \ | ||
| 27 | -DZIG_USE_LLVM_CONFIG=OFF \ | ||
| 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 | echo "Looking for non-conforming code formatting..." | ||
| 38 | stage3/bin/zig fmt --check .. \ | ||
| 39 | --exclude ../test/cases/ \ | ||
| 40 | --exclude ../build-debug \ | ||
| 41 | --exclude ../build-release \ | ||
| 42 | --exclude "$ZIG_LOCAL_CACHE_DIR" \ | ||
| 43 | --exclude "$ZIG_GLOBAL_CACHE_DIR" | ||
| 44 | |||
| 45 | # simultaneously test building self-hosted without LLVM and with 32-bit arm | ||
| 46 | stage3/bin/zig build -Dtarget=arm-linux-musleabihf | ||
| 47 | |||
| 48 | stage3/bin/zig build test \ | ||
| 49 | -fqemu \ | ||
| 50 | -fwasmtime \ | ||
| 51 | -Dstatic-llvm \ | ||
| 52 | -Dtarget=native-native-musl \ | ||
| 53 | --search-prefix "$DEPS_LOCAL" | ||
| 54 | |||
| 55 | # Explicit exit helps show last command duration. | ||
| 56 | exit | ||
ci/zinc/linux_test_stage3_release created+58| ... | @@ -0,0 +1,58 @@ | ||
| 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 | |||
| 45 | # Produce the experimental std lib documentation. | ||
| 46 | mkdir -p "$RELEASE_STAGING/docs/std" | ||
| 47 | "$RELEASE_STAGING/bin/zig" test ../lib/std/std.zig \ | ||
| 48 | -femit-docs=$RELEASE_STAGING/docs/std \ | ||
| 49 | -fno-emit-bin | ||
| 50 | |||
| 51 | cp ../LICENSE $RELEASE_STAGING/ | ||
| 52 | cp ../zig-cache/langref.html $RELEASE_STAGING/docs/ | ||
| 53 | |||
| 54 | # Look for HTML errors. | ||
| 55 | tidy --drop-empty-elements no -qe $RELEASE_STAGING/docs/langref.html | ||
| 56 | |||
| 57 | # Explicit exit helps show last command duration. | ||
| 58 | exit | ||
ci/zinc/linux_test_stage3_release.sh deleted-53| ... | @@ -1,53 +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 | echo "building stage3-release with zig version $($OLD_ZIG version)" | ||
| 10 | |||
| 11 | export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 12 | export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 13 | |||
| 14 | mkdir build-release | ||
| 15 | cd build-release | ||
| 16 | cmake .. \ | ||
| 17 | -DCMAKE_INSTALL_PREFIX="$RELEASE_STAGING" \ | ||
| 18 | -DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \ | ||
| 19 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 20 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 21 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 22 | -DZIG_STATIC=ON \ | ||
| 23 | -GNinja | ||
| 24 | |||
| 25 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | ||
| 26 | # so that installation and testing do not get affected by them. | ||
| 27 | unset CC | ||
| 28 | unset CXX | ||
| 29 | |||
| 30 | ninja install | ||
| 31 | |||
| 32 | "$RELEASE_STAGING/bin/zig" build test docs \ | ||
| 33 | -fqemu \ | ||
| 34 | -fwasmtime \ | ||
| 35 | -Dstatic-llvm \ | ||
| 36 | -Dtarget=native-native-musl \ | ||
| 37 | --search-prefix "$DEPS_LOCAL" | ||
| 38 | |||
| 39 | # Produce the experimental std lib documentation. | ||
| 40 | mkdir -p "$RELEASE_STAGING/docs/std" | ||
| 41 | "$RELEASE_STAGING/bin/zig" test ../lib/std/std.zig \ | ||
| 42 | --zig-lib-dir lib \ | ||
| 43 | -femit-docs=$RELEASE_STAGING/docs/std \ | ||
| 44 | -fno-emit-bin | ||
| 45 | |||
| 46 | cp ../LICENSE $RELEASE_STAGING/ | ||
| 47 | cp ../zig-cache/langref.html $RELEASE_STAGING/docs/ | ||
| 48 | |||
| 49 | # Look for HTML errors. | ||
| 50 | tidy --drop-empty-elements no -qe $RELEASE_STAGING/docs/langref.html | ||
| 51 | |||
| 52 | # Explicit exit helps show last command duration. | ||
| 53 | exit | ||
ci/zinc/macos_package created+49| ... | @@ -0,0 +1,49 @@ | ||
| 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/docs" "$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.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 created+9| ... | @@ -0,0 +1,9 @@ | ||
| 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" | ||