Skip to content

Commit 9a77459

Browse files
committed
Auto merge of #12509 - hi-rustin:rustin-patch-revert, r=weihanglo
Hold the mutate exclusive lock when vendoring
2 parents 69255bb + 2e77dc1 commit 9a77459

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cargo/ops/vendor.rs

+2
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)