Re: [linux-yocto] 'kgit-s2q' doesn't remove 'rebase-apply' directory

2024-02-25 Thread Bruce Ashfield
On Sat, Feb 24, 2024 at 3:34 AM Konstantin Aladyshev
 wrote:
>
> 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.

As long as one of the fallbacks works, the build continues (git apply
and reduced context).

Over many years of supporting 6 architectures and 4 kernel versions
and 4 different "types" of kernel's, we need that flexibility in the patching
process to avoid a massive amount of duplicated patches just for
some minor context and other issues.

It is possible that we could expose the fallback logging more, and
make it a warning to the build, alternatively there could be a flag
to make it fatal, but that wouldn't be the default mode of operation.

>
> 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'"

devtool is something completely separate from these scripts and
appeared over a decade later. There's many different wokflows that
are build on top of those scripts, each one can't be mentioned or
handled by the script, is a 1:m relationship.  It is the flows that
are on top of the scripts that need to adjust to what may or may not
be left when they exit.

For example, I've never used devtool and probably never will :)

Bruce

>
> Best regards,
> Konstantin Aladyshev
>
> On Sat, Feb 24, 2024 at 5:46 AM Bruce Ashfield  
> wrote:
> >
> > On Fri, Feb 23, 2024 at 3:24 PM Konstantin Aladyshev
> >  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 
> > > 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
> > > >
> > > >
> > > >

Re: [linux-yocto] 'kgit-s2q' doesn't remove 'rebase-apply' directory

2024-02-24 Thread Konstantin Aladyshev
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  wrote:
>
> On Fri, Feb 23, 2024 at 3:24 PM Konstantin Aladyshev
>  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 
> > 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: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [linux-yocto] 'kgit-s2q' doesn't remove 'rebase-apply' directory

2024-02-23 Thread Bruce Ashfield
On Fri, Feb 23, 2024 at 3:24 PM Konstantin Aladyshev
 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 
> 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 (#13603): 
https://lists.yoctoproject.org/g/linux-yocto/message/13603
Mute This Topic: https://lists.yoctoproject.org/mt/104535903/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [linux-yocto] 'kgit-s2q' doesn't remove 'rebase-apply' directory

2024-02-23 Thread Konstantin Aladyshev
> 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"
```

Best regards,
Konstantin Aladyshev

On Fri, Feb 23, 2024 at 11:12 PM Konstantin Aladyshev via
lists.yoctoproject.org 
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
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13602): 
https://lists.yoctoproject.org/g/linux-yocto/message/13602
Mute This Topic: https://lists.yoctoproject.org/mt/104535903/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] 'kgit-s2q' doesn't remove 'rebase-apply' directory

2024-02-23 Thread Konstantin Aladyshev
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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13601): 
https://lists.yoctoproject.org/g/linux-yocto/message/13601
Mute This Topic: https://lists.yoctoproject.org/mt/104535903/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-