Skip to content
Myr

Merge pull request #420 from dtolnay/enotempty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Allow build-script cleanup failure with NFSv3 output directory to be non-fatal

authored by David Tolnay · committed by GitHub · parents f5e145c, 8cf66f7 · Browse files · 1 file+10 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−1 removed

  • other:+10 added−1 removed

1 file+10 added−1 removed

modified:build.rs+10 added-1 removed
183 unmodified lines
184 // Clean up to avoid leaving nondeterministic absolute paths in the dep-info185 // file in OUT_DIR, which causes nonreproducible builds in build systems186 // that treat the entire OUT_DIR as an artifact.187 if let Err(err) = fs::remove_dir_all(&out_subdir) {188 if err.kind() != ErrorKind::NotFound {188 // libc::ENOTEMPTY189 // Some filesystems (NFSv3) have timing issues under load where '.nfs*'190 // dummy files can continue to get created for a short period after the191 // probe command completes, breaking remove_dir_all.192 // To be replaced with ErrorKind::DirectoryNotEmpty (Rust 1.83+).193 const ENOTEMPTY: i32 = 39;194195 if !(err.kind() == ErrorKind::NotFound196 || (cfg!(target_os = "linux") && err.raw_os_error() == Some(ENOTEMPTY)))197 {198 eprintln!("Failed to clean up {}: {}", out_subdir.display(), err);199 process::exit(1);200 }201 }
24 unmodified lines