fix(build): resolve a bare EMCC command name in build-wasm.sh

Third failure uncovered by the restored pipeline. With checkout and the C++
build fixed, CI reached the WASM step and died on `[build-wasm] emcc not found
at emcc`: ci.yml passed `EMCC: emcc`, but the script's existence check
(`[[ ! -x "$EMCC" && ! -f "$EMCC" ]]`) only understands paths, so it looked for
a file literally named "emcc" in the working directory. This has been broken
for as long as the override existed; it was invisible because CI never got past
checkout to run it.

Resolve a bare command name through `command -v` before the check, and drop the
now-redundant EMCC override in ci.yml — setup-emsdk already puts emcc on PATH,
which is what the script's own default looks for.

Verified by invoking it the way CI does: `EMCC=emcc bash scripts/build-wasm.sh`
now builds. Incidentally confirms the new freshness gate is sound — the local
toolchain is the same pinned emcc 3.1.69, and the rebuild reproduced the
committed artifact byte-for-byte.

run-all-tests.sh ALL GREEN.
This commit is contained in:
monkey-w1n5t0n 2026-07-21 12:14:21 +02:00
parent 3552ee46f6
commit aa60fbb466
2 changed files with 10 additions and 5 deletions

View file

@ -70,10 +70,8 @@ jobs:
run: bash scripts/parity-check.sh run: bash scripts/parity-check.sh
- name: Build WASM - name: Build WASM
env: # setup-emsdk puts emcc on PATH; build-wasm.sh picks it up via
# The script defaults to /usr/lib/emscripten/emcc; the runner gets # `command -v emcc`. No EMCC override needed.
# emcc on PATH via setup-emsdk. Override.
EMCC: emcc
run: bash scripts/build-wasm.sh run: bash scripts/build-wasm.sh
- name: Parity check (native vs WASM) - name: Parity check (native vs WASM)

View file

@ -18,9 +18,16 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
OUT="$ROOT/manifold/public" OUT="$ROOT/manifold/public"
SRC="$ROOT/nisps/wasm/bindings.cpp" SRC="$ROOT/nisps/wasm/bindings.cpp"
# EMCC may be a bare command name on PATH (emsdk installs it that way) or an
# absolute path. Resolve the former before the existence check, which otherwise
# looks for a file of that name in the CWD and always fails.
if [[ "$EMCC" != */* ]]; then
EMCC="$(command -v "$EMCC" || echo "$EMCC")"
fi
if [[ ! -x "$EMCC" && ! -f "$EMCC" ]]; then if [[ ! -x "$EMCC" && ! -f "$EMCC" ]]; then
echo "[build-wasm] emcc not found at $EMCC" >&2 echo "[build-wasm] emcc not found at $EMCC" >&2
echo "[build-wasm] set EMCC=/path/to/emcc and retry." >&2 echo "[build-wasm] set EMCC=/path/to/emcc (or put emcc on PATH) and retry." >&2
exit 2 exit 2
fi fi