Repository navigation
Fix wasm_js error formatting with backend overrides - #874
Closed
raiyan-ironsoftware wants to merge 1 commit into
Closed
raiyan-ironsoftware wants to merge 1 commit into
raiyan-ironsoftware wants to merge 1 commit into
Conversation
Do not reference WEB_CRYPTO when unsupported, custom, or extern_impl overrides the WebAssembly backend. That constant exists only in the wasm_js backend, even when Cargo feature unification leaves wasm_js enabled. Extend the Wasm override build job to compile unsupported and custom backends both with and without wasm_js.
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.
Enabling
wasm_jswhile selecting an explicit non-JavaScript backend fails to compile onwasm32-unknown-unknown:RUSTFLAGS='--cfg getrandom_backend="unsupported"' \ cargo check --target wasm32-unknown-unknown --features wasm_jsThe same error occurs with the
custombackend. A transitive dependency can enablewasm_js, so this configuration is useful for non-JavaScript Wasm applications that explicitly override the default backend.internal_descchecks the feature and target, butError::WEB_CRYPTOis defined only when thewasm_jsbackend is selected. Exclude the supported non-JavaScript overrides (unsupported,custom, andextern_impl) from that match arm. This changes no entropy source or runtime error behavior.The existing override build job now covers
unsupportedandcustom, both with and withoutwasm_js. These feature-enabled builds fail on the base revision and pass with this change.Validated locally:
unsupportedandcustom.unsupportedandcustom, with and withoutwasm_js, with warnings denied.unsupported,custom, andextern_impl, withwasm_jsandwasm_js,std.wasm_js.cargo test --locked --all-features: 11 integration tests and 9 doctests passed; 1 existing doctest ignored.cargo fmt --all -- --checkandgit diff --check.