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: 6 additions & 2 deletions cargo-psp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,17 @@ fn prepare_psp_sysroot() -> Result<()> {
// Check if we can skip re-creating the sysroot.
let marker = dest.join(".psp-sysroot-stamp");
if marker.exists() {
// Re-create if any overlay file is newer than the marker.
// Re-create if overlay or rust-src is newer than the marker.
let marker_time = fs::metadata(&marker)
.and_then(|m| m.modified())
.unwrap_or(SystemTime::UNIX_EPOCH);

let overlay_modified = newest_mtime(&overlay_src)?;
if overlay_modified <= marker_time {
let rust_src_modified = fs::metadata(rust_src.join("library/Cargo.lock"))
.and_then(|m| m.modified())
.unwrap_or_else(|_| SystemTime::now());

if overlay_modified <= marker_time && rust_src_modified <= marker_time {
eprintln!("[NOTE]: PSP sysroot is up-to-date, skipping preparation.");
return Ok(());
}
Expand Down