From aa60fbb466ad6c959bd0b458f5f4bb86667d3516 Mon Sep 17 00:00:00 2001 From: monkey-w1n5t0n Date: Tue, 21 Jul 2026 12:14:21 +0200 Subject: [PATCH] fix(build): resolve a bare EMCC command name in build-wasm.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/ci.yml | 6 ++---- scripts/build-wasm.sh | 9 ++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87fcd86..0cd6248 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,10 +70,8 @@ jobs: run: bash scripts/parity-check.sh - name: Build WASM - env: - # The script defaults to /usr/lib/emscripten/emcc; the runner gets - # emcc on PATH via setup-emsdk. Override. - EMCC: emcc + # setup-emsdk puts emcc on PATH; build-wasm.sh picks it up via + # `command -v emcc`. No EMCC override needed. run: bash scripts/build-wasm.sh - name: Parity check (native vs WASM) diff --git a/scripts/build-wasm.sh b/scripts/build-wasm.sh index 89e2239..65f2c0a 100755 --- a/scripts/build-wasm.sh +++ b/scripts/build-wasm.sh @@ -18,9 +18,16 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)" OUT="$ROOT/manifold/public" 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 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 fi