summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/patch.py
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2022-05-29 04:34:05 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-31 15:24:18 +0100
commitb3b76a984ce0080b10f6eba7e82b6503fefee387 (patch)
tree157bb0f6984b1ccac9b65fe31067e4c9f9150446 /meta/lib/oe/patch.py
parent00400b63578bc1544af27d45ac7367343cf60113 (diff)
downloadpoky-b3b76a984ce0080b10f6eba7e82b6503fefee387.tar.gz
patch.py: make sure that patches/series file exists before quilt pop
* Since quilt upgrade to 0.67 some recipes sometimes fail in do_patch with errors like: ERROR: Applying patch 'GPLv2.patch' on target directory '/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/keymaps/1.0-r31' CmdError('quilt --quiltrc /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/keymaps/1.0-r31/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: stderr: File series fully applied, ends at patch GPLv2.patch ') * It affects only recipes with S = "${WORKDIR}", which wipe only ${S}/patches, because in other cases whole ${S} is wiped when do_unpack is re-executed. * It was originally added in: https://git.openembedded.org/openembedded-core/commit/?id=5fe5e6a15f26f23f0c5b863fafad7a0d382a55e2 since then it was extended to wipe whole ${S} when ${S} != ${WORKDIR} in: https://git.openembedded.org/openembedded-core/commit/?id=5fe5e6a15f26f23f0c5b863fafad7a0d382a55e2 https://git.openembedded.org/openembedded-core/commit/?id=eccae514b71394ffaed8fc45dea7942152a334a1 this is now causing issues to quilt-0.67 because it checks that ${S}/patches/series exists during 'quilt pop -a -f' which we call from QuiltTree.Clean to undo patches possibly already applied in ${S} in previous do_patch execution. * There are couple recipes affected by this e.g. keymaps (.patch already removed in oe-core), makedevs (.patch removal sent to ML yesterday https://lists.openembedded.org/g/openembedded-core/message/166172), devmem2 (https://lists.openembedded.org/g/openembedded-devel/message/97270), but there are other recipes with S = "${WORKDIR}" where you can trigger this e.g. by having a .patch file in DISTRO layer .bbappend (e.g. tzdata with webOS https://github.com/webosose/meta-webosose/blob/06e5298d9f5c47679b679081d9930f8d1c776142/meta-webos/recipes-extended/tzdata/tzdata.bbappend#L10) This do_patch issue is caused by: https://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=8b39a960afcf45cd4f5804ae62b6b0656bdb191d introduced in kirkstone with: https://git.openembedded.org/openembedded-core/commit/?h=kirkstone&id=fa71afcee9ab42198c619333b77a15bd2ae02b20 The shortest sequence to reproduce this is just bitbake keymaps -c patch bitbake keymaps -c unpack -f bitbake keymaps -c patch with https://git.openembedded.org/openembedded-core/commit/?id=17d981005a0c0c97702ad88602b7181b69bcc9eb reverted. And the change in quilt behavior is causing QuiltTree.Clean (quilt pop -a -f) in: https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/patch.py?id=17d981005a0c0c97702ad88602b7181b69bcc9eb#n601 to silently fail with "No series file found" before undoing the patches in ${S} and then quilt push failing, because all the patches are _still_ applied in ${S}. Removing ".pc" doesn't help, because we really need quilt's help to undo the patches (in this case to delete COPYING file from WORKDIR before applying the .patch which tries to add it again), because do_unpack cannot just wipe S and start over (because S == WORKDIR) - nor selectively removing the files listed in SRC_URI, because COPYING file isn't listed there. Using skip_series_check in 'quilt pop' (partially reverting the change from upstream) does fix this as well and it's simple one line patch (just adding skip_series_check=1 in pop.in), but might be difficult to upstream, because it's this strange OE specific behavior that we remove 'patches' directory and then still need quilt pop to work. (From OE-Core rev: c9d36882044b1c633d8611a77df54cd68c9bee25) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/patch.py')
-rw-r--r--meta/lib/oe/patch.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 9034fcae03..95b915a6ab 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -598,6 +598,8 @@ class QuiltTree(PatchSet):
598 598
599 def Clean(self): 599 def Clean(self):
600 try: 600 try:
601 # make sure that patches/series file exists before quilt pop to keep quilt-0.67 happy
602 open(os.path.join(self.dir, "patches","series"), 'a').close()
601 self._runcmd(["pop", "-a", "-f"]) 603 self._runcmd(["pop", "-a", "-f"])
602 oe.path.remove(os.path.join(self.dir, "patches","series")) 604 oe.path.remove(os.path.join(self.dir, "patches","series"))
603 except Exception: 605 except Exception: