Skip to content

build: keep wasm flags in .cargo config, fail on lost simd128 - #15

Merged
ilnmtlbnm merged 2 commits into
mainfrom
clean-build
Oct 12, 2026
Merged

ilnmtlbnm merged 2 commits into
mainfrom
clean-build

Conversation

@ilnmtlbnm

Copy link
Copy Markdown
Member

Build scripts keep the wasm32 flags in .cargo/config.toml and pass only the machine-dependent --remap-path-prefix flags inline through cargo --config, under the target.'cfg(all())'.rustflags key so they apply after any user-level remap. wasm-pack gets the extra args without a -- separator. A new scripts/check_wasm_features.py reads each wasm's target_features section and fails the build if +simd128 is missing (and +atomics for a threads build).

Verified locally before opening:

  • Clippy -D warnings (native wgpu,cli and wasm32) on 1.99.0; tests compile.
  • mimi-wasm: with the old remap targets substituted, byte-identical to main; new targets change only path strings (1,993,728 -> 1,993,664 bytes), SIMD count unchanged (21,337).
  • sts-wasm: this build is not reproducible even on main (two builds of main with the same flags differ, in about 40 cubecl kernel-definition functions). With the old targets substituted it differs from main in that same set of functions only; data sections and size identical. New targets: 13,048,404 -> 13,047,956 bytes, SIMD count unchanged (167,417).
  • Leak check: no local paths.

.cargo/config.toml already holds every static wasm32 flag. The
machine-dependent --remap-path-prefix flags stay inline in build.sh via
cargo --config, now under the cfg(all()) key so they come after any
user-level cfg(all()) remap and win. Cargo home is remapped too.
scripts/check_wasm_features.py reads each module's target_features
custom section. build.sh runs it on every wasm it produces, so CI and
local builds both catch a flag regression.
@ilnmtlbnm
ilnmtlbnm merged commit b3697cb into main Oct 12, 2026
2 checks passed
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