Skip to content

chore(repo): check the wasm target on PRs that touch rust - #36925

Open
FrozenPandaz wants to merge 1 commit into
masterfrom
chore/wasm-target-check
Open

chore(repo): check the wasm target on PRs that touch rust#36925
FrozenPandaz wants to merge 1 commit into
masterfrom
chore/wasm-target-check

Conversation

@FrozenPandaz

@FrozenPandaz FrozenPandaz commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Stacked on #36924 — that PR carries the walker.rs fix this check needs in order to pass. Review this one on top of it; the base will retarget to master once #36924 lands.

Current Behavior

Nothing in PR CI builds or type-checks the wasm target. pnpm build:wasm only runs in publish.yml, so a wasm-only compile break is invisible until publish time — which is exactly how the stray #[cfg] in #36924 escaped review:

error[E0599]: no method named `to_normalized_string` found for reference `&std::path::Path`
  --> packages/nx/src/native/walker.rs:94:40

Expected Behavior

A PR that touches Rust type-checks the native crate for wasm32-wasip1-threads, so the next one of these fails on the PR.

This is an nx task rather than a separate workflow job, so it inherits three things instead of re-implementing them:

  • Affected detection. The native named input already covers **/*.rs, **/Cargo.*, the workspace Cargo.toml/Cargo.lock, clippy.toml and .cargo/config.toml — a content-hashed superset of what a paths filter or a git diff | grep gate would match.
  • Nx Cloud caching. cache: true with no outputs makes it a pass/fail verdict keyed on those inputs, so an unchanged rerun costs nothing.
  • DTE distribution. It joins the existing nx affected sweep and lands on an agent, so it adds no wall clock to main-linux and needs no second runner, checkout, mise, corepack, pnpm store cache or install.

cargo check never links, so it needs none of the wasi-sdk, cmake and sqlite machinery a full pnpm build:wasm does.

Notes

  • The script is itself an input. The native named input carries {"runtime": "rustc --version"}, which reports the stable rustc from mise.toml — without the script in inputs, changing the pinned nightly would not invalidate the cache.
  • parallelism: false, since the task may invoke rustup, which is not safe against concurrent writes to the same RUSTUP_HOME.
  • The nightly is required, not a preference: packages/nx/src/lib.rs puts wasi_ext behind #![feature], which stable rejects with E0554 before it type-checks anything.
  • Dispatch is rustup run <toolchain> rather than RUSTUP_TOOLCHAIN, because mise puts its own non-shim cargo on PATH (the rust pin in mise.toml) and that one ignores the variable.
  • The toolchain install is conditional, and lands under ~/.rustup on contributor machines. It does not change the active or default toolchain — rustup toolchain install only unpacks, rustup run scopes to one child process, and rust-toolchain.toml pins 1.95.0 inside the repo regardless.

Verification

Run against the stray-#[cfg] code, the task reproduces the E0599 above; with #36924's fix applied it passes. So it is real coverage rather than a check that cannot fail.

Related Issue(s)

None.


View Polygraph session ↗

@nx-cloud

nx-cloud Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit e76f4af

Command Status Duration Result
nx affected --targets=lint,oxlint,test,build,e2... ✅ Succeeded 7m 8s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 1m View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 19s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-09-05 06:01:38 UTC

@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit e76f4af
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a9bad78471f8e0008474aeb
😎 Deploy Preview https://deploy-preview-36925--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit e76f4af
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a9bad78a413be0008471786
😎 Deploy Preview https://deploy-preview-36925--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@FrozenPandaz
FrozenPandaz force-pushed the chore/wasm-target-check branch from ca6feb8 to 5cd4b9e Compare September 4, 2026 22:28
Base automatically changed from fix/wasm-walker-cfg-imports to master September 5, 2026 05:49
The stray cfg attribute that broke walker.rs only surfaced in `pnpm build:wasm`
at publish time, because nothing in PR CI builds wasm.

Adds an `nx:check-native-wasm` task to the affected sweep instead of a separate
workflow job, so it inherits affected detection, Nx Cloud caching and DTE
distribution rather than a hand-rolled path filter and its own runner setup.
`cargo check` never links, so it needs none of the wasi-sdk, cmake and sqlite
machinery a full wasm build does.
@FrozenPandaz
FrozenPandaz marked this pull request as ready for review September 5, 2026 05:49
@FrozenPandaz
FrozenPandaz requested a review from a team as a code owner September 5, 2026 05:49
@FrozenPandaz
FrozenPandaz force-pushed the chore/wasm-target-check branch from 5cd4b9e to e76f4af Compare September 5, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant