All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libc6: improve reproducibility
@ 2018-01-12 21:04 Juro Bystricky
  2018-01-13 10:11 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Juro Bystricky @ 2018-01-12 21:04 UTC (permalink / raw)
  To: openembedded-core; +Cc: jurobystricky

Building various libraries (libc6, libc6-pic, libc6-staticdev, libc6-dbg, ...)
can be non-deterministic because they may be built with two different versions
of intl/plural.c. in two otherwise identical builds. We may or may not re-generate
the file plural.c from the file plural.y, based on bison being installed or not
and based on mtimes of those two files, as the Makefile contains:

plural.c: plural.y
	$(BISON) $(BISONFLAGS) $@ $^

If the above rule does not fire, we use a "fallback" plural.c, otherwise
we use plural.c re-generated from plural.y.
The fix is to always require bison to be installed and unconditionally
re-generate plural.c. (This is achieved by touching plural.y).

[YOCTO #12291]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
---
 meta/recipes-core/glibc/glibc_2.26.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc_2.26.bb b/meta/recipes-core/glibc/glibc_2.26.bb
index 04d9773..4d9b23f 100644
--- a/meta/recipes-core/glibc/glibc_2.26.bb
+++ b/meta/recipes-core/glibc/glibc_2.26.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
       file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
 
-DEPENDS += "gperf-native"
+DEPENDS += "gperf-native bison-native"
 
 SRCREV ?= "77f921dac17c5fa99bd9e926d926c327982895f7"
 
@@ -103,6 +103,7 @@ do_configure () {
 # version check and doesn't really help with anything
         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
         find ${S} -name "configure" | xargs touch
+        find ${S}/intl -name "plural.y" | xargs touch
         CPPFLAGS="" oe_runconf
 }
 
-- 
2.7.4



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

* Re: [PATCH] libc6: improve reproducibility
  2018-01-12 21:04 [PATCH] libc6: improve reproducibility Juro Bystricky
@ 2018-01-13 10:11 ` Richard Purdie
  2018-01-13 14:09   ` Bystricky, Juro
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2018-01-13 10:11 UTC (permalink / raw)
  To: Juro Bystricky, openembedded-core; +Cc: jurobystricky

On Fri, 2018-01-12 at 13:04 -0800, Juro Bystricky wrote:
> Building various libraries (libc6, libc6-pic, libc6-staticdev, libc6-
> dbg, ...)
> can be non-deterministic because they may be built with two different
> versions
> of intl/plural.c. in two otherwise identical builds. We may or may
> not re-generate
> the file plural.c from the file plural.y, based on bison being
> installed or not
> and based on mtimes of those two files, as the Makefile contains:
> 
> plural.c: plural.y
> 	$(BISON) $(BISONFLAGS) $@ $^
> 
> If the above rule does not fire, we use a "fallback" plural.c,
> otherwise
> we use plural.c re-generated from plural.y.
> The fix is to always require bison to be installed and
> unconditionally
> re-generate plural.c. (This is achieved by touching plural.y).
> 
> [YOCTO #12291]
> 
> Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> ---
>  meta/recipes-core/glibc/glibc_2.26.bb | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Hi Juro,

Can you put a comment alongside the touch in the recipe as we're not
going to know why we're doing this in a few years time...

Cheers,

Richard


> diff --git a/meta/recipes-core/glibc/glibc_2.26.bb b/meta/recipes-
> core/glibc/glibc_2.26.bb
> index 04d9773..4d9b23f 100644
> --- a/meta/recipes-core/glibc/glibc_2.26.bb
> +++ b/meta/recipes-core/glibc/glibc_2.26.bb
> @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36
> d3209f380deb394b213 \
>        file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c78
> 5f5d83a \
>        file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
>  
> -DEPENDS += "gperf-native"
> +DEPENDS += "gperf-native bison-native"
>  
>  SRCREV ?= "77f921dac17c5fa99bd9e926d926c327982895f7"
>  
> @@ -103,6 +103,7 @@ do_configure () {
>  # version check and doesn't really help with anything
>          (cd ${S} && gnu-configize) || die "failure in running gnu-
> configize"
>          find ${S} -name "configure" | xargs touch
> +        find ${S}/intl -name "plural.y" | xargs touch
>          CPPFLAGS="" oe_runconf
>  }
>  


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

* Re: [PATCH] libc6: improve reproducibility
  2018-01-13 10:11 ` Richard Purdie
@ 2018-01-13 14:09   ` Bystricky, Juro
  0 siblings, 0 replies; 3+ messages in thread
From: Bystricky, Juro @ 2018-01-13 14:09 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core; +Cc: jurobystricky


> Hi Juro,
> 
> Can you put a comment alongside the touch in the recipe as we're not
> going to know why we're doing this in a few years time...
> 

Sure, no problem. I will send v2. BTW, this was fixed in upstream glibc, so the "touch" line can be removed once we upgrade glibc. I will put this in the comment as well. (We still depend on bison-native)


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

end of thread, other threads:[~2018-01-13 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 21:04 [PATCH] libc6: improve reproducibility Juro Bystricky
2018-01-13 10:11 ` Richard Purdie
2018-01-13 14:09   ` Bystricky, Juro

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.