API image is Go-only (compose target api). Python rebuild is profile index. bin/cgo/zig pins Zig 0.14.1, liblbug, and tokenizers.
24 lines
595 B
Bash
Executable File
24 lines
595 B
Bash
Executable File
#!/bin/sh
|
|
# bin/cgo/zc++ — CGO CXX. Zig, not g++.
|
|
set -eu
|
|
ROOT="$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)"
|
|
case "$(uname -m)" in
|
|
x86_64|amd64) TARGET=x86_64-linux-gnu ;;
|
|
aarch64|arm64) TARGET=aarch64-linux-gnu ;;
|
|
*)
|
|
echo "zc++: unsupported arch $(uname -m)" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
if [ -n "${ZIG:-}" ] && [ -x "$ZIG" ]; then
|
|
:
|
|
elif [ -x "$ROOT/var/zig/zig" ]; then
|
|
ZIG="$ROOT/var/zig/zig"
|
|
elif command -v zig >/dev/null 2>&1; then
|
|
ZIG="$(command -v zig)"
|
|
else
|
|
echo "zc++: zig missing; run bin/cgo/zig first" >&2
|
|
exit 127
|
|
fi
|
|
exec "$ZIG" c++ -target "$TARGET" "$@"
|