All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rootfs: Make BUILDNAME a weak default in reproducible_build_simple
@ 2020-01-18  5:41 Alex Kiernan
  2020-02-07 16:27 ` Peter Kjellerstedt
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Kiernan @ 2020-01-18  5:41 UTC (permalink / raw)
  To: openembedded-core

11e45082ad00 ("rootfs-postcommands.bbclass: improve binary
reproducibility") fixed binary reproducibility of /etc/version, but with
the move to reproducibilty in all builds, setting /etc/version to
anything other than the default fixed timestamp is tricky because
rootfs_reproducible() runs very late.

rootfs.py uses BUILDNAME if set for /etc/version, so introduce a weak
default for BUILDNAME of "REPRODUCIBLE_TIMESTAMP_ROOTFS", when enabling
reproducible builds hence allowing BUILDNAME to be overridden elsewhere.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 meta/classes/reproducible_build_simple.bbclass | 1 +
 meta/classes/rootfs-postcommands.bbclass       | 5 -----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/meta/classes/reproducible_build_simple.bbclass b/meta/classes/reproducible_build_simple.bbclass
index d0842f0f902a..153a07607219 100644
--- a/meta/classes/reproducible_build_simple.bbclass
+++ b/meta/classes/reproducible_build_simple.bbclass
@@ -7,5 +7,6 @@ export PERL_HASH_SEED = "0"
 export SOURCE_DATE_EPOCH ??= "1520598896"
 
 REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
+BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"
 
 inherit podfix
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index fdc63bb64d55..ebf96be7e85f 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -356,11 +356,6 @@ python rootfs_log_check_recommends() {
 # Perform any additional adjustments needed to make rootf binary reproducible
 rootfs_reproducible () {
 	if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
-		# Convert UTC into %4Y%2m%2d%2H%2M%2S
-		sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
-		echo $sformatted > ${IMAGE_ROOTFS}/etc/version
-		bbnote "rootfs_reproducible: set /etc/version to $sformatted"
-
 		if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then
 			find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
 			sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rootfs: Make BUILDNAME a weak default in reproducible_build_simple
  2020-01-18  5:41 [PATCH] rootfs: Make BUILDNAME a weak default in reproducible_build_simple Alex Kiernan
@ 2020-02-07 16:27 ` Peter Kjellerstedt
  2020-02-07 17:03   ` Alex Kiernan
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Kjellerstedt @ 2020-02-07 16:27 UTC (permalink / raw)
  To: Alex Kiernan, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
> bounces@lists.openembedded.org> On Behalf Of Alex Kiernan
> Sent: den 18 januari 2020 06:41
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [OE-Core][PATCH] rootfs: Make BUILDNAME a weak default
> in reproducible_build_simple
> 
> 11e45082ad00 ("rootfs-postcommands.bbclass: improve binary
> reproducibility") fixed binary reproducibility of /etc/version, but with
> the move to reproducibilty in all builds, setting /etc/version to
> anything other than the default fixed timestamp is tricky because
> rootfs_reproducible() runs very late.
> 
> rootfs.py uses BUILDNAME if set for /etc/version, so introduce a weak
> default for BUILDNAME of "REPRODUCIBLE_TIMESTAMP_ROOTFS", when enabling
> reproducible builds hence allowing BUILDNAME to be overridden elsewhere.
> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
> 
>  meta/classes/reproducible_build_simple.bbclass | 1 +
>  meta/classes/rootfs-postcommands.bbclass       | 5 -----
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/meta/classes/reproducible_build_simple.bbclass b/meta/classes/reproducible_build_simple.bbclass
> index d0842f0f902a..153a07607219 100644
> --- a/meta/classes/reproducible_build_simple.bbclass
> +++ b/meta/classes/reproducible_build_simple.bbclass
> @@ -7,5 +7,6 @@ export PERL_HASH_SEED = "0"
>  export SOURCE_DATE_EPOCH ??= "1520598896"
> 
>  REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
> +BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"

Can we please revert this change?  This breaks (all?) other usages 
of ${BUILDNAME}. E.g., the information in tmp/buildstats is totally 
useless now since all builds end up in the same directory 
"tmp/buildstats/1520598896", overwriting each other...

> 
>  inherit podfix
> diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
> index fdc63bb64d55..ebf96be7e85f 100644
> --- a/meta/classes/rootfs-postcommands.bbclass
> +++ b/meta/classes/rootfs-postcommands.bbclass
> @@ -356,11 +356,6 @@ python rootfs_log_check_recommends() {
>  # Perform any additional adjustments needed to make rootf binary reproducible
>  rootfs_reproducible () {
>  	if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
> -		# Convert UTC into %4Y%2m%2d%2H%2M%2S
> -		sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
> -		echo $sformatted > ${IMAGE_ROOTFS}/etc/version
> -		bbnote "rootfs_reproducible: set /etc/version to $sformatted"
> -
>  		if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then
>  			find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
>  			sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
> --
> 2.17.1

//Peter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rootfs: Make BUILDNAME a weak default in reproducible_build_simple
  2020-02-07 16:27 ` Peter Kjellerstedt
@ 2020-02-07 17:03   ` Alex Kiernan
  2020-02-09  6:05     ` Peter Kjellerstedt
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Kiernan @ 2020-02-07 17:03 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core

