Skip to content

fix: fail fast in Rust WASM build script - #492

Open
FARICJH59 wants to merge 1 commit into
sparkjsdev:mainfrom
FARICJH59:fix/wasm-build-fail-fast
Open

FARICJH59 wants to merge 1 commit into
sparkjsdev:mainfrom
FARICJH59:fix/wasm-build-fail-fast

Conversation

@FARICJH59

@FARICJH59 FARICJH59 commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary

  • Fail immediately when "rustc" is unavailable or the Rust sysroot cannot be determined.
  • Enable strict Bash error handling so prerequisite, target-installation, and build failures propagate.
  • Improve toolchain checks and diagnostic messages.
  • Preserve support for Rust installations where the "wasm32-unknown-unknown" target is already installed without "rustup".

Validation

  • "bash -n rust/build_rust_wasm.sh"
  • "git diff --check"
  • Mocked failure-path tests covering a missing "rustc" and a failed WASM target installation.

Remaining validation

The actual WASM build has not been run in this environment. The PR's Linux and Windows CI workflow runs also require investigation because their reported conclusion is "action_required". Successful end-to-end build validation remains outstanding.

@FARICJH59

Copy link
Copy Markdown
Author

Summary

  • Stop immediately when Rust is unavailable or its sysroot cannot be determined.
  • Enable strict Bash error handling to propagate prerequisite and build failures.
  • Improve shell checks and clarify Rust toolchain diagnostics.
  • Preserve support for installations where the WASM target is already available without rustup.

Validation

  • "bash -n rust/build_rust_wasm.sh"
  • "git diff --check"
  • Mocked failure-path tests for missing "rustc" and failed WASM target installation.

The actual WASM build has not been run in this environment.

@mrxz

mrxz commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Is there a specific reason for these changes? The script effectively depends on the user having or installing rustup. By checking the existence of rustc in PATH first, users without any rust toolchain configured will now get a less descriptive error message.

Frankly, I'm not sure these two additional checks (rustc and sysroot) add anything meaningful. If the problem is a setup where rustup is in PATH, but the installed rustc and other binaries aren't, then I think we can address this more directly. Though at some point it's the responsibility of the user to properly setup their dev environment.

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.

2 participants