authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-10 12:17:32+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-10 13:55:48+02:00
log603242fa8604bf237b48c2dfd70c1a43f0ce8def
tree44363a1d4fe20862357bca27d29d5678de449678
parent9c03b39d1ebb52a94f1e6ee6f92a19f54a0ee528

Use zig-bootstrapped x86_64 macos compiler in CI


1 files changed, 9 insertions(+), 10 deletions(-)

ci/azure/macos_script+9-10
...@@ -7,21 +7,21 @@ brew update && brew install s3cmd...@@ -7,21 +7,21 @@ brew update && brew install s3cmd
77
8ZIGDIR="$(pwd)"8ZIGDIR="$(pwd)"
9ARCH="x86_64"9ARCH="x86_64"
10CACHE_BASENAME="zig+llvm+lld+clang-$ARCH-macos-gnu-0.8.0-dev.1939+5a3ea9bec"10TARGET="$ARCH-macos-gnu"
11CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.8.0-dev.2168+2d1196773"
11PREFIX="$HOME/$CACHE_BASENAME"12PREFIX="$HOME/$CACHE_BASENAME"
13MCPU="baseline"
12JOBS="-j2"14JOBS="-j2"
1315
14rm -rf $PREFIX16rm -rf $PREFIX
15cd $HOME17cd $HOME
18
16wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"19wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
17tar xf "$CACHE_BASENAME.tar.xz"20tar xf "$CACHE_BASENAME.tar.xz"
1821
19ZIG="$PREFIX/bin/zig"22ZIG="$PREFIX/bin/zig"
20NATIVE_LIBC_TXT="$HOME/native_libc.txt"23export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
21$ZIG libc >"$NATIVE_LIBC_TXT"24export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
22export ZIG_LIBC="$NATIVE_LIBC_TXT"
23export CC="$ZIG cc"
24export CXX="$ZIG c++"
2525
26cd $ZIGDIR26cd $ZIGDIR
2727
...@@ -37,22 +37,21 @@ cmake .. \...@@ -37,22 +37,21 @@ cmake .. \
37 -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \37 -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \
38 -DCMAKE_PREFIX_PATH="$PREFIX" \38 -DCMAKE_PREFIX_PATH="$PREFIX" \
39 -DCMAKE_BUILD_TYPE=Release \39 -DCMAKE_BUILD_TYPE=Release \
40 -DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \40 -DZIG_TARGET_TRIPLE="$TARGET" \
41 -DZIG_TARGET_MCPU="baseline" \41 -DZIG_TARGET_MCPU="$MCPU" \
42 -DZIG_STATIC=ON42 -DZIG_STATIC=ON
4343
44# Now cmake will use zig as the C/C++ compiler. We reset the environment variables44# 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.45# so that installation and testing do not get affected by them.
46unset CC46unset CC
47unset CXX47unset CXX
48unset ZIG_LIBC
4948
50make $JOBS install49make $JOBS install
5150
52# Here we rebuild zig but this time using the Zig binary we just now produced to51# Here we rebuild zig but this time using the Zig binary we just now produced to
53# build zig1.o rather than relying on the one built with stage0. See52# build zig1.o rather than relying on the one built with stage0. See
54# https://github.com/ziglang/zig/issues/6830 for more details.53# https://github.com/ziglang/zig/issues/6830 for more details.
55cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"54cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
56make $JOBS install55make $JOBS install
5756
58for step in test-toolchain test-std docs; do57for step in test-toolchain test-std docs; do