subagent transcript
session 18e25685 · workflow wf_23df5b1c
delegated task
You are an adversarial verifier for a FreeCAD-wasm code review. A reviewer claims: SEVERITY: medium CATEGORY: deps-script-bugs FILE: /opt/toolchains/r
▸ Magik
You are an adversarial verifier for a FreeCAD-wasm code review. A reviewer claims:
SEVERITY: medium
CATEGORY: deps-script-bugs
FILE: /opt/toolchains/rebuild-deps-jseh.sh
SUMMARY: rebuild-deps-jseh.sh emits the wrong/ambiguous success tag and has an ICU cross-build invocation its sibling script explicitly documents as broken.
DETAIL/EVIDENCE: rebuild-deps-jseh.sh:82 echoes `DEPS-WASMEH-OK` — identical to rebuild-deps-wasmeh.sh:87 — so any orchestrator gating on that string cannot distinguish a JS-EH deps build from a wasm-EH deps build (the two produce link-incompatible objects). Its header comment (lines 3-6) is copy-pasted from the wasm-EH script and wrongly states '-fwasm-exceptions here produces new-EH objects' while EH="-fexceptions" (line 10). Worse, its ICU step (line 75) uses `--with-cross-build=$TC/src/icu/source` and builds NO native ICU first, which is exactly the mistake rebuild-deps-wasmeh.sh:72-73 documents ('--with-cross-build must point to a built native tree, NOT the source dir') and fixes by building icu-native. A clean jseh run (no pre-existing native ICU tools) will therefore fail or misbuild ICU; the installed icu-wasm likely came from a different/earlier invocation, not this script as written.
RECOMMENDATION: Give jseh a distinct tag (e.g. DEPS-JSEH-OK), fix the header comment, and port the icu-native two-stage build from the wasmeh script into jseh (or point --with-cross-build at a real native tree).
Independently verify by reading the actual file(s) and running git/grep as needed (repo at /home/magik6k/lcad-wasm/freecad-port/FreeCAD, toolchain at /opt/toolchains, deploy at /home/magik6k/lcad-wasm/freecad-port/deploy-gui). Default to REFUTED if you cannot confirm the evidence. Adjust severity to what the evidence actually supports.
Fable
thinking
I should look at the actual files to understand what's happening.
Fable
⚙ Bash {"command": "cat -n /opt/toolchains/rebuild-deps-jseh.sh", "description": "Read jseh script"}
Fable
⚙ Bash {"command": "cat -n /opt/toolchains/rebuild-deps-wasmeh.sh", "description": "Read wasmeh script"}
Fable
thinking
I'm verifying the inconsistencies in the code. The first claim checks out—line 82 in jseh outputs the same confirmation message as line 87 in wasmeh. For the second issue, the header comment on lines 3-6 claims that `-fwasm-exceptions` produces new exception handling objects, but the actual variable is set to `-fexceptions` instead, which is a contradiction.
Looking at the ICU build step, jseh skips building native ICU first while wasmeh properly documents this mistake and builds it beforehand on lines 74-77. The two exception flags are fundamentally incompatible—`-fexceptions` uses JavaScript-based exceptions while `-fwasm-exceptions` uses WebAssembly exception handling, so they have diffe …
Fable
⚙ Bash {"command": "grep -rn \"DEPS-WASMEH-OK\\|DEPS-JSEH-OK\\|DEPS-.*-OK\\|rebuild-deps-jseh\\|rebuild-deps-wasmeh\" /opt/toolchains /home/magik6k/lcad-wasm 2>/dev/null | grep -v \"rebuild-deps-jseh.sh:\\|rebuild-deps-wasmeh.sh:\" | head -50", "d…
Fable
⚙ Bash {"command": "ls -la /opt/toolchains/icu-wasm 2>/dev/null; echo \"---native---\"; ls -la /opt/toolchains/src/icu-native 2>/dev/null | head; echo \"---icu-wasm lib---\"; ls /opt/toolchains/icu-wasm/lib 2>/dev/null", "description": "Check inst…
Fable
thinking
No orchestrator gates are currently set on the tag, and there's no native ICU tree available—only icu-wasm is installed. I'm questioning whether the ICU cross-build is actually broken: if I point --with-cross-build at the source directory rather than a built one, the cross-compile would need native tools like icupkg and pkgdata to generate data, which wouldn't exist in the source. Even with --disable-tools and --with-data-packaging=static, I need to work through whether this configuration actually resolves the issue.
The reviewer's claims check out: the DEPS-WASMEH-OK tag is echoed on line 82, there's a comment mismatch, and pointing --with-cross-build at the source directory is indeed brok …
Fable
All three sub-claims verify against the actual files.
**Claim 1 (wrong/ambiguous tag):** Confirmed. jseh line 82 echoes `DEPS-WASMEH-OK`, byte-identical to wasmeh line 87. A JS-EH deps build (`-fexceptions`) and a wasm-EH deps build (`-fwasm-exceptions`) emit the same success string. Note: no orchestrator currently greps for this tag (searched /opt/toolchains and the whole repo — only `rebuild-deps-407.sh` uses its own distinct `ALL-DEPS-407-OK`), so the ambiguity is latent rather than actively breaking something today.
**Claim 2 (copy-pasted wrong header):** Confirmed. jseh lines 3-6 are identical to wasmeh's and say "-fwasm-exceptions here produces new-EH objects," while jseh line 10 actually sets `EH="-fexceptions"`. The comment contradicts the code.
**Claim 3 (broken ICU cross-build):** Confirmed. jseh line 75 uses `--with-cross-build=$TC/src/icu/source` (the source dir) and builds no native ICU beforehand (lines 72-80). The sibling wasmeh script explicitly documents this as the wrong thing (lines 72-73: "--with-cross-build must point to a built native tree, NOT the source dir") and does the correct two-stage build: `icu-native` via `runConfigureICU` + `make` (lines 74-77), then points `--with-cross-build=$TC/src/icu-native` (line 80). ICU cross-compilation requires the native tree's generated `config/icucross.mk` and native tools, which do not exist in the source dir, so a clean jseh run would fail at ICU.
Corroborating state: no `/opt/toolchains/src/icu-native` tree exists, yet `/opt/toolchains/icu-wasm` is populated — consistent with the reviewer's note that the installed icu-wasm came from a different invocation (wasmeh removes icu-native afterward, or the 407 script), not from jseh as written.
Severity assessment: These are real defects in build tooling. The ICU issue would actually break a clean rebuild; the tag/comment issues are correctness/maintainability problems with no current automated consumer. Medium is appropriate — the ICU correctness bug alone (build fails as written) supports it, though it is non-shipping tooling.
Fable
⚙ StructuredOutput {"verdict": "CONFIRMED", "reason": "All three sub-claims verify against the actual files. jseh line 82 echoes `DEPS-WASMEH-OK`, identical to wasmeh line 87, so the two link-incompatible deps builds (-fexceptions vs -fwasm-exceptions) share …