All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gcc-shared-source: Fix source date epoch handling
@ 2022-11-03 12:41 Richard Purdie
  2022-11-03 12:41 ` [PATCH 2/2] gcc-source: Drop gengtype manipulation Richard Purdie
  2022-11-03 15:23 ` [OE-core] [PATCH 1/2] gcc-shared-source: Fix source date epoch handling Peter Kjellerstedt
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Purdie @ 2022-11-03 12:41 UTC (permalink / raw)
  To: openembedded-core

The source date epoch for gcc isn't being transferred from the shared
workdir to the current WORKDIR for the specific recipe. This results in
the clamping code within sstate.bbclass using a value from 2011 which
changes the timestamps of many files. Since this happens part way
through the build, if pieces of gcc haven't built, or build/rebuild
later, we see things rebuilding when they should not and for generated
files, races are possible.

Fix this by copying the SDE from the shared workdir into the recipe
workdir.

[YOCTO #14953]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-shared-source.inc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-shared-source.inc b/meta/recipes-devtools/gcc/gcc-shared-source.inc
index aac4b49313c..cdc27deffdb 100644
--- a/meta/recipes-devtools/gcc/gcc-shared-source.inc
+++ b/meta/recipes-devtools/gcc/gcc-shared-source.inc
@@ -9,3 +9,12 @@ SRC_URI = ""
 
 do_configure[depends] += "gcc-source-${PV}:do_preconfigure"
 do_populate_lic[depends] += "gcc-source-${PV}:do_unpack"
+do_deploy_source_date_epoch[depends] += "gcc-source-${PV}:do_deploy_source_date_epoch"
+
+# Copy the SDE from the shared workdir to the recipe workdir
+do_deploy_source_date_epoch () {
+	mkdir -p ${SDE_DEPLOYDIR}
+	cp -p ${S}/../source-date-epoch/__source_date_epoch.txt ${SDE_DEPLOYDIR}/__source_date_epoch.txt
+	mkdir -p `dirname ${SDE_FILE}`
+	cp -p ${S}/../source-date-epoch/__source_date_epoch.txt ${SDE_FILE}
+}
-- 
2.34.1



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

* [PATCH 2/2] gcc-source: Drop gengtype manipulation
  2022-11-03 12:41 [PATCH 1/2] gcc-shared-source: Fix source date epoch handling Richard Purdie
@ 2022-11-03 12:41 ` Richard Purdie
  2022-11-03 17:53   ` [OE-core] " Khem Raj
  2022-11-03 15:23 ` [OE-core] [PATCH 1/2] gcc-shared-source: Fix source date epoch handling Peter Kjellerstedt
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2022-11-03 12:41 UTC (permalink / raw)
  To: openembedded-core

Whilst we patch gengtype.cc, we don't patch gengtype-lex.cc which would
be the file which would trigger regeneration of files.

The real bug that was likely the cause for this fix is probably SDE issues
with gcc shared workdir so this code can now be dropped.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-source.inc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-source.inc b/meta/recipes-devtools/gcc/gcc-source.inc
index 03837f43811..bf33a4b31ff 100644
--- a/meta/recipes-devtools/gcc/gcc-source.inc
+++ b/meta/recipes-devtools/gcc/gcc-source.inc
@@ -25,8 +25,6 @@ python do_preconfigure () {
     import subprocess
     cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
     subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
-    # See 0044-gengtypes.patch, we need to regenerate this file
-    bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.cc"))
     cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
     subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
 
-- 
2.34.1



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

* RE: [OE-core] [PATCH 1/2] gcc-shared-source: Fix source date epoch handling
  2022-11-03 12:41 [PATCH 1/2] gcc-shared-source: Fix source date epoch handling Richard Purdie
  2022-11-03 12:41 ` [PATCH 2/2] gcc-source: Drop gengtype manipulation Richard Purdie
@ 2022-11-03 15:23 ` Peter Kjellerstedt
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2022-11-03 15:23 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 3 november 2022 13:41
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/2] gcc-shared-source: Fix source date epoch handling
> 
> The source date epoch for gcc isn't being transferred from the shared
> workdir to the current WORKDIR for the specific recipe. This results in
> the clamping code within sstate.bbclass using a value from 2011 which
> changes the timestamps of many files. Since this happens part way
> through the build, if pieces of gcc haven't built, or build/rebuild
> later, we see things rebuilding when they should not and for generated
> files, races are possible.
> 
> Fix this by copying the SDE from the shared workdir into the recipe
> workdir.
> 
> [YOCTO #14953]
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-devtools/gcc/gcc-shared-source.inc | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-shared-source.inc b/meta/recipes-devtools/gcc/gcc-shared-source.inc
> index aac4b49313c..cdc27deffdb 100644
> --- a/meta/recipes-devtools/gcc/gcc-shared-source.inc
> +++ b/meta/recipes-devtools/gcc/gcc-shared-source.inc
> @@ -9,3 +9,12 @@ SRC_URI = ""
> 
>  do_configure[depends] += "gcc-source-${PV}:do_preconfigure"
>  do_populate_lic[depends] += "gcc-source-${PV}:do_unpack"
> +do_deploy_source_date_epoch[depends] += "gcc-source-${PV}:do_deploy_source_date_epoch"
> +
> +# Copy the SDE from the shared workdir to the recipe workdir
> +do_deploy_source_date_epoch () {
> +	mkdir -p ${SDE_DEPLOYDIR}
> +	cp -p ${S}/../source-date-epoch/__source_date_epoch.txt ${SDE_DEPLOYDIR}/__source_date_epoch.txt
> +	mkdir -p `dirname ${SDE_FILE}`
> +	cp -p ${S}/../source-date-epoch/__source_date_epoch.txt ${SDE_FILE}

Even though I doubt the name of the epoch file is likely to change 
any time soon, I think it is better to avoid hardcoding it here.
Thus I suggest the following instead:

	sde_file=${SDE_FILE}
	sde_file=${sde_file#${WORKDIR}/}
	mkdir -p ${SDE_DEPLOYDIR} $(dirname ${SDE_FILE})
	cp -p ${S}/../$sde_file ${SDE_DEPLOYDIR}
	cp -p ${S}/../$sde_file ${SDE_FILE}

> +}
> --
> 2.34.1

//Peter


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

* Re: [OE-core] [PATCH 2/2] gcc-source: Drop gengtype manipulation
  2022-11-03 12:41 ` [PATCH 2/2] gcc-source: Drop gengtype manipulation Richard Purdie
@ 2022-11-03 17:53   ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2022-11-03 17:53 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Thu, Nov 3, 2022 at 5:41 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> Whilst we patch gengtype.cc, we don't patch gengtype-lex.cc which would
> be the file which would trigger regeneration of files.
>
> The real bug that was likely the cause for this fix is probably SDE issues
> with gcc shared workdir so this code can now be dropped.
>

good catch. LGTM

> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-devtools/gcc/gcc-source.inc | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-source.inc b/meta/recipes-devtools/gcc/gcc-source.inc
> index 03837f43811..bf33a4b31ff 100644
> --- a/meta/recipes-devtools/gcc/gcc-source.inc
> +++ b/meta/recipes-devtools/gcc/gcc-source.inc
> @@ -25,8 +25,6 @@ python do_preconfigure () {
>      import subprocess
>      cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
>      subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
> -    # See 0044-gengtypes.patch, we need to regenerate this file
> -    bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.cc"))
>      cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
>      subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#172627): https://lists.openembedded.org/g/openembedded-core/message/172627
> Mute This Topic: https://lists.openembedded.org/mt/94755300/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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

end of thread, other threads:[~2022-11-03 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 12:41 [PATCH 1/2] gcc-shared-source: Fix source date epoch handling Richard Purdie
2022-11-03 12:41 ` [PATCH 2/2] gcc-source: Drop gengtype manipulation Richard Purdie
2022-11-03 17:53   ` [OE-core] " Khem Raj
2022-11-03 15:23 ` [OE-core] [PATCH 1/2] gcc-shared-source: Fix source date epoch handling 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.