Skip to content

Commit f2df1f5

Browse files
author
Nikolay Merinov
committedDec 1, 2017
build_helper: destination file can't be up to date when not exists
Function "up_to_date" return incorrect result if mtime for all fetched sources is set to epoch time. Add existence check to function.
1 parent 804b15b commit f2df1f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/build_helper/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ pub fn mtime(path: &Path) -> FileTime {
190190
///
191191
/// Uses last-modified time checks to verify this.
192192
pub fn up_to_date(src: &Path, dst: &Path) -> bool {
193+
if !dst.exists() {
194+
return false;
195+
}
193196
let threshold = mtime(dst);
194197
let meta = match fs::metadata(src) {
195198
Ok(meta) => meta,

0 commit comments

Comments
 (0)
Please sign in to comment.