just build no longer builds tcc: use $TCC, an already-built vendored tcc, or tcc on PATH
CI / test (push) Failing after 35s
CI / test (push) Failing after 35s
scripts/tcc/tcc resolves the compiler (and errors with how to get one if none exists); tcc-build stays as an optional recipe. bench no longer depends on it either. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1bbdf58372
commit
92d2b29889
3 files changed
+24
-9
No files matched your search
@@ -5,7 +5,7 @@
|
||||
# incr rebuild after touching one source file (compositor/shell/shell.mbt, then lib/ui/ui.mbt)
|
||||
# Runs on a throwaway copy of the sources with its own target dir, so it never touches your
|
||||
# _build/ or the files other people are editing. The tcc configs use the repo's vendored tinycc
|
||||
# (run `just tcc-build` first; its own one-time build is not part of these numbers).
|
||||
# (any tcc scripts/tcc/tcc can find; see that script).
|
||||
#
|
||||
# scripts/bench-build.sh [runs=3] ["tcc cc cc-release"]
|
||||
# tcc debug build, compiled and linked with the vendored tinycc (what `just build` does)
|
||||
@@ -17,7 +17,7 @@ export PATH="$HOME/.moon/bin:$PATH"
|
||||
runs="${1:-3}"
|
||||
configs="${2:-tcc cc}"
|
||||
command -v moon >/dev/null || { echo "error: moon not found" >&2; exit 1; }
|
||||
[ -x "$ROOT/_build/tcc/bin/tcc" ] || [ "$configs" = "cc" ] || { echo "error: run 'just tcc-build' first" >&2; exit 1; }
|
||||
case " $configs " in *" tcc "*) "$ROOT/scripts/tcc/tcc" --which >/dev/null || exit 1 ;; esac
|
||||
|
||||
work="$(mktemp -d)"
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
|
||||
+17
-3
@@ -1,12 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# moon's C compiler/linker driver for debug builds: the vendored tinycc
|
||||
# (third_party/tinycc, built by `just tcc` into _build/tcc).
|
||||
# moon's C compiler/linker driver for debug builds. It never builds tcc; it uses one that exists:
|
||||
# 1. $TCC, if set
|
||||
# 2. the vendored tinycc, if already built (`just tcc-build` puts it in _build/tcc)
|
||||
# 3. `tcc` on PATH (e.g. from `pixi install`, see pixi.toml)
|
||||
# scripts/tcc/tcc --which prints the tcc it would use (exit 1 if none)
|
||||
# moon adds -DMOONBIT_NATIVE_NO_SYS_HEADER whenever the compiler is tcc; that
|
||||
# mode compiles the system parts of the runtime out (it expects to be JIT-ed
|
||||
# inside moon), so a standalone executable would not link. Drop it.
|
||||
set -euo pipefail
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
tcc="$root/_build/tcc/bin/tcc"
|
||||
if [ -n "${TCC:-}" ]; then
|
||||
tcc="$TCC"
|
||||
elif [ -x "$root/_build/tcc/bin/tcc" ]; then
|
||||
tcc="$root/_build/tcc/bin/tcc"
|
||||
elif tcc="$(command -v tcc)"; then
|
||||
:
|
||||
else
|
||||
echo "error: no tcc found. Install one (pixi install, or your package manager), set TCC=/path/to/tcc," >&2
|
||||
echo " or build the vendored one with: just tcc-build" >&2
|
||||
exit 127
|
||||
fi
|
||||
if [ "${1:-}" = "--which" ]; then echo "$tcc"; exit 0; fi
|
||||
args=()
|
||||
for a in "$@"; do
|
||||
[ "$a" = "-DMOONBIT_NATIVE_NO_SYS_HEADER" ] || args+=("$a")
|
||||
|
||||
Reference in new issue
Block a user