RFR: 8282567: Improve source-date handling in build system
Magnus Ihse Bursie
ihse at openjdk.java.net
Fri Mar 4 23:47:58 UTC 2022
On Wed, 2 Mar 2022 18:22:29 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>> When doing reproducible builds, controlling the build time is imperative. To make this as easy as possible, some changes are needed in the build system.
>>
>> * If source-date is set to anything other than "updated" (meaning that it should be determined at build time), then the default value of --with-hotspot-build-time should be the same time.
>>
>> * If the industry standard SOURCE_DATE_EPOCH is set when running configure, the default value for --with-source-date should be picked up from this variable. (If the command line option is given, it will override the environment variable however.)
>>
>> * Finally the code can be made a bit clearer that we can set and export SOURCE_DATE_EPOCH to SOURCE_DATE in spec.gmk, unless we're using the "updated" (determined at build time) value.
>
> I think building.md needs to be updated to reflect these changes, as you no longer need to manually propagate the value of SOURCE_DATE_EPOCH through --with-source-date as the documentation currently suggests.
@erikj79 You are absolutely correct that the documentation needed updating. Thank you for reminding me. When I did that, I also realized I've missed the --with-copyright-year flag, so this is now also set automatically from the source-date. With this change, now we can *really* build reproducible just by setting --with-source-date or SOURCE_DATE_EPOCH.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7660
More information about the build-dev
mailing list