Skip to content

cvcGL: link every wasm executable with -sFETCH - #1435

Merged
transfix merged 1 commit into
masterfrom
fix/cvcgl-wasm-tests-fetch
Nov 22, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/cvcgl-wasm-tests-fetch

Conversation

@transfix

@transfix transfix commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

In v4.0.3's pycvc-gl wasm build (publish-pycvc-gl-wasm run 44925109906), 38 cvcGL test executables failed to link:

wasm-ld: error: lib/libcvc.a(http_client_fetch.cpp.o): undefined symbol: emscripten_fetch
wasm-ld: error: lib/libcvc.a(http_client_fetch.cpp.o): undefined symbol: emscripten_fetch_close

They linked in v4.0.2's run. The recipe builds with -k 0 || true because these tests aren't part of the package, so the job didn't fail on them. That run did fail later, on a cvcpkg.org upload timeout, which is unrelated.

Why. Since the fleet PRs (#1384, #1403), world_vehicles.cpp loads a fleet's trained weights through DataStore::load (ariadne/data.cpp), which can fetch over cvc::net. So any executable that realizes a scene now pulls data.cpp.o, then net/http_client.cpp.o, then the Emscripten fetch backend. libcvc deliberately leaves -sFETCH to the executable (src/cvc/CMakeLists.txt: the static archive does not propagate it), and cvcGL's test executables never set it.

The fix. src/cvcGL/CMakeLists.txt gives every executable it defines -sFETCH=1 under Emscripten, in one loop over the directory's targets, so a new test can't miss it. These tests never fetch, so -sFETCH alone is enough; a blocking send would also need -sASYNCIFY or -pthread, as before. Native builds are untouched.

Verified.

  • Before: all 38 failures listed above are cvcgl_* executables, each missing only emscripten_fetch*.
  • After: publish-pycvc-gl-wasm dispatched on this branch with dry_run (build and verify, no publish). Run 44944190377 (on 997017f) succeeded. All 112 cvcgl_* executables link: 0 FAILED: and 0 undefined emscripten_fetch*, where v4.0.3's run had 38 failures out of the same 112. The package build and the host link are unchanged ("pycvc_host.wasm linked", "build complete").
  • A native configure is unchanged.

No CI job links cvcGL's tests for wasm: the ci.yml wasm jobs build with CVC_BUILD_CVCGL=OFF or CVC_BUILD_TESTS=OFF. That's why this went unnoticed.

A scene's vehicles load a fleet's weights through DataStore, which can fetch over cvc::net, so
cvcGL's tests that realize a scene link the Emscripten-fetch backend. Without -sFETCH=1 its
emscripten_fetch* symbols are undefined: 38 cvcgl_* links failed in v4.0.3's pycvc-gl wasm build
(tolerated there, since the tests are not shipped). libcvc leaves the fetch flags to the
executable, so src/cvcGL sets it on every executable it defines.
@transfix
transfix merged commit e5048a1 into master Nov 22, 2026
32 checks passed
@transfix
transfix deleted the fix/cvcgl-wasm-tests-fetch branch November 22, 2026 08:27
transfix added a commit that referenced this pull request Nov 22, 2026
…clock-rate

JX2 deleted .github/scripts/pin-wasm-pre-jx1.sh, so this branch's numpy pin goes with it.
transfix added a commit that referenced this pull request Nov 22, 2026
Brings in master through 08a7386 (#1413, #1430, #1446, #1420, #1447, #1435). No conflicts; nothing in it touches state_exec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant