Skip to content

Scope Cargo feature resolution to reachable target platforms - #220

Open
adincebic wants to merge 2 commits into
hermeticbuild:mainfrom
adincebic:adin/prevent-cargo-features-from-leaking
Open

adincebic wants to merge 2 commits into
hermeticbuild:mainfrom
adincebic:adin/prevent-cargo-features-from-leaking

Conversation

@adincebic

@adincebic adincebic commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

rules_rs resolved features for target triples where a crate was not actually reachable. This was causing target-specific features to leak between platform resolutions. We track the platforms on which each crate is reachable and only resolve its features for those platforms.

I hit this with wasm build where the native-only mio dependency was incorrectly pulled into the wasm dependency graph, which failed hard with:

error[E0432]: unresolved import `crate::sys::IoSourceState`
error[E0432]: unresolved import `crate::sys::tcp`
error[E0433]: cannot find `Selector` in `sys`

@adincebic adincebic changed the title Prevent native Cargo features from leaking into wasm Scope Cargo feature resolution to reachable target platforms Aug 16, 2026
@adincebic
adincebic force-pushed the adin/prevent-cargo-features-from-leaking branch 3 times, most recently from f48ade0 to 3badc2a Compare August 16, 2026 13:53
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.

1 participant