| author | |
| committer | |
| log | 37402e4d1710d62a756e9feb4a99923a8743cb55 |
| tree | 4d73776add3481880416b342c51d31228c99237c |
| parent | bbd0775d777324636f7427496b5d9a3137db93d1 |
4 files changed, 115 insertions(+), 67 deletions(-)
.github/workflows/ci.yaml+2-2| ... | ... | @@ -30,7 +30,7 @@ jobs: |
| 30 | 30 | uses: actions/checkout@v3 |
| 31 | 31 | |
| 32 | 32 | - name: Run Build Script |
| 33 | run: ./ci/macos/build.sh | |
| 33 | run: ./ci/macos/build-x86_64.sh | |
| 34 | 34 | macos-aarch64: |
| 35 | 35 | runs-on: [self-hosted, macOS, aarch64] |
| 36 | 36 | env: |
| ... | ... | @@ -40,7 +40,7 @@ jobs: |
| 40 | 40 | uses: actions/checkout@v3 |
| 41 | 41 | |
| 42 | 42 | - name: Run Build Script |
| 43 | run: ./ci/macos/build.sh | |
| 43 | run: ./ci/macos/build-aarch64.sh | |
| 44 | 44 | # windows: |
| 45 | 45 | # runs-on: [self-hosted, Windows, x64] |
| 46 | 46 | # env: |
ci/macos/build-aarch64.sh created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | echo "Running on Version:" $MACOS_VERSION | |
| 7 | ||
| 8 | # Script assumes the presence of the following: | |
| 9 | # s3cmd | |
| 10 | ||
| 11 | ZIGDIR="$(pwd)" | |
| 12 | TARGET="$ARCH-macos-none" | |
| 13 | MCPU="baseline" | |
| 14 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0" | |
| 15 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 16 | ZIG="$PREFIX/bin/zig" | |
| 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 | mkdir build | |
| 27 | cd build | |
| 28 | $HOME/local/bin/cmake .. \ | |
| 29 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | |
| 30 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 31 | -DCMAKE_BUILD_TYPE=Release \ | |
| 32 | -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ | |
| 33 | -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ | |
| 34 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 35 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 36 | -DZIG_STATIC=ON \ | |
| 37 | -GNinja | |
| 38 | ||
| 39 | $HOME/local/bin/ninja install | |
| 40 | ||
| 41 | stage3-release/bin/zig build test docs \ | |
| 42 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 43 | -Denable-macos-sdk \ | |
| 44 | -Dstatic-llvm \ | |
| 45 | -Dskip-non-native \ | |
| 46 | --search-prefix "$PREFIX" | |
| 47 | ||
| 48 | # Produce the experimental std lib documentation. | |
| 49 | mkdir -p "stage3-release/doc/std" | |
| 50 | stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 51 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 52 | -femit-docs="$(pwd)/stage3-release/doc/std" \ | |
| 53 | -fno-emit-bin |
ci/macos/build-x86_64.sh created+60| ... | ... | @@ -0,0 +1,60 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | echo "Running on Version:" $MACOS_VERSION | |
| 7 | ||
| 8 | # Script assumes the presence of the following: | |
| 9 | # s3cmd | |
| 10 | ||
| 11 | ZIGDIR="$(pwd)" | |
| 12 | TARGET="$ARCH-macos-none" | |
| 13 | MCPU="baseline" | |
| 14 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0" | |
| 15 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 16 | JOBS="-j2" | |
| 17 | ||
| 18 | rm -rf $PREFIX | |
| 19 | cd $HOME | |
| 20 | ||
| 21 | curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 22 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 23 | ||
| 24 | ZIG="$PREFIX/bin/zig" | |
| 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 | $HOME/local/bin/cmake .. \ | |
| 37 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | |
| 38 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 39 | -DCMAKE_BUILD_TYPE=Release \ | |
| 40 | -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ | |
| 41 | -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ | |
| 42 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 43 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 44 | -DZIG_STATIC=ON | |
| 45 | ||
| 46 | make $JOBS install | |
| 47 | ||
| 48 | stage3-release/bin/zig build test docs \ | |
| 49 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 50 | -Denable-macos-sdk \ | |
| 51 | -Dstatic-llvm \ | |
| 52 | -Dskip-non-native \ | |
| 53 | --search-prefix "$PREFIX" | |
| 54 | ||
| 55 | # Produce the experimental std lib documentation. | |
| 56 | mkdir -p "stage3-release/doc/std" | |
| 57 | stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 58 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 59 | -femit-docs="$(pwd)/stage3-release/doc/std" \ | |
| 60 | -fno-emit-bin |
ci/macos/build.sh deleted-65| ... | ... | @@ -1,65 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | echo "Running on Version:" $MACOS_VERSION | |
| 7 | ||
| 8 | # Script assumes the presence of the following: | |
| 9 | # s3cmd | |
| 10 | ||
| 11 | ZIGDIR="$(pwd)" | |
| 12 | TARGET="$ARCH-macos-none" | |
| 13 | MCPU="baseline" | |
| 14 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0" | |
| 15 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 16 | JOBS="-j2" | |
| 17 | ||
| 18 | rm -rf $PREFIX | |
| 19 | cd $HOME | |
| 20 | ||
| 21 | curl -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 22 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 23 | ||
| 24 | ZIG="$PREFIX/bin/zig" | |
| 25 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | |
| 26 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | |
| 27 | ||
| 28 | cd $ZIGDIR | |
| 29 | ||
| 30 | # Make the `zig version` number consistent. | |
| 31 | # This will affect the cmake command below. | |
| 32 | git config core.abbrev 9 | |
| 33 | git fetch --unshallow || true | |
| 34 | git fetch --tags | |
| 35 | ||
| 36 | mkdir build | |
| 37 | cd build | |
| 38 | cmake .. \ | |
| 39 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | |
| 40 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | |
| 41 | -DCMAKE_BUILD_TYPE=Release \ | |
| 42 | -DZIG_TARGET_TRIPLE="$TARGET" \ | |
| 43 | -DZIG_TARGET_MCPU="$MCPU" \ | |
| 44 | -DZIG_STATIC=ON | |
| 45 | ||
| 46 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 47 | # so that installation and testing do not get affected by them. | |
| 48 | unset CC | |
| 49 | unset CXX | |
| 50 | ||
| 51 | make $JOBS install | |
| 52 | ||
| 53 | stage3-release/bin/zig build test docs \ | |
| 54 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 55 | -Denable-macos-sdk \ | |
| 56 | -Dstatic-llvm \ | |
| 57 | -Dskip-non-native \ | |
| 58 | --search-prefix "$PREFIX" | |
| 59 | ||
| 60 | # Produce the experimental std lib documentation. | |
| 61 | mkdir -p "stage3-release/doc/std" | |
| 62 | stage3-release/bin/zig test "$(pwd)/../lib/std/std.zig" \ | |
| 63 | --zig-lib-dir "$(pwd)/../lib" \ | |
| 64 | -femit-docs="$(pwd)/stage3-release/doc/std" \ | |
| 65 | -fno-emit-bin | |
| \ No newline at end of file |