Skip to content

Commit

Permalink
CI: build from old zig on x86_64-linux debug
Browse files Browse the repository at this point in the history
This is to work around OOM on the CI server. Once #13560 is complete,
we can avoid having to replace the tarballs so often.
  • Loading branch information
andrewrk committed Jan 9, 2023
1 parent 8bbb4a2 commit 5f23b65
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 29 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,6 @@ set(BUILD_ZIG2_ARGS
-lc
--pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}"
--pkg-end
--pkg-begin compiler_rt "${CMAKE_SOURCE_DIR}/lib/compiler_rt.zig"
--pkg-end
)

if("${ZIG_EXECUTABLE}" STREQUAL "")
Expand Down
38 changes: 14 additions & 24 deletions ci/linux/build-x86_64-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ ARCH="$(uname -m)"
DEPS_LOCAL="$HOME/local"
OLD_ZIG="$DEPS_LOCAL/bin/zig"
TARGET="${ARCH}-linux-musl"
MCPU="baseline"

mkdir -p "$DEPS_LOCAL"
cd "$DEPS_LOCAL"

wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz
tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz
OLD_ZIG_VERSION="0.11.0-dev.256+271cc52a1"
wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz
tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz

wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz
tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz
Expand All @@ -29,34 +29,24 @@ export PATH=$DEPS_LOCAL/bin:$PATH
cd "$ZIGDIR"
echo "building stage3-debug with zig version $($OLD_ZIG version)"

export CC="$OLD_ZIG cc -target $TARGET -mcpu=$MCPU"
export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU"

mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \
-DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \
-DCMAKE_BUILD_TYPE=Debug \
-DZIG_STATIC=ON \
-DZIG_USE_LLVM_CONFIG=OFF

# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
# so that installation and testing do not get affected by them.
unset CC
unset CXX

make -j2 install
"$OLD_ZIG" build \
--search-prefix "$DEPS_LOCAL" \
--zig-lib-dir "$(pwd)/../lib" \
-Denable-stage1 \
-Dstatic-llvm \
-Drelease \
-Duse-zig-libcxx \
-Dtarget="$TARGET"

echo "Looking for non-conforming code formatting..."
stage3/bin/zig fmt --check .. \
zig-out/bin/zig fmt --check .. \
--exclude ../test/cases/ \
--exclude ../build

# simultaneously test building self-hosted without LLVM and with 32-bit arm
stage3/bin/zig build -Dtarget=arm-linux-musleabihf
zig-out/bin/zig build -Dtarget=arm-linux-musleabihf

stage3/bin/zig build test \
zig-out/bin/zig build test docs \
-fqemu \
-fwasmtime \
-Dstatic-llvm \
Expand Down
5 changes: 3 additions & 2 deletions ci/linux/build-x86_64-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ MCPU="baseline"
mkdir -p "$DEPS_LOCAL"
cd "$DEPS_LOCAL"

wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz
tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-0.10.0-dev.4560+828735ac0.tar.xz
OLD_ZIG_VERSION="0.11.0-dev.256+271cc52a1"
wget https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz
tar x --strip-components=1 -f zig+llvm+lld+clang-x86_64-linux-musl-$OLD_ZIG_VERSION.tar.xz

wget https://ziglang.org/deps/qemu-linux-x86_64-6.1.0.1.tar.xz
tar x --strip-components=1 -f qemu-linux-x86_64-6.1.0.1.tar.xz
Expand Down
1 change: 0 additions & 1 deletion ci/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Write-Output "Building Zig..."
-Denable-stage1 `
-Dstatic-llvm `
-Drelease `
-Dstrip `
-Duse-zig-libcxx `
-Dtarget="$TARGET"
CheckLastExitCode
Expand Down

0 comments on commit 5f23b65

Please sign in to comment.