* [PATCH] glibc: Fix timestamp of plural.c after unpack
@ 2016-10-11 8:02 Yuanjie Huang
2016-10-11 8:37 ` Mark Hatle
2016-10-11 11:53 ` Phil Blundell
0 siblings, 2 replies; 11+ messages in thread
From: Yuanjie Huang @ 2016-10-11 8:02 UTC (permalink / raw)
To: openembedded-core
From: Yuanjie Huang <yuanjie.huang@windriver.com>
Source file plural.c might be updated with bison from plural.y, touch it
before applying patches so that this file is consistent across builds.
Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
---
meta/recipes-core/glibc/glibc.inc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index e85c704..5225dfc 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -78,3 +78,10 @@ do_configure_prepend() {
}
GLIBC_ADDONS ?= "nptl,libidn"
+
+# Ensure that plural.c is newer than its Bison source plural.y,
+# unless the latter is patched.
+do_unpack_workaround() {
+ touch ${S}/intl/plural.c
+}
+addtask unpack_workaround after do_unpack before do_patch
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 8:02 [PATCH] glibc: Fix timestamp of plural.c after unpack Yuanjie Huang
@ 2016-10-11 8:37 ` Mark Hatle
2016-10-11 9:17 ` Burton, Ross
2016-10-11 9:22 ` Enrico Scholz
2016-10-11 11:53 ` Phil Blundell
1 sibling, 2 replies; 11+ messages in thread
From: Mark Hatle @ 2016-10-11 8:37 UTC (permalink / raw)
To: Yuanjie Huang, openembedded-core
FYI this particular issue was observed by one of our customers. Starting around
the YP 2.0 time period. (We did not observe the problem prior to 2.0, but it
may be present.)
My understanding of the issue is that the extraction of the plural.c and
plural.y files happens so quickly that it is unclear to make if one is older
then the other -- so it sometimes uses bison to rebuild the plural.c. This
produces a non-deterministic build.
The patch below addresses this by inserting a task between unpack and patch that
makes sure we use the plural.c from the archive. If a later patch changes
plural.y -- it will then be reconstructed as expected from source.
--Mark
On 10/11/16 10:02 AM, Yuanjie Huang wrote:
> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>
> Source file plural.c might be updated with bison from plural.y, touch it
> before applying patches so that this file is consistent across builds.
>
> Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
> ---
> meta/recipes-core/glibc/glibc.inc | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index e85c704..5225dfc 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -78,3 +78,10 @@ do_configure_prepend() {
> }
>
> GLIBC_ADDONS ?= "nptl,libidn"
> +
> +# Ensure that plural.c is newer than its Bison source plural.y,
> +# unless the latter is patched.
> +do_unpack_workaround() {
> + touch ${S}/intl/plural.c
> +}
> +addtask unpack_workaround after do_unpack before do_patch
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 8:37 ` Mark Hatle
@ 2016-10-11 9:17 ` Burton, Ross
2016-10-11 9:50 ` Yuanjie Huang
2016-10-11 9:22 ` Enrico Scholz
1 sibling, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2016-10-11 9:17 UTC (permalink / raw)
To: Mark Hatle; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 469 bytes --]
On 11 October 2016 at 09:37, Mark Hatle <mark.hatle@windriver.com> wrote:
> My understanding of the issue is that the extraction of the plural.c and
> plural.y files happens so quickly that it is unclear to make if one is
> older
> then the other -- so it sometimes uses bison to rebuild the plural.c. This
> produces a non-deterministic build.
>
Surely the rebuilt plural.c should be identical to the shipped one?
(semantically if not literally)
Ross
[-- Attachment #2: Type: text/html, Size: 883 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 9:17 ` Burton, Ross
@ 2016-10-11 9:50 ` Yuanjie Huang
2016-10-11 10:29 ` Mark Hatle
0 siblings, 1 reply; 11+ messages in thread
From: Yuanjie Huang @ 2016-10-11 9:50 UTC (permalink / raw)
To: Burton, Ross, Mark Hatle; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 756 bytes --]
The generated parser contains huge hunks of code actually shipped with
bison, so I think we should also expect some semantic difference.
Yuanjie
On 10/11/2016 05:17 PM, Burton, Ross wrote:
>
> On 11 October 2016 at 09:37, Mark Hatle <mark.hatle@windriver.com
> <mailto:mark.hatle@windriver.com>> wrote:
>
> My understanding of the issue is that the extraction of the
> plural.c and
> plural.y files happens so quickly that it is unclear to make if
> one is older
> then the other -- so it sometimes uses bison to rebuild the
> plural.c. This
> produces a non-deterministic build.
>
>
> Surely the rebuilt plural.c should be identical to the shipped one?
> (semantically if not literally)
>
> Ross
[-- Attachment #2: Type: text/html, Size: 1939 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 9:50 ` Yuanjie Huang
@ 2016-10-11 10:29 ` Mark Hatle
0 siblings, 0 replies; 11+ messages in thread
From: Mark Hatle @ 2016-10-11 10:29 UTC (permalink / raw)
To: Yuanjie Huang, Burton, Ross; +Cc: OE-core
On 10/11/16 11:50 AM, Yuanjie Huang wrote:
> The generated parser contains huge hunks of code actually shipped with bison, so
> I think we should also expect some semantic difference.
Exactly the problem. Unless the plural.y has been modified, we should not be
regenerating the .c file as shipped by glibc. It has the possibility of
introducing problems.... but the immediate concern is the non-determinism where
some builds rebuild, some do not.
--Mark
> Yuanjie
>
> On 10/11/2016 05:17 PM, Burton, Ross wrote:
>>
>> On 11 October 2016 at 09:37, Mark Hatle <mark.hatle@windriver.com
>> <mailto:mark.hatle@windriver.com>> wrote:
>>
>> My understanding of the issue is that the extraction of the plural.c and
>> plural.y files happens so quickly that it is unclear to make if one is older
>> then the other -- so it sometimes uses bison to rebuild the plural.c. This
>> produces a non-deterministic build.
>>
>>
>> Surely the rebuilt plural.c should be identical to the shipped one?
>> (semantically if not literally)
>>
>> Ross
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 8:37 ` Mark Hatle
2016-10-11 9:17 ` Burton, Ross
@ 2016-10-11 9:22 ` Enrico Scholz
2016-10-11 9:46 ` Gary Thomas
1 sibling, 1 reply; 11+ messages in thread
From: Enrico Scholz @ 2016-10-11 9:22 UTC (permalink / raw)
To: openembedded-core
Mark Hatle <mark.hatle-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> writes:
> My understanding of the issue is that the extraction of the plural.c and
> plural.y files happens so quickly that it is unclear to make if one is older
> then the other -- so it sometimes uses bison to rebuild the plural.c.
When this is really the case, this can apply to the workaround too. So,
there should be added a 'sleep 1' before the 'touch' or (better?) remove
plural.c to enforce a rebuild.
>> +do_unpack_workaround() {
>> + touch ${S}/intl/plural.c
>> +}
Enrico
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 9:22 ` Enrico Scholz
@ 2016-10-11 9:46 ` Gary Thomas
2016-10-11 10:31 ` Mark Hatle
0 siblings, 1 reply; 11+ messages in thread
From: Gary Thomas @ 2016-10-11 9:46 UTC (permalink / raw)
To: openembedded-core
On 2016-10-11 11:22, Enrico Scholz wrote:
> Mark Hatle <mark.hatle-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> writes:
>
>> My understanding of the issue is that the extraction of the plural.c and
>> plural.y files happens so quickly that it is unclear to make if one is older
>> then the other -- so it sometimes uses bison to rebuild the plural.c.
>
> When this is really the case, this can apply to the workaround too. So,
> there should be added a 'sleep 1' before the 'touch' or (better?) remove
> plural.c to enforce a rebuild.
I believe that's the opposite of the desired action, i.e. to always use
the packaged plural.c and never rely on the plural.y=>plural.c transformation.
>
>>> +do_unpack_workaround() {
>>> + touch ${S}/intl/plural.c
>>> +}
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 9:46 ` Gary Thomas
@ 2016-10-11 10:31 ` Mark Hatle
0 siblings, 0 replies; 11+ messages in thread
From: Mark Hatle @ 2016-10-11 10:31 UTC (permalink / raw)
To: Gary Thomas, openembedded-core
On 10/11/16 11:46 AM, Gary Thomas wrote:
> On 2016-10-11 11:22, Enrico Scholz wrote:
>> Mark Hatle <mark.hatle-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> writes:
>>
>>> My understanding of the issue is that the extraction of the plural.c and
>>> plural.y files happens so quickly that it is unclear to make if one is older
>>> then the other -- so it sometimes uses bison to rebuild the plural.c.
>>
>> When this is really the case, this can apply to the workaround too. So,
>> there should be added a 'sleep 1' before the 'touch' or (better?) remove
>> plural.c to enforce a rebuild.
>
> I believe that's the opposite of the desired action, i.e. to always use
> the packaged plural.c and never rely on the plural.y=>plural.c transformation.
>
>>
>>>> +do_unpack_workaround() {
>>>> + touch ${S}/intl/plural.c
>>>> +}
>
Correct. We want to use the included version from glibc, -unless- there is a
patch that has modified the plural.y.
So doing this as an intermediate operation between unpack and patch should
correct the timestamp issue, while still allowing a patch to modify plural.y to
trigger an automatic regeneration (and any advantages or problems introduced by
the regeneration operation.)
As for the sleep 1, we've generally seen that is a long enough delay in tasks
that that is not necessary. Most filesystems seem to have sub second accuracy.
However, if it does become an issue, I agree the sleep 1 is likely the only
solution to ensure the stamp has changed sufficiently..
--Mark
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 8:02 [PATCH] glibc: Fix timestamp of plural.c after unpack Yuanjie Huang
2016-10-11 8:37 ` Mark Hatle
@ 2016-10-11 11:53 ` Phil Blundell
2016-10-11 12:56 ` Mark Hatle
1 sibling, 1 reply; 11+ messages in thread
From: Phil Blundell @ 2016-10-11 11:53 UTC (permalink / raw)
To: Yuanjie Huang, openembedded-core
On Tue, 2016-10-11 at 16:02 +0800, Yuanjie Huang wrote:
> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>
> Source file plural.c might be updated with bison from plural.y, touch
> it
> before applying patches so that this file is consistent across
> builds.
I think it would be better to just configure glibc explicitly without
bison (BISON=no). It doesn't DEPEND on bison-native anyway so it ought
never to be using it.
p.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 11:53 ` Phil Blundell
@ 2016-10-11 12:56 ` Mark Hatle
2016-10-11 13:01 ` Phil Blundell
0 siblings, 1 reply; 11+ messages in thread
From: Mark Hatle @ 2016-10-11 12:56 UTC (permalink / raw)
To: Phil Blundell, Yuanjie Huang, openembedded-core
On 10/11/16 1:53 PM, Phil Blundell wrote:
> On Tue, 2016-10-11 at 16:02 +0800, Yuanjie Huang wrote:
>> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>>
>> Source file plural.c might be updated with bison from plural.y, touch
>> it
>> before applying patches so that this file is consistent across
>> builds.
>
> I think it would be better to just configure glibc explicitly without
> bison (BISON=no). It doesn't DEPEND on bison-native anyway so it ought
> never to be using it.
This was the first instance of the patch. However after discussing the issue w/
Khem Raj (in person), we came to the conclusion that we did want a way to permit
people to modify the plural.y via a patch, otherwise someone could make a change
and not realize it was ignored.
--Mark
> p.
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] glibc: Fix timestamp of plural.c after unpack
2016-10-11 12:56 ` Mark Hatle
@ 2016-10-11 13:01 ` Phil Blundell
0 siblings, 0 replies; 11+ messages in thread
From: Phil Blundell @ 2016-10-11 13:01 UTC (permalink / raw)
To: Mark Hatle, Yuanjie Huang, openembedded-core
On Tue, 2016-10-11 at 14:56 +0200, Mark Hatle wrote:
>
> This was the first instance of the patch. However after discussing
> the issue w/
> Khem Raj (in person), we came to the conclusion that we did want a
> way to permit
> people to modify the plural.y via a patch, otherwise someone could
> make a change
> and not realize it was ignored.
In that case they would need to add a dependency on bison-native in
order to get reliable builds. Otherwise, if the build host happens to
not have bison installed, their change to plural.y will once again end
up being silently ignored. I think it would be better to make it
consistent and deterministic.
p.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-10-11 13:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 8:02 [PATCH] glibc: Fix timestamp of plural.c after unpack Yuanjie Huang
2016-10-11 8:37 ` Mark Hatle
2016-10-11 9:17 ` Burton, Ross
2016-10-11 9:50 ` Yuanjie Huang
2016-10-11 10:29 ` Mark Hatle
2016-10-11 9:22 ` Enrico Scholz
2016-10-11 9:46 ` Gary Thomas
2016-10-11 10:31 ` Mark Hatle
2016-10-11 11:53 ` Phil Blundell
2016-10-11 12:56 ` Mark Hatle
2016-10-11 13:01 ` Phil Blundell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox