File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1193,6 +1193,7 @@ fn simple_deps_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
1193
1193
let dep = dep. unwrap ( ) ;
1194
1194
if filetime:: FileTime :: from_last_modification_time ( & dep. metadata ( ) . unwrap ( ) ) <= timestamp {
1195
1195
fs:: remove_file ( dep. path ( ) ) . unwrap ( ) ;
1196
+ println ! ( "remove: {:?}" , dep. path( ) ) ;
1196
1197
cleand = true ;
1197
1198
}
1198
1199
}
@@ -1235,6 +1236,9 @@ fn simple_deps_cleaner_dose_not_rebuild() {
1235
1236
sleep_ms ( 1000 ) ;
1236
1237
}
1237
1238
let timestamp = filetime:: FileTime :: from_system_time ( SystemTime :: now ( ) ) ;
1239
+ if is_coarse_mtime ( ) {
1240
+ sleep_ms ( 1000 ) ;
1241
+ }
1238
1242
// This dose not make new files, but it dose update the mtime.
1239
1243
p. cargo ( "build" )
1240
1244
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
@@ -1275,6 +1279,7 @@ fn fingerprint_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
1275
1279
<= timestamp
1276
1280
} ) {
1277
1281
fs:: remove_dir_all ( fing. path ( ) ) . unwrap ( ) ;
1282
+ println ! ( "remove: {:?}" , fing. path( ) ) ;
1278
1283
// a real cleaner would remove the big files in deps and build as well
1279
1284
// but fingerprint is sufficient for our tests
1280
1285
cleand = true ;
@@ -1320,6 +1325,9 @@ fn fingerprint_cleaner_dose_not_rebuild() {
1320
1325
sleep_ms ( 1000 ) ;
1321
1326
}
1322
1327
let timestamp = filetime:: FileTime :: from_system_time ( SystemTime :: now ( ) ) ;
1328
+ if is_coarse_mtime ( ) {
1329
+ sleep_ms ( 1000 ) ;
1330
+ }
1323
1331
// This dose not make new files, but it dose update the mtime.
1324
1332
p. cargo ( "build" )
1325
1333
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
Original file line number Diff line number Diff line change @@ -1603,6 +1603,9 @@ pub fn sleep_ms(ms: u64) {
1603
1603
1604
1604
/// Returns true if the local filesystem has low-resolution mtimes.
1605
1605
pub fn is_coarse_mtime ( ) -> bool {
1606
+ // If the filetime crate is being used to emulate HFS then
1607
+ // return true, without looking at the actual hardware.
1608
+ cfg ! ( emulate_second_only_system) ||
1606
1609
// This should actually be a test that $CARGO_TARGET_DIR is on an HFS
1607
1610
// filesystem, (or any filesystem with low-resolution mtimes). However,
1608
1611
// that's tricky to detect, so for now just deal with CI.
You can’t perform that action at this time.
0 commit comments