Skip to content

Prove the wasm archive is usable before it becomes a release asset - #18

Merged
jcant0n merged 1 commit into
mainfrom
prove-the-wasm-archive-is-usable
Aug 8, 2026
Merged

Prove the wasm archive is usable before it becomes a release asset#18
jcant0n merged 1 commit into
mainfrom
prove-the-wasm-archive-is-usable

Conversation

@jcant0n

@jcant0n jcant0n commented Aug 8, 2026

Copy link
Copy Markdown
Member

Ten releases shipped a browser-wasm archive that nothing ever linked.

The archive itself turned out to be fine. Evergine.Bindings.JoltPhysics packed it under a name no DllImport could match and shipped no buildTransitive targets file, so the fault was downstream (JoltPhysics.NET#12 fixes it). But nothing here could have told the difference, and that is what this PR is for.

The eleven C suites do not cover this: they build and run natively, so they prove the library works and say nothing about whether .NET can link it. The build only proves emcc accepted the sources.

Why a .NET publish and not an emcc link check

.NET links with its own flags — -exception-model=wasm, a fixed wasm-opt feature list, no setjmp support library — so an archive can satisfy emcc and still be unusable by the only consumer this repository has. In CesiumC three separate blockers were found by a person running a publish by hand and none by the emcc check sitting in the same job. It also covers the step after linking: wasm-opt runs with a fixed feature list, and an archive can link cleanly and then fail validation.

The check calls into the library rather than referencing it, so the linker has to pull the members behind the calls, and it creates the job system with numThreads = 0 — no pthread here, and JoltPhysics then runs jobs on the thread waiting at the barrier.

Verified out of band before writing this: the archive from the published 2026.8.4.12, renamed to JoltC.a, links and runs under node. So this step should be green on the first try. Its value is the release where it will not be.

Ten releases have shipped a browser-wasm archive that nothing ever
linked. The archive itself turned out to be fine -- Evergine.Bindings
.JoltPhysics packed it under a name no DllImport could match and had no
buildTransitive targets file, so the fault was downstream -- but nothing
in this repository could have told the difference, and that is what this
fixes.

The eleven C suites do not cover it: they are built and run natively, so
they prove the library works and say nothing about whether .NET can link
it. The build only proves emcc accepted the sources.

A .NET publish rather than an emcc link check, and the difference is the
point. .NET links with its own flags -- -exception-model=wasm, a fixed
wasm-opt feature list, no setjmp support library -- so an archive can
satisfy emcc and be unusable by the only consumer this repository has.
In CesiumC three separate blockers were found by a person running a
publish by hand and none by the emcc check in the same job. It also
covers what comes after linking: wasm-opt runs with a fixed feature list
and an archive can link cleanly and then fail validation.

The check calls into the library rather than merely referencing it, so
the linker has to pull the members behind the calls, and creates the job
system with no worker threads because there is no pthread here and
JoltPhysics then runs jobs on the thread waiting at the barrier.

Verified out of band before this was written: the archive from the
published 2026.8.4.12, renamed to JoltC.a, links and runs under node.
So this step should be green on the first try, and its value is the
release where it will not be.
@jcant0n
jcant0n merged commit a3e17e2 into main Aug 8, 2026
12 checks passed
@jcant0n
jcant0n deleted the prove-the-wasm-archive-is-usable branch August 8, 2026 12:23
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