From 8dfdc6dfa8902aafcc87500c8ac07b565c367a99 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:18:36 +0200 Subject: [PATCH] fix(resolver): ensure version is root --- src/linking_file.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/linking_file.rs b/src/linking_file.rs index 9561e21..7f5825b 100644 --- a/src/linking_file.rs +++ b/src/linking_file.rs @@ -237,7 +237,11 @@ impl Project { &self, lockfile: &RootLockfileNode, ) -> Result<(), LinkingDependenciesError> { - let root_deps = lockfile.specifiers.keys().collect::>(); + let root_deps = lockfile + .specifiers + .iter() + .flat_map(|(name, versions)| versions.keys().map(|version| (name.clone(), version))) + .collect::>(); for (name, versions) in &lockfile.children { for (version, resolved_pkg) in versions { @@ -275,7 +279,7 @@ impl Project { })?; } - if root_deps.contains(&name) { + if root_deps.contains(&(name.clone(), version)) { let (specifier, desired_name) = lockfile.root_specifier(resolved_pkg).unwrap(); let linking_dir = &self.path().join(packages_folder( specifier.realm().copied().unwrap_or_default(),