From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH 3/5] image-artifact-names: Use SOURCE_DATE_EPOCH when making reproducible builds
Date: Sun, 03 Oct 2021 14:35:17 +0100 [thread overview]
Message-ID: <96f84cbbf6a5652b7a7a16ffaa5cdbd2bfeac5f2.camel@linuxfoundation.org> (raw)
In-Reply-To: <16AA56A68DAA9487.23650@lists.openembedded.org>
On Sat, 2021-10-02 at 23:18 +0100, Richard Purdie via lists.openembedded.org
wrote:
> Using DATETIME means the deploy output is not deterministic. Use SDE
> when using reproducible builds since it is consistent for given input data.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> meta/classes/image-artifact-names.bbclass | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/image-artifact-names.bbclass b/meta/classes/image-artifact-names.bbclass
> index 3ac8dd731a6..df9e17c6b0f 100644
> --- a/meta/classes/image-artifact-names.bbclass
> +++ b/meta/classes/image-artifact-names.bbclass
> @@ -4,7 +4,7 @@
>
> IMAGE_BASENAME ?= "${PN}"
> IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
> -IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME"
> +IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH"
> IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
> IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
>
> @@ -13,3 +13,10 @@ IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
> # by default) followed by additional suffices which describe the format (.ext4,
> # .ext4.xz, etc.).
> IMAGE_NAME_SUFFIX ??= ".rootfs"
> +
> +python () {
> + if bb.data.inherits_class('reproducible_build', d):
> + import datetime
> + d.setVar("IMAGE_VERSION_SUFFIX", "-" + datetime.datetime.fromtimestamp(int(d.getVar("SOURCE_DATE_EPOCH")), datetime.timezone.utc).strftime('%Y%m%d%H%M%S'))
> + d.setVarFlag("IMAGE_VERSION_SUFFIX", "vardepvalue", "")
> +}
This patch is incorrect. It breaks images as they have noexec do_unpack tasks.
Cheers,
Richard
prev parent reply other threads:[~2021-10-03 13:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 22:17 [PATCH 1/5] externalsrc: Fix a source date epoch race in reproducible builds Richard Purdie
2021-10-02 22:18 ` [PATCH 2/5] sstatesig: Add processing for full build paths in sysroot files Richard Purdie
2021-10-02 22:18 ` [PATCH 3/5] image-artifact-names: Use SOURCE_DATE_EPOCH when making reproducible builds Richard Purdie
2021-10-03 2:09 ` [OE-core] " Peter Kjellerstedt
2021-10-02 22:18 ` [PATCH 4/5] abi_version/sstate: Bump HASH_VERSION and SSTATE_VERSION Richard Purdie
2021-10-03 9:59 ` [OE-core] " Jose Quaresma
2021-10-03 10:28 ` Richard Purdie
2021-10-03 21:47 ` Jose Quaresma
2021-10-02 22:18 ` [PATCH 5/5] python3: Drop broken pyc files Richard Purdie
[not found] ` <16AA56A68DAA9487.23650@lists.openembedded.org>
2021-10-03 13:35 ` Richard Purdie [this message]
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=96f84cbbf6a5652b7a7a16ffaa5cdbd2bfeac5f2.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.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