Skip to content

Commit

Permalink
fix(resolver): Make sure things don't override
Browse files Browse the repository at this point in the history
We were only checking resolved deps instead of both it and unresolved deps
in the resolver.

Signed-off-by: Taylor Thomas <[email protected]>
  • Loading branch information
thomastaylor312 committed Oct 3, 2024
1 parent f0b0108 commit 3c34508
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.7.3"
version = "0.7.4"
authors = ["The Wasmtime Project Developers"]
license = "Apache-2.0 WITH LLVM-exception"

Expand Down Expand Up @@ -36,9 +36,9 @@ tracing-subscriber = { version = "0.3.18", default-features = false, features =
"fmt",
"env-filter",
] }
wasm-pkg-common = { version = "0.7.3", path = "crates/wasm-pkg-common" }
wasm-pkg-client = { version = "0.7.3", path = "crates/wasm-pkg-client" }
wasm-pkg-common = { version = "0.7.4", path = "crates/wasm-pkg-common" }
wasm-pkg-client = { version = "0.7.4", path = "crates/wasm-pkg-client" }
wasm-metadata = "0.217"
wit-component = "0.217"
wit-parser = "0.217"
wasm-pkg-core = { version = "0.7.3", path = "crates/wasm-pkg-core" }
wasm-pkg-core = { version = "0.7.4", path = "crates/wasm-pkg-core" }
5 changes: 4 additions & 1 deletion crates/wasm-pkg-core/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ impl<'a> DependencyResolver<'a> {
_ => None,
};

if !force_override && self.resolutions.contains_key(name) {
if !force_override
&& (self.resolutions.contains_key(name) || self.dependencies.contains_key(name))
{
tracing::debug!(%name, "dependency already exists and override is not set, ignoring");
return Ok(());
}
Expand Down Expand Up @@ -545,6 +547,7 @@ async fn load_package<'b>(
}
}

#[derive(Debug)]
struct RegistryDependency {
/// The canonical package name of the registry package. In most cases, this is the same as the
/// name but could be different if the given package name has been remapped
Expand Down

0 comments on commit 3c34508

Please sign in to comment.