From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: RE: [OE-core] [PATCH 1/2] gcc-shared-source: Fix source date epoch handling
Date: Thu, 3 Nov 2022 15:23:53 +0000 [thread overview]
Message-ID: <22395ca2bbcb4a88a4b4295bfdf6ae2c@axis.com> (raw)
In-Reply-To: <20221103124123.842602-1-richard.purdie@linuxfoundation.org>
> -----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
prev parent reply other threads:[~2022-11-03 15:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Peter Kjellerstedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22395ca2bbcb4a88a4b4295bfdf6ae2c@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox