[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: Re: RFR: 8238650: Allow to override buildDate with SOURCE_DATE_EPOCH
From: Kevin Rushforth <kcr () openjdk ! java ! net>
Date: 2020-02-27 0:03:39
Message-ID: Z5mSab7Et5_LBsEnDSoKHPV-jWbbOBVehjHI9SR1wqM=.171bd390-b181-4106-aad1-b8b59e8bbbfb () github ! com
[Download RAW message or body]
On Wed, 29 Jan 2020 08:58:47 GMT, Bernhard M. Wiedemann \
<github.com+637990+bmwiedemann@openjdk.org> wrote:
> Allow to override buildDate with `SOURCE_DATE_EPOCH`
> in order to make builds reproducible.
> See https://reproducible-builds.org/ for why this is good
> and https://reproducible-builds.org/specs/source-date-epoch/
> for the definition of this variable.
>
> This PR was done while working on reproducible builds for openSUSE.
Finally getting to this (sorry for the delay). This seems OK to me, as it is not an \
intrusive change. I do not think that actually setting this property for production \
builds is a good idea, so I recommend against that (ultimately that will be up to \
Gluon or whoever produces builds).
I'll test it once you change it from an env variable to a gradle property.
build.gradle line 542:
> 541:
> 542: def buildDate = System.getenv("SOURCE_DATE_EPOCH") == null ? new \
> java.util.Date() : new java.util.Date(1000 * \
> Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")))
> 543: def buildTimestamp = new \
> java.text.SimpleDateFormat("yyyy-MM-dd-HHmmss").format(buildDate)
This should be defined as a gradle property using `defineProperty` like this:
defineProperty("SOURCE_DATE_EPOCH", "")
You can then test for `SOURCE_DATE_EPOCH == ""`
You would pass it into the build via `gradle -PSOURCE_DATE_EPOCH=...`
I also recommend wrapping the line since it's pretty long.
While you are at it, can you add `BUILD_TIMESTAMP` to the list of properties that are \
logged? Look for `log.quiet`.
-------------
PR: https://git.openjdk.java.net/jfx/pull/99
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic