Repository navigation
build: keep wasm flags in .cargo config, fail on lost simd128 - #7
Merged
Merged
Conversation
.cargo/config.toml sets +simd128 for every wasm32 build and .cargo/threads.toml holds the CPU-threads build's atomics and link arguments, passed with cargo --config. Only the machine-dependent --remap-path-prefix flags stay inline in build.sh, also via --config, 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.
build-std compiles std from the nightly toolchain's source tree, whose absolute path would otherwise end up in the CPU-threads wasm unless a user-level remap happens to cover it.
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 warningsas in CI (native, wasm32 web, wasm32 web+diag): clean.main(leandefault and threads). With the new targets only the remapped path strings change: default 3,540,511 -> 3,540,155 bytes, threads 4,931,937 -> 4,927,393; SIMD instruction counts unchanged (21,630 and 22,927);+atomicsstill present in the threads build.simd128.