Skip to content

Conversation

cunei
Copy link

@cunei cunei commented Dec 1, 2017

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
Fixes #3545

@cunei
Copy link
Author

cunei commented Dec 5, 2017

I need a place to run exactly once, during startup, a quick test in the source directory in order to check for the availability of precise timestamps. Something like:

sbt.internal.io.Milli.getMilliSupportDiagnostic(sourceDirectory.value) map log.debug

It can be done at any stage during startup. If native support for milliseconds is not available on that filesystem or OS, it will generate an informational message like:

Your filesystem does not seem to support sub-second file timestamps (ext2/ext3,
for instance, have a 1 sec resolution). That may affect sbt's ability to detect
rapid file changes.

It can be either logged as a debug or info level message. Any suggestions as to the best place to place this line? @eed3si9n @dwijnand

@cunei cunei changed the base branch from 1.0.x to 1.1.x December 6, 2017 19:53
@cunei
Copy link
Author

cunei commented Dec 11, 2017

Please do not merge yet

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaked cunei#1

Antonio Cunei added 7 commits December 14, 2017 12:17
This reverts commit 4ac231d.
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().
@dwijnand
Copy link
Member

Superseded by #3816.

@typesafe-tools
Copy link

The validator has checked the following projects against Scala 2.12, 2.11,
tested using dbuild, projects built on top of each other.

Project Reference Commit
sbt pull/3789/head 5089471
zinc pull/463/head sbt/zinc@717b248
io pull/100/head sbt/io@8c5947b
librarymanagement pull/189/head sbt/librarymanagement@0b496f4
util pull/134/head sbt/util@3d9eab1
website 1.x

❌ The result is: FAILED
(restart)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants