CNA-BUG-184: Core's build files still carry dependencies its sources dropped: -lembind on Emscripten and a link probe that tolerates SDL3

CNA snapshot 009d40f5  ·  Known Issues › Current bugs  ·  source links pinned to 009d40f5

✓

Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

modules/core/CMakeLists.txt still adds -lembind for every Emscripten consumer although the browser preference reader was rewritten with EM_JS to avoid embind, and probe_core still permits SDL3 although core no longer uses SDL.

Identifier
CNA-BUG-184
Category
Bug
Subsystem
Build & CI
Status
Open
Verified against
CNA 009d40f5 (009d40f5dd085c4e674d3479675fac84b12b3e0a)
Severity
Low (a triage suggestion, not a project priority)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
Yes: see Current tests
Affected contract
The link interface of cna_core (CNA::Core) on Emscripten, and the probe_core link-closure check

Expected behaviour

The core sources state both intents. GraphicsRendererSelectionEmscripten.cpp records that embind was dropped rather than linked, because "pulling embind's runtime into every consumer's bundle to read one string property is a real cost paid by pages that never set it". CMakeLists.txt says nothing under modules/core includes an SDL header any more ("the first module to come off SDL entirely"), and the sibling probes for math and design forbid libSDL3.

Actual behaviour at TARGET

  • target_link_options(cna_core INTERFACE "-lembind") is still applied under EMSCRIPTEN, with a comment saying the reader uses emscripten::val. No file in the TARGET tree includes emscripten/val.h or emscripten/bind.h; the reader is written with EM_JS. A comment in GraphicsRendererSelection.cpp still calls the Emscripten file "the only place emscripten/val.h is included".
  • In ModuleProbes.cmake, the comment on probe_core still calls SDL3 "an accepted PRIVATE implementation detail of Logger.cpp", and its forbidden-library pattern libcna_(?!core|math)|libCNA_|libenet|libav|cna_renderer_ does not name libSDL3, unlike the math and design probes.

Consequences: every Emscripten executable that links cna_core asks the linker for embind although nothing references it (the bundle-size or start-up effect was not measured); and a change that brought SDL3 back into core's link closure would pass probe_core.

Source locations

Evidence

Checked by reading at 009d40f5; nothing was built or executed for this entry. A search of the TARGET tree finds no embind header or EMSCRIPTEN_BINDINGS use and no SDL include under modules/core. No Emscripten bundle was linked, so whether removing the option is safe is not proven here: the failure it once papered over was a link-time error that compiling cna_core cannot show.

Independently observed as a separate finding (merged): modules/core/CMakeLists.txt says core no longer includes or links SDL, yet the core probe's forbidden-library pattern omits libSDL3 (unlike the math, design and storage probes), so an SDL link re-entering cna_core would pass the gate.

Independent re-verification: Checked by reading at 009d40f5; nothing was built or executed for this entry. A search of the TARGET tree finds no embind header or EMSCRIPTEN_BINDINGS use and no SDL include under modules/core. No Emscripten bundle was linked, so whether removing the option is safe is not proven here; emscripten-multi-renderer-ci.yml does link a bundle against cna_core (with the option present) but asserts nothing about embind. In ModuleProbes.cmake only probe_math and probe_design forbid libSDL3; probe_storage, like probe_core, does not name it, so the missing libSDL3 is not unique to probe_core. Git history: the EM_JS reader replaced emscripten::val in 188cb0062 (2026-08-17) and -lembind was added the next day in b0c43098d.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

probe_core (registered in ModuleProbes.cmake) checks core's link closure but not for SDL3. No test asserts that an Emscripten link of core does not require embind; the Emscripten CI workflow builds bundles but was not read for this entry.

Regression test

Remove the option and prove a real Emscripten bundle link that uses cna_read_module_preferred_renderer; add libSDL3 to probe_core's forbidden pattern and confirm the probe still passes; update the three stale comments.

Blast radius

Emscripten builds only, for the embind option (bundle contents; no behaviour change is known). The probe gap affects only the strength of a CI guard; native runtime behaviour is unaffected.

Workaround

No workaround is known.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.

Known issues
Bug index