eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
387 stars 145 forks source link

Make GlassFish build reproducible by Maven rules #24367

Closed dmatej closed 1 year ago

dmatej commented 1 year ago

Based on the discussion with @hboutemy in #24366 we have to reach the state when two consecutive builds of the same codebase will have binary equal results.

Simple test - the following command should produce the same artifact size and the same checksum when you execute it twice:

mvn clean install -q -T4C -Pfastest && ll ~/.m2/repository/org/glassfish/main/distributions/glassfish/7.0.4-SNAPSHOT/glassfish-7.0.4-SNAPSHOT.zip && sha512sum ~/.m2/repository/org/glassfish/main/distributions/glassfish/7.0.4-SNAPSHOT/glassfish-7.0.4-SNAPSHOT.zip

What does it mean

  1. Remove all usages of project.build.outputTimestamp property including it's definitions (it is inherited too with a nonsense value of 2020-...)
  2. Remove all usages of git.build.time property including it's definitions
  3. Remove the timestamp related configuration added in 537f247aefd0ed19a040181135fcfe107906b388
  4. Remove the code related to timestamp
  5. Find out why the glassfish.zip differs and fix it (currently I don't have any idea why is it happening)

Relates also to #24284 and #24316

See also

Additional context

There are two conflicting requirements:

We can't have both and current state of things is that the repeatability is preferred. As famous czech nonexisting hero Jara Cimrman told, "You can disapprove, but that's all you can do against it." ;-)

dmatej commented 1 year ago

Seems all related PRs are merged, so I am closing the issues as fixed.