RFR: 8282567: Improve source-date handling in build system [v5]
Erik Joelsson
erikj at openjdk.java.net
Mon Mar 7 14:33:56 UTC 2022
On Sat, 5 Mar 2022 08:57:45 GMT, Magnus Ihse Bursie <ihse 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.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
>
> Test for updated, not current
doc/building.md line 1546:
> 1544: You must also make sure your build does not rely on `configure`'s default adhoc
> 1545: version strings. Default adhoc version strings `OPT` segment include user name,
> 1546: source directory and timestamp. You can either override just the `OPT` segment
The timestamp comes from Oracle internal builds using Jib. If you just use configure, the default OPT string is `adhoc.<username>.<base dir name>`.
As a followup on this, I think we should change jib-profiles.js to extract the date from the buildId and set --with-source-date based on it.
doc/building.md line 1570:
> 1568: * `--with-source-date`
> 1569:
> 1570: This option controls how the JDK build sets SOURCE_DATE_ EPOCH when
Space in variable name. Should it be backtick quoted?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7660
More information about the build-dev
mailing list