Replies: 1 comment 1 reply
-
|
We might want to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
#212 (comment)
In Cargo there is one type to handle overrides at all scopes (package, registry, workspace source replacement):
src/cargo/sources/overlay.rs#L14-L20And the pattern for applying overlays happens once per pacakge/registry overrides are already done:
src/cargo/sources/config.rs#L240-L248The current
wasm_pkg_client::Client::resolve_sourceapproach should wrap anyself.sources.read()in an overlay lookup for better control over how and when sources/registries are overridden:wasm-pkg-tools/crates/wasm-pkg-client/src/lib.rs
Line 298 in d40f518
Note the overlays field in
cargo::sources::config::SourceConfigMap:https://github.com/rust-lang/cargo/blob/a595d0da21f228b7fdae64d3d5c0e527ea66bb59/src/cargo/sources/config.rs#L23-L31
There is only a
SourceIdtoSourceIdmapping and the resolution is done in scoped order: global -> workspace -> package.Right now we do not resolve/normalize overrides in a layered approach so reasoning about the config aht various scopes becomes difficult and results in disjointed logic that does not use prior resolutions:
wasm-pkg-tools/crates/wasm-pkg-client/src/lib.rs
Lines 231 to 246 in d40f518
In essence we should implement: an overlay flow to handle overrides with these rules:
Beta Was this translation helpful? Give feedback.
All reactions