Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::{collections::BTreeMap, path::Path};
use std::{
collections::{BTreeMap, BTreeSet},
Comment thread
mara-schulke marked this conversation as resolved.
Outdated
path::Path,
};

use miette::{Context, IntoDiagnostic, ensure};
use semver::Version;
Expand Down Expand Up @@ -654,8 +657,11 @@ impl TryFrom<Vec<LockedPackage>> for WorkspaceLockfile {
locked.digest
);
}
// Dependencies should be identical for same (name, version)
if existing.dependencies != locked.dependencies {
// Dependencies are conceptually an unordered set for a
// given (name, version) — compare without regard to order.
let existing_deps: BTreeSet<_> = existing.dependencies.iter().collect();
let locked_deps: BTreeSet<_> = locked.dependencies.iter().collect();
if existing_deps != locked_deps {
tracing::warn!(
"dependencies mismatch for {}@{}: {:?} vs {:?}. Using first seen.",
locked.name,
Expand Down
Loading