From: Enrico Jorns <ejo@pengutronix.de>
To: openembedded-core@lists.openembedded.org
Cc: uol@pengutronix.de, Enrico Jorns <ejo@pengutronix.de>
Subject: [PATCH] base.bbclass: fix do_unpack[cleandirs] varflag handling
Date: Sun, 21 Jan 2018 00:44:41 +0100 [thread overview]
Message-ID: <20180120234441.18217-1-ejo@pengutronix.de> (raw)
As introduced by a56fb90dc3805494eeaf04c60538425e8d52efc5 ('base.bbclass
wipe ${S} before unpacking source') the base.bbclass uses a python
anonymous function to set the 'do_unpack' varflag 'cleandirs' to either
'${S}' or '${S}/patches' depending on equality of '${S}' and '${WORKDIR}'.
Not that this only differs from the way almost all other recipes set or
modify a tasks 'cleandirs' flag, it also has a significant impact on the
kernel.bbclass (and possibly further ones) and causes incorrect
behavior for rebuilds triggered by source modification, e.g. by a change
of the defconfig file for a kernel build.
The kernel.bbclass tries to extend do_unpack[cleandirs]:
| do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
As python anonymous functions are evaluated at the very end of recipe
parsing, the d.setVarFlag('do_unpack', 'cleandirs', '${S}') statement in
base.bbclass will overwrite every modification to cleandirs that is done
as shown for the kernel class above.
As a result of this, a change to a kernels 'defconfig' will lead to an
updated defconfig file in ${WORKDIR}, but as ${B} never gets cleaned and
${B}/.config still exists, it will not be copied to ${B}/.config and
thus not find its way in the build kernel.
This is a severe issue for the kernel development and build process!
This patch changes setting of the cleandirs varflag in base.bbclass to
a simple variable assignment as almost all other recipes do it. This now
again allows overwriting or appending the varflag with common methods
such as done in kernel.bbclass.
This issue affects morty, pyro, rocko and master.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
meta/classes/base.bbclass | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 912e81e002..2949b074d8 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -152,12 +152,8 @@ python base_do_fetch() {
addtask unpack after do_fetch
do_unpack[dirs] = "${WORKDIR}"
-python () {
- if d.getVar('S') != d.getVar('WORKDIR'):
- d.setVarFlag('do_unpack', 'cleandirs', '${S}')
- else:
- d.setVarFlag('do_unpack', 'cleandirs', os.path.join('${S}', 'patches'))
-}
+do_unpack[cleandirs] = "${@d.getVar('S') if d.getVar('S') != d.getVar('WORKDIR') else os.path.join('${S}', 'patches')}"
+
python base_do_unpack() {
src_uri = (d.getVar('SRC_URI') or "").split()
if len(src_uri) == 0:
--
2.11.0
next reply other threads:[~2018-01-21 0:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-20 23:44 Enrico Jorns [this message]
2018-01-31 9:49 ` [PATCH] base.bbclass: fix do_unpack[cleandirs] varflag handling Enrico Joerns
2018-03-27 10:40 ` [pyro][rocko][PATCH] " Enrico Joerns
2018-03-27 14:27 ` akuster808
2018-03-28 12:31 ` Enrico Joerns
2018-04-03 22:20 ` [PATCH] " Richard Purdie
2018-04-04 0:54 ` Paul Eggleton
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=20180120234441.18217-1-ejo@pengutronix.de \
--to=ejo@pengutronix.de \
--cc=openembedded-core@lists.openembedded.org \
--cc=uol@pengutronix.de \
/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