-
Notifications
You must be signed in to change notification settings - Fork 42
Steps towards reproducible builds #234
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
base: main
Are you sure you want to change the base?
Steps towards reproducible builds #234
Conversation
Previously all class files and resources were added to the built jars with the build time. With this change the jar, war, and zip tasks will use the time stamp from the HEAD commit as the modified times of the entries in order to work towards reproducable builds. If unable to get the modified time of the last commit, the value will default to the timestamp of when the openintegrationengine.org domain was registered. Signed-off-by: Tony Germano <tony@germano.name>
This patch updates the Ant build process to include Git versioning
information in the generated Javadocs and ensures the build remains
robust in environments without Git.
Changes include:
- Implemented a new `exec-with-default` macro in `mirth-build.xml`. This
safely attempts to retrieve the Git hash and version name but falls
back to default values ("unknown") if the `.git` directory is missing
(e.g., source tarballs) or Git is not installed.
- Updated the Javadoc target to inject a footer containing the build
version.
- Added conditional logic to render a hyperlink to the GitHub commit
only if the revision is available; otherwise, it renders plain text.
- Added the `-notimestamp` flag to the Javadoc task to support
reproducible builds (ensuring identical output for identical input).
- Refactored argument passing (switched from `line` to `value`) and
added proper Ant namespaces for conditional execution.
Signed-off-by: Tony Germano <tony@germano.name>
|
The bottom text on the javadoc pages looks like this:
|
mgaffigan
left a comment
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.
Can we get a more obviously "false" value? 2000-01-01 00:00:00 or 2099-12-31 00:00:00 come to mind.
Git seems a safe build dependency, and handling its absence seems likely to silently break over time. Let's make it required, with a fallback that the values can be passed explicitly. (Call git if the value is not set, but an error is an error).
The default values for the following properties are now specified in the .properties files in the event that git is unavailable when building the project: - git.commit.timestamp - git.commit.hash - git.commit.name The default properties have the same names as the properties above with a `.default` suffix. Signed-off-by: Tony Germano <tony@germano.name>
Setting the value of this property to true will omit the `--dirty` flag to `git describe` when generating the `git.commit.name`. This is helpful when comparing the build output to a previous build after making an uncommited change. Signed-off-by: Tony Germano <tony@germano.name>
Set checkout action options to perform a partial clone that omits all blob objects (files) and trees except for those that belong to the head commit. All commit objects and tags will be downloaded to allow `git describe` to work in the CI environment. Signed-off-by: Tony Germano <tony@germano.name>
With this PR, normally the first thing the build echoes out looks like this: When the git calls fail it looks like: If git isn't present (like if someone unpacked a sources.tar.gz,) then it makes sense to default back to some other values to allow the build to continue without failing, because these values are only metadata. Originally, I had the default timestamp set to unix epoch, but it turns out that the zip structure is based on the 16-bit FAT filesystem, and doesn't support dates that early. Since I was picking an arbitrary date, I made it related to the project, but it's not necessarily a failure condition (I intentionally set I pushed a change that moves the default values for when Since ant properties are immutable, the actual properties ( The description of this PR has been edited to include all of the commit messages for the original and additional commits. |
Fine, make it fail gracefully, but use the current date - not some fixed default.
I don't know what environments you work in, but a random second in 2023 is an unremarkable date. A fair number of systems I work with still start with 201X. I only killed the 1990's in 2016. I'm worried about the ops folks in 2030, not someone who has access to build output. I have no problem with
|

I recommend looking at the commits individually. See commit messages for details.
After these changes, the only files that remain different in the setup folder between two consecutive builds are
mirth-client-core.jar, due to theversion.propertiesfile which still contains the build timestamp. I did not want to tackle that one in this same PR since it will require code changes, as that value is used in a ConfigurationController API method.Edit: Here are the commit messages for each commit after the most recent push
commit cae3da4
Author: Tony Germano tony@germano.name
Date: Thu Jan 1 00:38:59 2026 -0500
commit ab34440
Author: Tony Germano tony@germano.name
Date: Thu Jan 1 23:46:40 2026 -0500
commit 63dfe1f
Author: Tony Germano tony@germano.name
Date: Tue Jan 6 01:51:48 2026 -0500
commit 7c6f617
Author: Tony Germano tony@germano.name
Date: Tue Jan 6 02:00:25 2026 -0500
commit bfd8064
Author: Tony Germano tony@germano.name
Date: Tue Jan 6 01:11:54 2026 -0500