Skip to content

Commit 2e77dc1

Browse files
committed
fix(vendor): use mutate exclusive lock when vendoring
Signed-off-by: hi-rustin <[email protected]>
1 parent 1a2666d commit 2e77dc1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cargo/ops/vendor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::core::{GitReference, Package, Workspace};
44
use crate::ops;
55
use crate::sources::path::PathSource;
66
use crate::sources::CRATES_IO_REGISTRY;
7+
use crate::util::cache_lock::CacheLockMode;
78
use crate::util::{try_canonicalize, CargoResult, Config};
89
use anyhow::{bail, Context as _};
910
use cargo_util::{paths, Sha256};
@@ -31,6 +32,7 @@ pub fn vendor(ws: &Workspace<'_>, opts: &VendorOptions<'_>) -> CargoResult<()> {
3132
extra_workspaces.push(ws);
3233
}
3334
let workspaces = extra_workspaces.iter().chain(Some(ws)).collect::<Vec<_>>();
35+
let _lock = config.acquire_package_cache_lock(CacheLockMode::MutateExclusive)?;
3436
let vendor_config = sync(config, &workspaces, opts).with_context(|| "failed to sync")?;
3537

3638
if config.shell().verbosity() != Verbosity::Quiet {

0 commit comments

Comments
 (0)