I still don't understand. Shouldn't it be a build error, when patches couldn't be applied with 'git am', but can be applied with 'git apply'? So the user would have to stop and fix the issue? Because 'bitbake linux-yocto' builds fine in this case. This is a part that got me confused before I've started digging the internals.
Also can we do something about the 'devtool modify' case? Maybe we shouldn't do devtool rebase operations in the first place and prompt the user with some meaningful message? Something like "Devtool patch task failed, some of the patches can't be applied with 'git am', resolve the conflicts with 'git am --resolved'" Best regards, Konstantin Aladyshev On Sat, Feb 24, 2024 at 5:46 AM Bruce Ashfield <[email protected]> wrote: > > On Fri, Feb 23, 2024 at 3:24 PM Konstantin Aladyshev > <[email protected]> wrote: > > > > > Some additional information for the "Tested" section > > > > To make sure that devtool will need to perform "git rebase" operation > > also add conditional patchset, i.e.: > > ``` > > SRC_URI:append:test = "file://0001-Test-commit.patch" > > ``` > > The problem is that the .git/rebase-apply directly cannot be removed > automatically. It is quite literally left around so that the patch failure > can be resolved manually, and then the commit completed with > git am --resolved. > > git am of course cleans up and then we can resume patching. > > There's no way to know what tools may or may not be run after the failure, > so there's no way that I've ever found to be able to clean it up > automatically. > > It is core functionality of the tools that is used in both generation > of a new tree and in applying series to existing branches. > > So my suggestion from the other mailing list stands. If the tool that > you are trying to run after knows that it needs a clean environment > then that is the place to remove that directory after a failure in > the patching process. > > Bruce > > > > > Best regards, > > Konstantin Aladyshev > > > > On Fri, Feb 23, 2024 at 11:12 PM Konstantin Aladyshev via > > lists.yoctoproject.org <[email protected]> > > wrote: > > > > > > Hello! > > > > > > 'kgit-s2q' in the linux recipe tries to use 'git apply' if 'git am' fails. > > > In this case 'kgit-s2q' manually creates a ".git/rebase-apply" > > > directory > > > (https://git.yoctoproject.org/yocto-kernel-tools/tree/tools/kgit-s2q#n622) > > > But it looks like this directory is not removed after the patches are > > > applied. This creates a problem, since with this directory present git > > > thinks that rebase operation is still in progress. > > > Because of this bug 'devtool modify linux' can't perform its own > > > rebase operations in the "devtool_post_patch" tasks > > > https://git.yoctoproject.org/poky/tree/meta/classes/devtool-source.bbclass#n214 > > > In the end this creates a situation when the local patches are not > > > applied. > > > > > > Tested: > > > The issue can be recreated with the poky master. > > > > > > Create a "linux-yocto_%.bbappend" file with a patch that can't be > > > applied with "git am" - this will make kgit-s2q use "git apply" and > > > therefore create a ".git/rebase-apply" directory. > > > > > > In this case "devtool modify linux-yocto" fails with error: > > > ``` > > > ERROR: ExecutionError('git rebase devtool-no-overrides', 128, '', > > > 'fatal: It seems that there is already a rebase-apply directory, > > > and\nI wonder if you are in the middle of another rebase. If that is > > > the\ncase, please try\n\tgit rebase (--continue | --abort | > > > --skip)\nIf that is not the case, please\n\trm -fr > > > ".git/rebase-apply"\nand run me again. I am stopping in case you > > > still have something\nvaluable there.\n\n') > > > ``` > > > > > > Best regards, > > > Konstantin Aladyshev > > > > > > > > > > > > > > > > > > -- > - Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its end > - "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#13604): https://lists.yoctoproject.org/g/linux-yocto/message/13604 Mute This Topic: https://lists.yoctoproject.org/mt/104535903/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
