-
Notifications
You must be signed in to change notification settings - Fork 950
Convert lastModified() calls to the more precise getModifiedTime() + modules bump #3816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 4ac231d.
# > test | ||
# -> check | ||
> test | ||
-> check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fork-parallel failed 3 times in a row on Travis:
[error] x tests / fork-parallel
[error] Cause of test exception: {line 2} Command succeeded but failure was expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the relevant restore commit, and drop "Fixes #3545" from the PR desc, and merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea. That what I was thinking too.
In Eval there is a calculation of hashes by scanning the elements of classpath, and getting the last modification time of each directory. When lastModified() was in use, non-existent elements would return 0L, but getModifiedTime() will throw an exception instead (like getLastModifiedTime(), incidentally). So, we catch the FileNotFoundException and return 0L now as well.
It turns out the code in Sync.scala activiely tries to transfer the invalid modifed time of non-existent files in the source directory over the time of the target file, which may or may not exist. In case it exists, the modification time is set to January 1, 1970. This is arguably a bug in Sync, which should be adjusted to better handle mappings with source files that do not exist. For now, however, we preserve the current behavior, using the deprecated copyLastModified().
This is a continuation of #3789
Use the new native file modification timestamps, which return times with full millisecond precisions whenever possible. Re-enables the tests run/error and tests/fork-parallel.
Depends on sbt/zinc#463
See: sbt/io#92
Fixes #3543