Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Peter Kjellerstedt" <peter.kjellerstedt@axis.com>
To: Mark Hatle <mark.hatle@kernel.crashing.org>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][PATCH 1/2] reproducible_build: Honor BUILD_REPRODUCIBLE_BINARIES
Date: Thu, 9 Sep 2021 09:16:05 +0000	[thread overview]
Message-ID: <39a00ec1151548b59c2b39db0b12bd4c@axis.com> (raw)
In-Reply-To: <20210909025100.119427-2-mark.hatle@kernel.crashing.org>

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Mark Hatle
> Sent: den 9 september 2021 04:51
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core][PATCH 1/2] reproducible_build: Honor
> BUILD_REPRODUCIBLE_BINARIES
> 
> From: Mark Hatle <mark.hatle@xilinx.com>
> 
> A variable BUILD_REPRODUCIBLE_BINARIES is set to '1' by default and was> used
> to control if the postfuncs were added.  However, it didn't actually disable
> the reproducible_build (date) logic.  This resulted in the program falling
> back to the default date.
> 
> This change fully honors the variable and disables the various pieces
> that discover and configure the SOURCE_DATE_EPOCH if the value if not
> set to '1'.
> 
> Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
> Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
> ---
>  meta/classes/reproducible_build.bbclass | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/reproducible_build.bbclass
> b/meta/classes/reproducible_build.bbclass
> index 378121903d..a9c117c3b9 100644
> --- a/meta/classes/reproducible_build.bbclass
> +++ b/meta/classes/reproducible_build.bbclass
> @@ -47,7 +47,9 @@ TARGET_CC_ARCH:append:class-target = " -Wdate-time"
>  # A SOURCE_DATE_EPOCH of '0' might be misinterpreted as no SDE
>  export SOURCE_DATE_EPOCH_FALLBACK ??= "1302044400"
> 
> -SSTATETASKS += "do_deploy_source_date_epoch"
> +# The following are preformed in the anonymous python function, only if

Change "are preformed" to "is performed".

> +# BUILD_REPRODUCIBLE_BINARIES == 1
> +#SSTATETASKS += "do_deploy_source_date_epoch"
> 
>  do_deploy_source_date_epoch () {
>      mkdir -p ${SDE_DEPLOYDIR}
> @@ -73,8 +75,10 @@ python do_deploy_source_date_epoch_setscene () {
> 
>  do_deploy_source_date_epoch[dirs] = "${SDE_DEPLOYDIR}"
>  do_deploy_source_date_epoch[sstate-plaindirs] = "${SDE_DEPLOYDIR}"
> -addtask do_deploy_source_date_epoch_setscene
> -addtask do_deploy_source_date_epoch before do_configure after do_patch
> +# The following are preformed in the anonymous python function, only if

Change "preformed" to "performed".

> +# BUILD_REPRODUCIBLE_BINARIES == 1
> +#addtask do_deploy_source_date_epoch_setscene
> +#addtask do_deploy_source_date_epoch before do_configure after do_patch

Alternatively remove the two comments with the moved code since there 
is a large risk that these comments won't be updated if the code below 
is modified and eventually they will be out of sync.

>  python create_source_date_epoch_stamp() {
>      import oe.reproducible
> @@ -123,5 +127,12 @@ BB_HASHBASE_WHITELIST += "SOURCE_DATE_EPOCH"
> 
>  python () {
>      if d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1':
> +        # Generate the timestamp with create_source_date_epoch_stamp.
>          d.appendVarFlag("do_unpack", "postfuncs", " create_source_date_epoch_stamp")
> +        d.appendVar('SSTATETASKS', " do_deploy_source_date_epoch")
> +        bb.build.addtask('do_deploy_source_date_epoch_setscene', None, None, d)
> +        bb.build.addtask('do_deploy_source_date_epoch', 'do_configure', 'do_patch', d)
> +    else:
> +        # If this is set at all, the system components will attempt to use it
> +        d.delVar('SOURCE_DATE_EPOCH')
>  }
> --
> 2.17.1

//Peter


  reply	other threads:[~2021-09-09  9:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  2:50 [OE-core][PATCH 0/2] Fixes for reproducible build and externalsrc Mark Hatle
2021-09-09  2:50 ` [OE-core][PATCH 1/2] reproducible_build: Honor BUILD_REPRODUCIBLE_BINARIES Mark Hatle
2021-09-09  9:16   ` Peter Kjellerstedt [this message]
2021-09-09 10:18   ` Richard Purdie
2021-09-10  0:20     ` Douglas
2021-09-09  2:51 ` [OE-core][PATCH 2/2] reproducible_build: Work with externalsrc Mark Hatle
2021-09-10  0:32   ` Douglas
     [not found]     ` <796dd7e7-6a0d-a585-7765-bb5621db6128@gmail.com>
2021-09-10  1:12       ` Douglas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39a00ec1151548b59c2b39db0b12bd4c@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=mark.hatle@kernel.crashing.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox