Skip to content

[OPENJPA-3088] Make the build reproducible - #338

Merged
rzo1 merged 1 commit into
masterfrom
OPENJPA-3088
Dec 4, 2026
Merged

rzo1 merged 1 commit into
masterfrom
OPENJPA-3088

Conversation

@rzo1

@rzo1 rzo1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

OPENJPA-3088: makes the build reproducible, so the release artifacts can be rebuilt from the tag and the source release in the Maven staging repository and in ATR is the same file.

Two release builds of the same commit (-Dbuilddocs -DperformRelease -Papache-release) differed in three places:

  • Jar manifests: Implementation-Build and Implementation-Date held the time of the build, from buildnumber-maven-plugin and in the locale of the machine. Implementation-Date is now project.build.outputTimestamp; Implementation-Build and the plugin are removed. Nothing in the code reads either entry.
  • Manual: every HTML page had a "Last updated" footer with the time of the checkout, the PDF had the build time, and the copyright year came from the build clock. They now come from the output timestamp.
  • Assemblies: they stored the file permissions of the working tree, so openjpa-parent-x.y.z-source-release.zip changed with the umask. They now store 0644 for files and 0755 for directories. The two shell scripts in the source release (dev-tools/atr/check-release.sh, openjpa-integration/tck/run-tck32.sh) therefore are not executable in the zip; the binary archive has no scripts.

project.build.outputTimestamp is declared in the root pom.xml, set to the 4.2.0 release time; release:prepare sets it from now on.

Verification:

  • All 343 jars and archives of two release builds with docs are identical; the builds ran in different directories and time zones, under umask 022 and 002.
  • The source release has the same SHA-256 under umask 022, 002 and 077.
  • artifact:compare against an installed first build reports 82 matching files and no difference.

The builds ran with -DskipTests on JDK 25. Under a umask stricter than 022 the jars (not the assemblies) still differ, as maven-jar-plugin stores the permissions of the build tree; RELEASING.md says so in the new "Reproducible builds" section, which also describes how to check a build and a release.

Declare project.build.outputTimestamp in the root pom.xml, set to the
time of the 4.2.0 release; maven-release-plugin sets it to the release
time from now on.

Two builds of the same commit differed in three places:

- The jar manifests had Implementation-Build and Implementation-Date
  with the time of the build, from buildnumber-maven-plugin and in the
  locale of the machine. Implementation-Date is now the output timestamp,
  Implementation-Build and the plugin are removed.
- The manual had a "Last updated" footer with the time of the checkout
  on every HTML page, the build time in the PDF and the year of the
  build in the copyright line. They now come from the output timestamp.
- The assemblies stored the file permissions of the working tree, so the
  source release changed with the umask. They now store 0644 for files
  and 0755 for directories.

With these changes all 343 jars and archives of two release builds with
docs are identical (different directory, time zone and umask), and
artifact:compare reports no difference. RELEASING.md describes how to
check a build and a release.
@rzo1
rzo1 requested review from cristof and solomax December 4, 2026 09:28

@solomax solomax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! :)

@rzo1
rzo1 merged commit 0a4e085 into master Dec 4, 2026
5 checks passed
@rzo1
rzo1 deleted the OPENJPA-3088 branch December 4, 2026 18:29
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