Skip to content

Commit

Permalink
add a comment regarding staging dir placement
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 12, 2024
1 parent 98331ef commit 10ebcf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,10 @@ panic = 'unwind'
}

// Create a staging dir that will become the target sysroot dir (so that we can do the final
// installation atomically).
// installation atomically). By creating this directory inside `sysroot_dir`, we ensure that
// it is on the same file system (so `fs::rename`) works. This also means that the mtime of
// `sysroot_dir` gets updated, which rustc bootstrap relies on as a signal that a rebuild
// happened.
fs::create_dir_all(&self.sysroot_dir).context("failed to create sysroot dir")?; // TempDir expects the parent to already exist
let staging_dir =
TempDir::new_in(&self.sysroot_dir).context("failed to create staging dir")?;
Expand Down

0 comments on commit 10ebcf6

Please sign in to comment.