builder: exclude namespace mounts from Cargo clean
This commit is contained in:
@@ -95,13 +95,15 @@ impl Builder {
|
||||
// Cargo clean must remove its directory, not a namespace mount point.
|
||||
let target_mount = base.join("target");
|
||||
let target = target_mount.join("cargo");
|
||||
// Keep /tmp's namespace mountpoints outside the directory Cargo clean removes.
|
||||
let temporary = target_mount.join("tmp");
|
||||
let registry = base.join("cargo");
|
||||
let cache = base.join("kache");
|
||||
if source.exists() {
|
||||
std::fs::remove_dir_all(&source)?;
|
||||
}
|
||||
let before = files::copy_out(self.root.as_ref(), &workspace, &source).await?;
|
||||
for path in [&target, ®istry, &cache, &target.join("tmp")] {
|
||||
for path in [&target, ®istry, &cache, &temporary] {
|
||||
std::fs::create_dir_all(path)?;
|
||||
}
|
||||
std::fs::write(
|
||||
@@ -187,7 +189,7 @@ impl Builder {
|
||||
"/nix/store",
|
||||
])
|
||||
.arg("--bind")
|
||||
.arg(target.join("tmp"))
|
||||
.arg(&temporary)
|
||||
.arg("/tmp")
|
||||
.arg("--ro-bind")
|
||||
.arg(executable("sh")?)
|
||||
|
||||
Reference in New Issue
Block a user