authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-14 15:10:05-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-09 14:04:45-07:00
logdb58a45ab66ff49c90fd7fdef0a38af0ea27ae75
treed6afc809dbe12ccaef9fea6c5b8bfdff0efc2b68
parentdc96e47eb3d415d8c9b62805594af39df7cb9ebb

CI: separate aarch64 and x86_64 macos scripts


4 files changed, 115 insertions(+), 67 deletions(-)

.github/workflows/ci.yaml+2-2
......@@ -30,7 +30,7 @@ jobs:
3030 uses: actions/checkout@v3
3131
3232 - name: Run Build Script
33 run: ./ci/macos/build.sh
33 run: ./ci/macos/build-x86_64.sh
3434 macos-aarch64:
3535 runs-on: [self-hosted, macOS, aarch64]
3636 env:
......@@ -40,7 +40,7 @@ jobs:
4040 uses: actions/checkout@v3
4141
4242 - name: Run Build Script
43 run: ./ci/macos/build.sh
43 run: ./ci/macos/build-aarch64.sh
4444 # windows:
4545 # runs-on: [self-hosted, Windows, x64]
4646 # env:
ci/macos/build-aarch64.sh created+53
......@@ -0,0 +1,53 @@
1#!/bin/sh
2
3set -x
4set -e
5
6echo "Running on Version:" $MACOS_VERSION
7
8# Script assumes the presence of the following:
9# s3cmd
10
11ZIGDIR="$(pwd)"
12TARGET="$ARCH-macos-none"
13MCPU="baseline"
14CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0"
15PREFIX="$HOME/$CACHE_BASENAME"
16ZIG="$PREFIX/bin/zig"
17
18cd $ZIGDIR
19
20# Make the `zig version` number consistent.
21# This will affect the cmake command below.
22git config core.abbrev 9
23git fetch --unshallow || true
24git fetch --tags
25
26mkdir build
27cd 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
41stage3-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.
49mkdir -p "stage3-release/doc/std"
50stage3-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
3set -x
4set -e
5
6echo "Running on Version:" $MACOS_VERSION
7
8# Script assumes the presence of the following:
9# s3cmd
10
11ZIGDIR="$(pwd)"
12TARGET="$ARCH-macos-none"
13MCPU="baseline"
14CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0"
15PREFIX="$HOME/$CACHE_BASENAME"
16JOBS="-j2"
17
18rm -rf $PREFIX
19cd $HOME
20
21curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
22tar xf "$CACHE_BASENAME.tar.xz"
23
24ZIG="$PREFIX/bin/zig"
25
26cd $ZIGDIR
27
28# Make the `zig version` number consistent.
29# This will affect the cmake command below.
30git config core.abbrev 9
31git fetch --unshallow || true
32git fetch --tags
33
34mkdir build
35cd 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
46make $JOBS install
47
48stage3-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.
56mkdir -p "stage3-release/doc/std"
57stage3-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
3set -x
4set -e
5
6echo "Running on Version:" $MACOS_VERSION
7
8# Script assumes the presence of the following:
9# s3cmd
10
11ZIGDIR="$(pwd)"
12TARGET="$ARCH-macos-none"
13MCPU="baseline"
14CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0"
15PREFIX="$HOME/$CACHE_BASENAME"
16JOBS="-j2"
17
18rm -rf $PREFIX
19cd $HOME
20
21curl -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
22tar xf "$CACHE_BASENAME.tar.xz"
23
24ZIG="$PREFIX/bin/zig"
25export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
26export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
27
28cd $ZIGDIR
29
30# Make the `zig version` number consistent.
31# This will affect the cmake command below.
32git config core.abbrev 9
33git fetch --unshallow || true
34git fetch --tags
35
36mkdir build
37cd build
38cmake .. \
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.
48unset CC
49unset CXX
50
51make $JOBS install
52
53stage3-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.
61mkdir -p "stage3-release/doc/std"
62stage3-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