Skip to content

Commit bd3499b

Browse files
committed
bootstrap: never delete the tarball temporary directory
Files in the temporary directory are used by ./x.py install.
1 parent b9c403b commit bd3499b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/bootstrap/dist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,8 @@ impl Step for Extended {
13161316
tarballs.push(mingw_installer.unwrap());
13171317
}
13181318

1319-
let mut tarball = Tarball::new(builder, "rust", &target.triple);
1320-
let work = tarball.persist_work_dir();
1319+
let tarball = Tarball::new(builder, "rust", &target.triple);
1320+
let work = tarball.work_dir();
13211321
tarball.combine(&tarballs);
13221322

13231323
let tmp = tmpdir(builder).join("combined-tarball");

src/bootstrap/tarball.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub(crate) struct Tarball<'a> {
9797

9898
include_target_in_component_name: bool,
9999
is_preview: bool,
100-
delete_temp_dir: bool,
101100
}
102101

103102
impl<'a> Tarball<'a> {
@@ -136,7 +135,6 @@ impl<'a> Tarball<'a> {
136135

137136
include_target_in_component_name: false,
138137
is_preview: false,
139-
delete_temp_dir: true,
140138
}
141139
}
142140

@@ -198,8 +196,7 @@ impl<'a> Tarball<'a> {
198196
self.builder.cp_r(src.as_ref(), &dest);
199197
}
200198

201-
pub(crate) fn persist_work_dir(&mut self) -> PathBuf {
202-
self.delete_temp_dir = false;
199+
pub(crate) fn work_dir(&self) -> PathBuf {
203200
self.temp_dir.clone()
204201
}
205202

@@ -295,9 +292,6 @@ impl<'a> Tarball<'a> {
295292
build_cli(&self, &mut cmd);
296293
cmd.arg("--work-dir").arg(&self.temp_dir);
297294
self.builder.run(&mut cmd);
298-
if self.delete_temp_dir {
299-
t!(std::fs::remove_dir_all(&self.temp_dir));
300-
}
301295

302296
crate::dist::distdir(self.builder).join(format!("{}.tar.gz", package_name))
303297
}

0 commit comments

Comments
 (0)