RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
Erik Joelsson
erikj at openjdk.java.net
Fri Dec 17 17:59:24 UTC 2021
On Fri, 17 Dec 2021 09:18:03 GMT, Andrew Leonard <aleonard at openjdk.org> wrote:
> If "reproducible build" is enabled, then utilize the new --date option in the building of jar's and jmods.
> Validating the boot jdk supports --date for the building of the jars.
>
> Signed-off-by: Andrew Leonard <anleonar at redhat.com>
make/common/JarArchive.gmk line 234:
> 232: endif
> 233: else
> 234: $1_JAR_OPTIONS := $$($1_JAR_SOURCE_DATE)
Instead of adding $$($1_JAR_SOURCE_DATE) to every branch of this conditional, you can use += to build the $1_JAR_OPTIONS variable one step at a time. I don't think we need a separate variable JAR_SOURCE_DATE.
make/common/MakeBase.gmk line 148:
> 146: ifeq ($(SOURCE_DATE_ISO_8601), )
> 147: # GNU date format did not work, try BSD date options
> 148: SOURCE_DATE_ISO_8601 := $(shell $(DATE) -u -j -f "%s" "$(SOURCE_DATE_EPOCH)" +"%Y-%m-%dT%H:%M:%SZ" 2> /dev/null)
Could we maybe figure out the date command line to use in configure instead to avoid the trial and error at build time?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6878
More information about the build-dev
mailing list