Repository navigation
build: keep wasm flags in .cargo config, fail on lost simd128 - #15
Merged
Merged
Conversation
.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build scripts keep the wasm32 flags in
.cargo/config.tomland pass only the machine-dependent--remap-path-prefixflags inline throughcargo --config, under thetarget.'cfg(all())'.rustflagskey so they apply after any user-level remap.wasm-packgets the extra args without a--separator. A newscripts/check_wasm_features.pyreads each wasm'starget_featuressection and fails the build if+simd128is missing (and+atomicsfor a threads build).Verified locally before opening:
-D warnings(native wgpu,cli and wasm32) on 1.99.0; tests compile.main; new targets change only path strings (1,993,728 -> 1,993,664 bytes), SIMD count unchanged (21,337).main(two builds ofmainwith the same flags differ, in about 40 cubecl kernel-definition functions). With the old targets substituted it differs frommainin 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).