On Fri, Feb 7, 2020 at 4:27 PM Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
>
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
> > bounces@lists.openembedded.org> On Behalf Of Alex Kiernan
> > Sent: den 18 januari 2020 06:41
> > To: openembedded-core@lists.openembedded.org
> > Subject: [OE-core] [OE-Core][PATCH] rootfs: Make BUILDNAME a weak default
> > in reproducible_build_simple
> >
> > 11e45082ad00 ("rootfs-postcommands.bbclass: improve binary
> > reproducibility") fixed binary reproducibility of /etc/version, but with
> > the move to reproducibilty in all builds, setting /etc/version to
> > anything other than the default fixed timestamp is tricky because
> > rootfs_reproducible() runs very late.
> >
> > rootfs.py uses BUILDNAME if set for /etc/version, so introduce a weak
> > default for BUILDNAME of "REPRODUCIBLE_TIMESTAMP_ROOTFS", when enabling
> > reproducible builds hence allowing BUILDNAME to be overridden elsewhere.
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > ---
> >
> >  meta/classes/reproducible_build_simple.bbclass | 1 +
> >  meta/classes/rootfs-postcommands.bbclass       | 5 -----
> >  2 files changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/meta/classes/reproducible_build_simple.bbclass b/meta/classes/reproducible_build_simple.bbclass
> > index d0842f0f902a..153a07607219 100644
> > --- a/meta/classes/reproducible_build_simple.bbclass
> > +++ b/meta/classes/reproducible_build_simple.bbclass
> > @@ -7,5 +7,6 @@ export PERL_HASH_SEED = "0"
> >  export SOURCE_DATE_EPOCH ??= "1520598896"
> >
> >  REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
> > +BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"
>
> Can we please revert this change?  This breaks (all?) other usages
> of ${BUILDNAME}. E.g., the information in tmp/buildstats is totally
> useless now since all builds end up in the same directory
> "tmp/buildstats/1520598896", overwriting each other...
>

+1; I'd agree that seems rather more broken than the problem I was
trying to fix here.

-- 
Alex Kiernan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rootfs: Make BUILDNAME a weak default in reproducible_build_simple
  2020-02-07 17:03   ` Alex Kiernan
@ 2020-02-09  6:05     ` Peter Kjellerstedt
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2020-02-09  6:05 UTC (permalink / raw)
  To: Alex Kiernan; +Cc: openembedded-core

> -----Original Message-----
> From: Alex Kiernan <alex.kiernan@gmail.com>
> Sent: den 7 februari 2020 18:04
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [OE-Core][PATCH] rootfs: Make BUILDNAME a weak
> default in reproducible_build_simple
> 
> On Fri, Feb 7, 2020 at 4:27 PM Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
> >
> > > -----Original Message-----
> > > From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-
> > > bounces@lists.openembedded.org> On Behalf Of Alex Kiernan
> > > Sent: den 18 januari 2020 06:41
> > > To: openembedded-core@lists.openembedded.org
> > > Subject: [OE-core] [OE-Core][PATCH] rootfs: Make BUILDNAME a weak
> default
> > > in reproducible_build_simple
> > >
> > > 11e45082ad00 ("rootfs-postcommands.bbclass: improve binary
> > > reproducibility") fixed binary reproducibility of /etc/version, but
> with
> > > the move to reproducibilty in all builds, setting /etc/version to
> > > anything other than the default fixed timestamp is tricky because
> > > rootfs_reproducible() runs very late.
> > >
> > > rootfs.py uses BUILDNAME if set for /etc/version, so introduce a weak
> > > default for BUILDNAME of "REPRODUCIBLE_TIMESTAMP_ROOTFS", when
> enabling
> > > reproducible builds hence allowing BUILDNAME to be overridden
> elsewhere.
> > >
> > > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > > ---
> > >
> > >  meta/classes/reproducible_build_simple.bbclass | 1 +
> > >  meta/classes/rootfs-postcommands.bbclass       | 5 -----
> > >  2 files changed, 1 insertion(+), 5 deletions(-)
> > >
> > > diff --git a/meta/classes/reproducible_build_simple.bbclass
> b/meta/classes/reproducible_build_simple.bbclass
> > > index d0842f0f902a..153a07607219 100644
> > > --- a/meta/classes/reproducible_build_simple.bbclass
> > > +++ b/meta/classes/reproducible_build_simple.bbclass
> > > @@ -7,5 +7,6 @@ export PERL_HASH_SEED = "0"
> > >  export SOURCE_DATE_EPOCH ??= "1520598896"
> > >
> > >  REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
> > > +BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"
> >
> > Can we please revert this change?  This breaks (all?) other usages
> > of ${BUILDNAME}. E.g., the information in tmp/buildstats is totally
> > useless now since all builds end up in the same directory
> > "tmp/buildstats/1520598896", overwriting each other...
> >
> 
> +1; I'd agree that seems rather more broken than the problem I was
> trying to fix here.
> 
> --
> Alex Kiernan

I guess you can achieve what you originally wanted by introducing some new 
variable, but I will send a patch to revert the above change for now.

//Peter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-09  6:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18  5:41 [PATCH] rootfs: Make BUILDNAME a weak default in reproducible_build_simple Alex Kiernan
2020-02-07 16:27 ` Peter Kjellerstedt
2020-02-07 17:03   ` Alex Kiernan
2020-02-09  6:05     ` Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.