Skip to content

libcvc recipe: scope 12 native-only deps off wasm-mt + add assimp (fix wasm resolve) - #448

Merged
transfix merged 1 commit into
masterfrom
design/libcvc-wasm-dep-guards
Sep 28, 2026
Merged

transfix merged 1 commit into
masterfrom
design/libcvc-wasm-dep-guards

Conversation

@transfix

@transfix transfix commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Problem

cvcpkg install cvc/libcvc cvc/cvcgl --platform wasm-mt fails to resolve (no candidate for cgal / gmp / …), blocking downstream wasm deploys (silently red for weeks). The +cvc.3 note claimed the gRPC guard made wasm "resolve again" — it didn't; that guard only scoped abseil/protobuf/grpc.

Root cause (verified)

pack → generate_manifest (cvcpkg builder.py) bakes a bundle's required_deps from depends.runtime filtered by the target platform — not from the prefix. So the wasm-mt bundle baked every dep left unscoped, including 12 native-only libs with no wasm-mt catalog candidate that the wasm build links none of.

The verified per-dep matrix

Cross-checked across four sources: the wasm build flags (publish-cvcgl-wasm.yml), the CMakeLists find_package/link conditionals, cvcpkg search --platform wasm-mt candidate counts, and CMake/cvcConfig.cmake.in.

GUARD → [linux, macos, windows] (not linked on wasm; 0 wasm-mt candidates except hdf5):

dep why not on wasm
cgal, gmp, mpfr DISABLE_CGAL=ON
hdf5 CVC_USING_HDF5=OFF (candidate exists → not a resolve-blocker; scoped for closure honesty)
pocketfft CVC_FFT_PROVIDER=none (header-only)
gsl, levmar no find_package in the build
log4cplus optional find_package; no wasm-mt bundle → absent
yaml, yaml-cpp ariadne YAML loader is a QUIET/stub build on wasm
libiimod CVC_USING_IMOD_MRC=OFF
expat only a fontconfig delegate; fontconfig is [linux,macos]

ADD wasm-mt → assimp: the wasm build sets CVC_ENABLE_ASSIMP=ON and assimp has a wasm-mt candidate, but it was scoped off wasm → its symbols were omitted from the baked closure and a wasm consumer's emscripten link would fail on assimp symbols. (This was under-declared — the opposite of the others.)

KEEP (no edit): zlib + the ImageMagick codec closure (tiff/png/jpeg-turbo/webp/lerc/zstd/xz/bzip2/libxml2/freetype) + boost/imagemagick — all have wasm-mt candidates and are linked. (My first pass wrongly flagged zlib as no-candidate — a bare cvcpkg search without --platform is unreliable; --platform wasm-mt shows zlib has 4 builds.)

[linux,macos,windows] is the full native set — libcvc publishes only there (verified: 0 catalog builds for haiku/freebsd/netbsd/openbsd), so nothing native is lost.

Revision + republish

cvc_revision 3 → 4. A recipe edit alone can't fix the already-published +cvc.3 bundle (its required_deps are baked) — publish-cvcgl-wasm must republish a clean +cvc.4 wasm-mt closure, then cvcgl rebuilds against +cvc.4 (exact version-pin; no cvcgl recipe edit needed). Native lanes auto-bump and keep their footprint.

Coordination

Owned per handoff with cvc-9f. After merge I ping them; they re-run publish-cvcgl-wasm + the downstream wasm nightly (and their disjoint pycvc-cp3XX parity bump, rebased on top). This is the prerequisite for the wasm-SDL3 work (deps-closure sdl3 install), which is a separate follow-up.

Matrix produced by a verification workflow and independently spot-checked (manifest mechanism in builder.py, per-dep --platform wasm-mt counts, build.matrix).

…x wasm resolve)

`cvcpkg install cvc/libcvc cvc/cvcgl --platform wasm-mt` fails to resolve
(no candidate for cgal/…), blocking the cvcdbg demo3 wasm deploy. The
+cvc.3 note claimed the gRPC guard made wasm "resolve again" — it did
not: that guard only scoped abseil/protobuf/grpc.

`pack` bakes a bundle's required_deps from depends.runtime FILTERED BY
the target platform (builder.py generate_manifest), so the wasm-mt bundle
baked every dep left unscoped — including 12 native-only libs with NO
wasm-mt catalog candidate, which the wasm build links none of:

  cgal, gmp, mpfr        (DISABLE_CGAL=ON)
  hdf5                   (CVC_USING_HDF5=OFF; a candidate exists, so not a
                          resolve-blocker — scoped for closure honesty)
  pocketfft              (CVC_FFT_PROVIDER=none; header-only)
  gsl, levmar            (no find_package in the build)
  log4cplus              (optional find_package; no wasm-mt bundle -> absent)
  yaml, yaml-cpp         (ariadne YAML loader is a QUIET/stub build on wasm)
  libiimod               (CVC_USING_IMOD_MRC=OFF)
  expat                  (only a fontconfig delegate; fontconfig is [linux,macos])

Scope those 12 to [linux, macos, windows] — libcvc builds/publishes only
for those three (verified: 0 catalog builds for haiku/freebsd/netbsd/
openbsd), so nothing native is lost; only wasm/wasm-mt drops.

Also ADD wasm-mt to assimp: the wasm build sets CVC_ENABLE_ASSIMP=ON and
assimp HAS a wasm-mt candidate, but assimp was scoped OFF wasm, so its
symbols were omitted from the baked wasm closure and a wasm consumer's
emscripten link would fail on assimp symbols. zlib + the ImageMagick
codec closure (tiff/png/jpeg/webp/lerc/zstd/xz/bzip2/libxml2/freetype)
stay declared for wasm — all have wasm-mt candidates and are linked.

cvc_revision 3 -> 4: a recipe edit alone cannot fix the already-published
+cvc.3 bundle (its required_deps are baked); publish-cvcgl-wasm must
republish a clean +cvc.4 wasm-mt closure. cvcgl then rebuilds against
+cvc.4 (version-pin) — no cvcgl recipe edit needed. Native lanes
auto-bump and keep their footprint ([linux,macos,windows] preserves it).

Verified via the manifest mechanism (builder.py), per-dep `cvcpkg search
--platform wasm-mt` candidate counts, and the wasm build flags in
publish-cvcgl-wasm.yml.
@transfix
transfix merged commit 1f03c8f into master Sep 28, 2026
13 checks passed
transfix added a commit that referenced this pull request Sep 28, 2026
…bcvc (#449)

The published pycvc-cp311/312/313 +cvc.2 link a PRE-v2 libcvc, so the torch<->C++
coef_mlp parity test (GRL-SNAM test_coef_mlp_parity::test_two_head_sigmoid_matches_torch)
skips on 'unsupported .cvcnav format version'. Bump so publish-cvcpkg rebuilds pycvc against
the v2 libcvc (.cvcnav format v2 / two-head sigmoid, #436) and the parity test runs.
Recipe-only revision bump; disjoint from the wasm-guard change (#448).
@transfix
transfix deleted the design/libcvc-wasm-dep-guards branch October 29, 2026 20:51
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