Skip to content

Commit

Permalink
fix(vendor): use mutate exclusive lock when vendoring
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <[email protected]>
  • Loading branch information
Rustin170506 committed Dec 18, 2023
1 parent 1a2666d commit 2e77dc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cargo/ops/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::core::{GitReference, Package, Workspace};
use crate::ops;
use crate::sources::path::PathSource;
use crate::sources::CRATES_IO_REGISTRY;
use crate::util::cache_lock::CacheLockMode;
use crate::util::{try_canonicalize, CargoResult, Config};
use anyhow::{bail, Context as _};
use cargo_util::{paths, Sha256};
Expand Down Expand Up @@ -31,6 +32,7 @@ pub fn vendor(ws: &Workspace<'_>, opts: &VendorOptions<'_>) -> CargoResult<()> {
extra_workspaces.push(ws);
}
let workspaces = extra_workspaces.iter().chain(Some(ws)).collect::<Vec<_>>();
let _lock = config.acquire_package_cache_lock(CacheLockMode::MutateExclusive)?;
let vendor_config = sync(config, &workspaces, opts).with_context(|| "failed to sync")?;

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

0 comments on commit 2e77dc1

Please sign in to comment.