Skip to content
Merged
Changes from all commits
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
8 changes: 7 additions & 1 deletion src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,13 @@ impl<'gctx> Workspace<'gctx> {

fn default_lock_root(&self) -> Filesystem {
if self.root_maybe().is_embedded() {
self.build_dir()
// Include a workspace hash in case the user requests a shared build-dir so that
// scripts don't fight over the `Cargo.lock` content
let workspace_manifest_path = self.root_manifest();
let real_path = std::fs::canonicalize(workspace_manifest_path)
.unwrap_or_else(|_err| workspace_manifest_path.to_owned());
let hash = crate::util::hex::short_hash(&real_path);
self.build_dir().join(hash)
} else {
Filesystem::new(self.root().to_owned())
}
Expand Down