Skip to content

Fix hotpatch cascade replaying workspace crates not built for the active target - #5746

Open
humdrum00001010 wants to merge 1 commit into
DioxusLabs:mainfrom
humdrum00001010:fix/hotpatch-cascade-target-filter
Open

Fix hotpatch cascade replaying workspace crates not built for the active target#5746
humdrum00001010 wants to merge 1 commit into
DioxusLabs:mainfrom
humdrum00001010:fix/hotpatch-cascade-target-filter

Conversation

@humdrum00001010

@humdrum00001010 humdrum00001010 commented Aug 7, 2026

Copy link
Copy Markdown

patch_rebuild()'s hot-patch cascade walks workspace_dependents_of(), which returns reverse-dependents from the whole-workspace, target-agnostic Cargo metadata graph. A workspace member can depend on a changed crate without ever being part of the served build's target/crate graph (e.g. a native-only sibling of a wasm32 app, or an unrelated _tests/example binary in the same workspace) - in that case it has no captured rustc invocation to replay, and compile_workspace_hotpatch() hard-errors with Missing rustc args for replay: '<crate>', leaving the builder in a failed state until dx serve is restarted.

Filter the cascade to only follow dependents that were actually captured in the fat build's workspace_rustc_args, via a new WorkspaceRustcArgs::contains_crate helper (unit tested) that mirrors the .lib/.bin lookup workspace_hotpatch_replay_args() already does. This keeps workspace_dependents_of() itself target-agnostic for its other callers, and a crate can no longer reach link.rs in a state that lookup would reject.

Verified manually with a 3-crate workspace (wasm app + shared lib + native-only sibling depending on the shared lib): before the fix, editing the shared lib crashed the hot-patch rebuild with Missing rustc args for replay: 'native_ffi'; after the fix the same edit hot-patches successfully.

This addresses the same root cause as #5596 (closed as a duplicate of #5540) - see the repro/analysis posted on #5540. (see comments)

Closes #5540

…t from the hotpatch cascade

`patch_rebuild()`'s cascade walk uses `workspace_dependents_of()`, which
returns reverse-dependents from the whole-workspace, target-agnostic Cargo
metadata graph. A crate can be a workspace dependent of a changed crate
without ever being part of the served build's target/crate graph (e.g. a
native-only sibling of a wasm32 app), in which case it has no captured
rustc invocation to replay and `compile_workspace_hotpatch()` hard-errors
with "Missing rustc args for replay".

Filter the cascade to only follow dependents that were actually captured
in the fat build's `workspace_rustc_args`, via a new
`WorkspaceRustcArgs::contains_crate` helper (covered by unit tests) that
mirrors the `.lib`/`.bin` lookup `workspace_hotpatch_replay_args()` already
does.

Fixes DioxusLabs#5540
@nicoburns
nicoburns requested a review from jkelleyrtp August 7, 2026 11:03
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.

dx serve --hotpatch tries to replay uncaptured workspace crates

1 participant