Skip to content

pycvc-gl wasm: install the recipe's deps (ImageMagick), keep VTK's libxml2 out of the host link - #872

Merged
transfix merged 2 commits into
masterfrom
fix/pycvc-gl-wasm-imagemagick
Oct 29, 2026
Merged

transfix merged 2 commits into
masterfrom
fix/pycvc-gl-wasm-imagemagick

Conversation

@transfix

@transfix transfix commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

publish-pycvc-gl-wasm failed on the v3.7.1 and v3.7.2 tag runs (40467963385, 40770763052), so no pycvc-gl-cp312 wasm package exists for either version. The catalog's newest is 3.7.0+cvc.1. Fixing that first failure exposed a second one: the host it builds is invalid wasm. This PR fixes both.

1. The configure found no ImageMagick

pycvc-gl(wasm): FATAL — the configure found no ImageMagick in /home/runner/work/libcvc/libcvc/wasm-deps

#801 made imagemagick a wasm build dep of pycvc-gl-cp312 and made build-wasm.sh fail without it. The workflow, though, installs a list of deps typed out by hand, and that list never gained imagemagick. #801 did not run the pycvc-gl wasm build, and nothing ran this workflow between #801 and the v3.7.1 tag. The prefix itself was fine: Boost, Assimp, libjpeg-turbo and ImGui were all found. The other "not found" lines (libigl/Eigen, Jolt, yaml-cpp, FTXUI, json-schema-validator, SDL3) are outside this recipe's wasm closure; v3.7.0's green publish (39395829831) reports the same ones.

  • The install step runs cvcpkg install-deps cvcpkg/recipes/pycvc-gl-cp312 --platform wasm --arch wasm32 …, so it installs whatever the recipe declares and cannot drift from it again. freetype, assimp and imgui, which the closure links but the recipe does not declare, are still installed by name.
  • The step sets pipefail. Under the default bash -e, cvcpkg install … | tail -3 || error took its status from tail, so a failed install passed.

2. The host did not compile

With ImageMagick in, dry run 40785015722 built, packed and went green. But its pycvc_host.wasm fails under node:

CompileError: WebAssembly.instantiate(): Compiling function #285254 failed: expected 0 elements on the stack for fallthru, found 1
  • link-host.sh links every $DEPS/lib/*.a in one group under --allow-multiple-definition.
  • VTK's bundled libxml2 (libvtklibxml2-9.5.a) mangles only libxml2's public API (vtklibxml2_xml*). 65 internals keep their plain names: __xmlRaiseError, __xmlIOErr, xmlBuf*, xmlDict* and more.
  • ImageMagick now pulls cvcpkg's libxml2 2.12.9 into the link. Its references to those internals resolve to VTK's copy, which sorts first, and then both copies link.
  • wasm-ld warns function signature mismatch for __xmlRaiseError, __xmlIOErr and xmlBufAttrSerializeTxtContent. VTK's newer __xmlRaiseError returns int, and 2.12's caller leaves that value on the stack. The invalid function is that caller: it checks XML_SAX2_MAGIC (0xDEEDBEAF) and calls a 17-argument function returning i32.
  • v3.7.0's host has no libxml2 code at all.

Reproduced on its own with emsdk 5.0.7 and the catalog archives: a 12-line libxml2 program linked the same way gives the same three warnings and the same CompileError. Without libvtklibxml2 in the group, libxml2.a links with no undefined symbols (ERROR_ON_UNDEFINED_SYMBOLS=1) and parses correctly.

  • link-host.sh leaves libvtklibxml2-*.a out of the group. VTK's copy has one user, vtkXMLTreeReader, which the vtk-python build does not reference. If one is added, the log will show vtklibxml2_* as undefined symbols.
  • link-host.sh's node smoke is non-fatal, so the broken host shipped in a green build. The verify step now runs a bundled host under node and fails without PYCVC_VTK_BRIDGE_OK and PYCVC_WASM_OK. Checked locally against the two hosts: v3.7.0's passes, 40785015722's fails.

Proof

Dry run on 77772ca: 40795092841 (dry_run=true, so nothing is published) passed:

  • configure: ImageMagick found: …/include/ImageMagick-7 (Q16, HDRI=1);
  • host link: no libxml2 signature mismatches, and no undefined vtklibxml2_*. Only numpy's random_* warnings remain, which v3.7.0's working link had too;
  • the host runs under node, and both link-host.sh's smoke and the new verify gate print PYCVC_VTK_BRIDGE_OK and PYCVC_WASM_OK;
  • bundle: pycvc-gl-cp312-3.7.2+cvc.1-wasm-wasm32-release-static.tar.gz (85.8 MB), carrying only its own manifest.

After merge

Dispatch publish-pycvc-gl-wasm on master with dry_run=false to publish pycvc-gl-cp312 3.7.2+cvc.1 for wasm. This build compiles cvc from source, so the package will also carry master's #851 (cvc::ph steering modulation, opt-in) and #858 (CI only), which are past the v3.7.2 tag.

… ImageMagick is there

publish-pycvc-gl-wasm has failed on the v3.7.1 and v3.7.2 tag runs (40467963385,
40770763052) at configure:

  pycvc-gl(wasm): FATAL — the configure found no ImageMagick in .../wasm-deps

#801 made imagemagick a wasm build dep of pycvc-gl-cp312 and made build-wasm.sh
fail when the configure does not find it, but the workflow installs a list of
deps typed out by hand, and that list never gained imagemagick. Nothing ran the
workflow between #801 and the v3.7.1 tag.

The step now installs the recipe's declared deps with `cvcpkg install-deps
cvcpkg/recipes/pycvc-gl-cp312 --platform wasm`, so it cannot drift from the
recipe again. freetype, assimp and imgui, which the closure links but the recipe
does not declare, are still installed by name.

The other "not found" lines in those configures (libigl/Eigen, Jolt, yaml-cpp,
FTXUI, json-schema-validator, SDL3) are not part of this recipe's trimmed wasm
closure; v3.7.0's green publish (39395829831) reported the same ones.

The step also sets pipefail. Its shell is the default `bash -e`, so
`cvcpkg install ... | tail -3 || error` took its status from tail, and a failed
install passed.
…t that does not run

With ImageMagick in the closure, the branch dry run (40785015722) built and packed
a pycvc_host.wasm that node cannot compile:

  Compiling function #285254 failed: expected 0 elements on the stack for
  fallthru, found 1

link-host.sh links every $DEPS/lib/*.a in one group under
--allow-multiple-definition. VTK's bundled libxml2 (libvtklibxml2-9.5.a) mangles
only libxml2's public API; 65 internals (__xmlRaiseError, __xmlIOErr, xmlBuf*,
xmlDict*, ...) keep their plain names. ImageMagick now pulls cvcpkg's libxml2
2.12.9 in, its references to those internals resolve to VTK's copy (it sorts
first), and both copies link. wasm-ld warns "function signature mismatch" for
__xmlRaiseError, __xmlIOErr and xmlBufAttrSerializeTxtContent: VTK's newer
__xmlRaiseError returns int, and 2.12's caller leaves that value on the stack.
v3.7.0's host had no libxml2 in it at all.

The same link of a 12-line libxml2 program against the catalog archives (emsdk
5.0.7) reproduces it: with libvtklibxml2 in the group, the same three warnings
and the same CompileError; without it, libxml2.a links with no undefined symbols
and parses. VTK's copy has one user, vtkXMLTreeReader, which the vtk-python
build does not reference, so the group now leaves libvtklibxml2-*.a out.

link-host.sh's node smoke is non-fatal, so the step stayed green and the bundle
carried the broken host. The verify step now runs a bundled host under node and
fails without PYCVC_VTK_BRIDGE_OK and PYCVC_WASM_OK. Checked locally against the
two hosts: v3.7.0's passes, the dry run's fails.
@transfix transfix changed the title ci(pycvc-gl-wasm): install the recipe's wasm deps from the recipe, so ImageMagick is there pycvc-gl wasm: install the recipe's deps (ImageMagick), keep VTK's libxml2 out of the host link Oct 29, 2026
@transfix
transfix merged commit 2e9899c into master Oct 29, 2026
28 of 29 checks passed
transfix added a commit that referenced this pull request Oct 29, 2026
The project version and the cvcpkg recipe family move to 3.7.3. Every recipe is at cvc_revision 1
already, so none restarts.

3.7.3 carries the dynamic plants' driver and chassis friction (#873): --plant
dynamic and dynamic4w take nav's acceleration as the Jolt plant's driver does (a standstill hold,
the grade fed forward, a trim on the measured acceleration) and their chassis boxes scrape walls
at a body panel's friction, so on Austin at 864 s they bring 35 and 24 of 48 vehicles to the
objective (3.7.2: 11 and 7). It also carries pycvc-gl's wasm deps with ImageMagick (#872), the
steering modulation of D and G in cvc::ph (#851), the bench's compare and sweep keys (#859), and
the sanitizer CI jobs for state_exec (#858).
transfix added a commit that referenced this pull request Oct 29, 2026
The project version and the cvcpkg recipe family move to 3.7.3. Every recipe is at cvc_revision 1
already, so none restarts.

3.7.3 carries the dynamic plants' driver and chassis friction (#873): --plant
dynamic and dynamic4w take nav's acceleration as the Jolt plant's driver does (a standstill hold,
the grade fed forward, a trim on the measured acceleration) and their chassis boxes scrape walls
at a body panel's friction, so on Austin at 864 s they bring 35 and 24 of 48 vehicles to the
objective (3.7.2: 11 and 7). It also carries pycvc-gl's wasm deps with ImageMagick (#872), the
steering modulation of D and G in cvc::ph (#851), the bench's compare and sweep keys (#859), and
the sanitizer CI jobs for state_exec (#858).
@transfix
transfix deleted the fix/pycvc-gl-wasm-imagemagick branch October 29, 2026 20:54
transfix added a commit that referenced this pull request Oct 30, 2026
… one copy

link-host.sh left libvtklibxml2-*.a out of the host link (#872): VTK's
bundled libxml2 kept 65 internals under plain names, which collided with the
libxml2 ImageMagick brings and made a module node could not compile. vtk
9.5.0+cvc.4 (cy-pca/cvcpkg#497, #505) builds its wasm variants against
cvcpkg's libxml2, libtiff, liblzma and freetype, so the bundle no longer
ships libvtk{libxml2,tiff,lzma,freetype} and the exclusion matches nothing.
Every deps archive goes into the group again; the comment says why an older
vtk would break and that the workflow's node check catches it.
transfix added a commit that referenced this pull request Oct 30, 2026
…; no arigl in the build (#910)

* pycvc wasm: link VTK's libxml2 replacement again; vtk 9.5.0+cvc.4 has one copy

link-host.sh left libvtklibxml2-*.a out of the host link (#872): VTK's
bundled libxml2 kept 65 internals under plain names, which collided with the
libxml2 ImageMagick brings and made a module node could not compile. vtk
9.5.0+cvc.4 (cy-pca/cvcpkg#497, #505) builds its wasm variants against
cvcpkg's libxml2, libtiff, liblzma and freetype, so the bundle no longer
ships libvtk{libxml2,tiff,lzma,freetype} and the exclusion matches nothing.
Every deps archive goes into the group again; the comment says why an older
vtk would break and that the workflow's node check catches it.

* pycvc-gl wasm: no arigl in the build; it fails cmake --install

Since arigl took the network flags, every wasm link of it pulls in cvc::net's fetch backend and
needs -sFETCH=1, which only the examples' gallery link gives it. pycvc-gl's wasm build has the
examples off, so arigl.js fails to link (undefined emscripten_fetch*), and cmake --install then
stops on the missing bin/arigl.js before link-host.sh runs. The package never shipped arigl, so
turn it off, as publish-cvcgl-wasm.yml already does; build-wasm.ps1 gets the ari and arigl
options build-wasm.sh has.
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