1
hermetic_cc_toolchain/ci/launcher
Motiejus Jakštys cb46744cb8 launcher: use -mcpu=baseline
This log message has been seen in a Github Actions worker:

      running <...>/c++ failed: signal: illegal instruction (core dumped)

I conclude that the launcher was compiled on a newer CPU than used on
the worker at the time.

Reported-by: mp@edgeless.systems

Fixes #22
2023-04-24 12:38:23 +03:00

33 lines
863 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2023 Uber Technologies, Inc.
# Licensed under the MIT License
set -xeuo pipefail
echo "--- which zig"
ZIG=${ZIG:-$(tools/bazel run "$@" --run_under=echo @zig_sdk//:zig)}
echo "--- compile launcher.zig for various architectures"
for target in \
aarch64-linux-gnu.2.19 \
aarch64-macos-none \
x86_64-linux-gnu.2.19 \
x86_64-macos-none \
x86_64-windows-gnu
do
if [[ $target == aarch64-macos-none ]]; then
mcpu=apple_a14
else
mcpu=baseline
fi
$ZIG build-exe -fno-emit-bin -target $target -mcpu=$mcpu toolchain/launcher.zig
done
echo "--- zig fmt --check toolchain/launcher.zig"
$ZIG fmt --check toolchain/launcher.zig
echo "--- zig test toolchain/launcher.zig"
# until hermetic_cc_toolchain gets a zig toolchain, run launcher's unit tests here.
$ZIG test toolchain/launcher.zig