Skip to content

Conversation

raboof
Copy link
Contributor

@raboof raboof commented Nov 14, 2019

This makes the build more deterministic.

This is a continuation of the work in sbt/io#58 , which I decided to get back into partly because Maven has been adding features to the core plugins, and it would be good to be on par :).

As discussed in sbt/io#58, we should be careful about the risk of breaking incremental builds - I haven't found any such issues yet though. Note that this PR only affects the timestamps of entries in jars: timestamps of classes on the filesystem and the filesystem timestamp of the jar itself are not affected.

Discussing this with @eed3si9n, there could be special-purposes build configurations that (for example in order to avoid deleting/creating many files) compile classes directly into a jar rather than first to individual files. I haven't seen this configuration yet, but I suspect it wouldn't use Defaults.packageTask, but a custom Package/IO invocation. Any custom build configuration that requires non-static timestamps can pass None as the time parameter to keep the original behavior.

This PR requires sbt/io#279

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

overall LGTM, minor feedback.

@@ -1400,7 +1400,7 @@ object Defaults extends BuildCommon {
Def.task {
val config = packageConfiguration.value
val s = streams.value
Package(config, s.cacheStoreFactory, s.log)
Package(config, s.cacheStoreFactory, s.log, Some(0))
Copy link
Member

Choose a reason for hiding this comment

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

+1

@typesafe-tools
Copy link

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

Project Reference Commit
sbt pull/5233/head c53b2b0
zinc develop sbt/zinc@37665fc
io pull/280/head sbt/io@07c2c30
librarymanagement develop sbt/librarymanagement@574be6f
util develop sbt/util@098796c

❌ The result is: FAILED
(restart)

@typesafe-tools
Copy link

A validation involving this pull request is in progress...

@typesafe-tools
Copy link

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

Project Reference Commit
sbt pull/5233/head c53b2b0
zinc develop sbt/zinc@37665fc
io develop sbt/io@1abf2c6
librarymanagement develop sbt/librarymanagement@574be6f
util develop sbt/util@098796c

❌ The result is: FAILED
(restart)

@raboof
Copy link
Contributor Author

raboof commented Nov 25, 2019

The failure reminds of #3893 - should we reopen that one or is this different?

@eed3si9n
Copy link
Member

The failure looks unrelated. Let me restart the job.

@typesafe-tools
Copy link

A validation involving this pull request is in progress...

@eed3si9n
Copy link
Member

btw test test failure shows a case where one has a subproject named a and pp and a task also named pp, and suppose the cursor on the subproject a, then the task-scoped task pp / pp could parse as pp task scoped to pp subproject, and thus violating "An unspecified project axis resolves to the current project" property.

@typesafe-tools
Copy link

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

Project Reference Commit
sbt pull/5233/head c53b2b0
zinc develop sbt/zinc@37665fc
io develop sbt/io@1abf2c6
librarymanagement develop sbt/librarymanagement@574be6f
util develop sbt/util@098796c

✅ The result is: SUCCESS
(restart)

@typesafe-tools
Copy link

A validation involving this pull request is in progress...

@typesafe-tools
Copy link

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

Project Reference Commit
sbt pull/5233/head e1d0734
zinc develop sbt/zinc@37665fc
io develop sbt/io@1abf2c6
librarymanagement develop sbt/librarymanagement@574be6f
util develop sbt/util@098796c

❌ The result is: FAILED
(restart)

@virusdave
Copy link

Any update on this? Deterministic & reproducible build output would be highly useful, and make things like "nixification and caching of sbt projects' outputs" much simpler.

@eed3si9n
Copy link
Member

I think it just needs a new release of IO.

@eed3si9n
Copy link
Member

I forgot to mention that I published IO 1.4.0-M1 a while back - https://repo1.maven.org/maven2/org/scala-sbt/io_2.12/1.4.0-M1/

@raboof
Copy link
Contributor Author

raboof commented Dec 24, 2019

Interesting, that travis failure looks legitimate, looking into it

Edit: found it, sbt/io#281

@typesafe-tools
Copy link

A validation involving this pull request is in progress...

@typesafe-tools
Copy link

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

Project Reference Commit
sbt pull/5233/head dfa204f
zinc develop sbt/zinc@adc5079
io develop sbt/io@d3297b5
librarymanagement develop sbt/librarymanagement@574be6f
util develop sbt/util@098796c

❌ The result is: FAILED
(restart)

@eed3si9n
Copy link
Member

Closing this in favor of #5344

@eed3si9n eed3si9n closed this Dec 29, 2019
@raboof
Copy link
Contributor Author

raboof commented Dec 29, 2019

Thanks!

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.

4 participants