[OE-core] [oe-commits] [openembedded-core] 02/03: reproducible_build_simple.bbclass: simple environment for reproducible binaries

Martin Jansa martin.jansa at gmail.com
Sun Mar 18 14:06:28 UTC 2018


Hi,

There seems to be small issue when people set BUILD_REPRODUCIBLE_BINARIES =
"1" without exporting SOURCE_DATE_EPOCH like this .bbclass does

In kernel.bbclass change from:
http://git.openembedded.org/openembedded-core/commit/meta/classes/kernel.bbclass?id=012a70da7ae0617740cd0cf807d01c3cd912c823

you're comparing SOURCE_DATE_EPOCH with 0 which doesn't seem to be set
anywhere, so by default it's empty which leads to kernel build failure like
this:

DEBUG: Executing shell function do_compile
date: invalid date '@'
WARNING: exit code 1 from a shell command.

because empty SOURCE_DATE_EPOCH is used in "ts=`LC_ALL=C date -d
@$SOURCE_DATE_EPOCH`". Testing SOURCE_DATE_EPOCH for empty or "0" allows to
use REPRODUCIBLE_TIMESTAMP_ROOTFS as a default value again.

These build failures seem to be triggered in all my builds since
kernel.bbclass was fixed to respect BUILD_REPRODUCIBLE_BINARIES in:
http://git.openembedded.org/openembedded-core/commit/meta/classes/kernel.bbclass?id=27f87bbc8395a2481ef808465a62d213a6b678ac

One way to fit it would be to inherit reproducible_build_simple.bbclass,
but this requirement to set exported SOURCE_DATE_EPOCH doesn't seem to be
documented anywhere and looking at kernel.bbclass changes it probably
wasn't even intended like that.

Thanks

On Mon, Mar 12, 2018 at 11:06 PM, <git at git.openembedded.org> wrote:

> This is an automated email from the git hooks/post-receive script.
>
> rpurdie pushed a commit to branch master
> in repository openembedded-core.
>
> commit 5c2685c5ee2f8210a36b9a8591491b6af0482084
> Author: Juro Bystricky <juro.bystricky at intel.com>
> AuthorDate: Sat Mar 10 10:57:49 2018 -0800
>
>     reproducible_build_simple.bbclass: simple environment for
> reproducible binaries
>
>     Export environmental variables needed for binary reproducibility with
> consistent values.
>
>     This class can be used either directly via:
>     INHERIT += "reproducible_build_simple"
>
>     or can be inherited by a more complex/complete bbclass, for example a
> bblass which
>     will crack SOURCE_DATE_EPOCH for each recipe.
>
>     Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
>     Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
> ---
>  meta/classes/reproducible_build_simple.bbclass | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/meta/classes/reproducible_build_simple.bbclass
> b/meta/classes/reproducible_build_simple.bbclass
> new file mode 100644
> index 0000000..dd11cd9
> --- /dev/null
> +++ b/meta/classes/reproducible_build_simple.bbclass
> @@ -0,0 +1,11 @@
> +# Setup default environment for reproducible builds.
> +
> +BUILD_REPRODUCIBLE_BINARIES = "1"
> +
> +export PYTHONHASHSEED = "0"
> +export PERL_HASH_SEED = "0"
> +export TZ = 'UTC'
> +export SOURCE_DATE_EPOCH ??= "1520598896"
> +
> +REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
> +
>
> --
> To stop receiving notification emails like this one, please contact
> the administrator of this repository.
> --
> _______________________________________________
> Openembedded-commits mailing list
> Openembedded-commits at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180318/be8f656e/attachment-0002.html>


More information about the Openembedded-core mailing list