RFR: 8275745: Reproducible copyright headers

Emmanuel Bourg duke at openjdk.java.net
Fri Oct 22 06:29:03 UTC 2021


On Thu, 21 Oct 2021 23:33:35 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> The copyright headers are generated at build time, and the year inserted in the template depends on the current date. This means the headers are not reproducible if the project is built a year later. The year in the headers could be derived from the SOURCE_DATE_EPOCH environment variable to make the build reproducible (this variable is already used in other parts of the build).
>
> I can't set the issue for you, but if you prepend "8275745: " to the PR title, things will work out.

@magicus Thank you for filing the issue!

> Do you test reproducibility by changing the date drastically?

Yes, Debian has a test framework dedicated to finding reproducibility issue such as this one.

> we already have a configure option --with-copyright-year and I think the correct solution is to propagate that value into the Java tools that creates the source code.

Why not, but ideally if `--with-copyright-year` isn't specified at build time it should defaults to the year specified by the `SOURCE_DATE_EPOCH` environment variable (if specified). The idea is to have a single parameter, universal across projects, that automatically makes any build reproducible without further configuration.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1498



More information about the build-dev mailing list