Skip to content

Commit 5a9ff8a

Browse files
committed
install-upgrade: Add some more comments.
1 parent 9ecdfe0 commit 5a9ff8a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/cargo/ops/cargo_install.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ fn install_one(
278278
Ok(duplicates)
279279
};
280280

281+
// WARNING: no_track does not perform locking, so there is no protection
282+
// of concurrent installs.
281283
if no_track {
282284
// Check for conflicts.
283285
no_track_duplicates()?;

src/cargo/ops/common_for_install_and_uninstall.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ impl InstallTracker {
186186
//
187187
// There may be multiple matching duplicates if different versions of
188188
// the same package installed different binaries.
189+
//
190+
// This does not check the source_id in order to allow the user to
191+
// switch between different sources. For example, installing from git,
192+
// and then switching to the official crates.io release or vice-versa.
193+
// If the source_id were included, then the user would get possibly
194+
// confusing errors like "package `foo 1.0.0` is already installed"
195+
// and the change of source may not be obvious why it fails.
189196
let matching_duplicates: Vec<PackageId> = duplicates
190197
.values()
191198
.filter_map(|v| match v {

0 commit comments

Comments
 (0)