All of lore.kernel.org
 help / color / mirror / Atom feed
* Patching submodules
@ 2020-03-20  4:10 Emily
  2020-03-20 10:18 ` [yocto] " Nicolas Jeker
  2020-03-20 11:18 ` Paul Barker
  0 siblings, 2 replies; 6+ messages in thread
From: Emily @ 2020-03-20  4:10 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]

Hi all -

I have a recipe that I'd like to patch - the source is in a repo which has
a submodule, and the patch occurs in the submodule. Is there a way I can
apply this patch without getting an error? I do kind of understand why it's
a problem - the patch is changing the pointer of the submodule to a
commit which doesn't actually exist. Do I need to build the submodule as a
separate recipe and patch it separately maybe?

I used devtool for the patch and if I don't run the devtool reset command,
then everything builds, but I think this is just because the workspace
created by devtool was added as a layer, which probably isn't a good
long term solution.

The error I get (pasted below) says I can "enforce with -f" but I'm not
sure where that option goes exactly. Thanks for the help!

Emily

Error on build:
ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Command
Error: 'quilt --quiltrc
/local/d6/easmith5/rocko_bitbake/poky/build/tmp/work/aarch64-poky-linux/opc-ua-server-gfex/1.0+gitAUTOINC+921c563309-r0/recipe-sysroot-native/etc/quiltrc
push' exited with 0  Output:
Applying patch 0001-Update-Poverty-to-point-to-boost-python3.patch
File Poverty is not a regular file -- refusing to patch
1 out of 1 hunk ignored -- rejects in file
Patch 0001-Update-Poverty-to-point-to-boost-python3.patch does not apply
(enforce with -f)
ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Function
failed: patch_do_patch

[-- Attachment #2: Type: text/html, Size: 1679 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [yocto] Patching submodules
  2020-03-20  4:10 Patching submodules Emily
@ 2020-03-20 10:18 ` Nicolas Jeker
  2020-03-20 15:29   ` Emily
  2020-03-20 11:18 ` Paul Barker
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Jeker @ 2020-03-20 10:18 UTC (permalink / raw)
  To: yocto

On Thu, 2020-03-19 at 23:10 -0500, Emily wrote:
> Hi all - 
> 
> I have a recipe that I'd like to patch - the source is in a repo
> which has a submodule, and the patch occurs in the submodule. Is
> there a way I can apply this patch without getting an error? I do
> kind of understand why it's a problem - the patch is changing the
> pointer of the submodule to a commit which doesn't actually exist. Do
> I need to build the submodule as a separate recipe and patch it
> separately maybe? 

Is there a reason why you don't use a bbappend file with your patch in
it in a custom layer?

Something like this:

package_ver.bbappend
--------------------
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://abc.patch"


With this directory structure:

meta-custom-layer
├── package_ver.bbappend
└── package
    └── abc.patch

Replace "package" and "ver" with the correct values (if you don't want
to set the version you can use "%" as a wildcard).

Maybe I missed something about your submodule situation and my advice
is completely wrong, if so, just disregard it.

> I used devtool for the patch and if I don't run the devtool reset
> command, then everything builds, but I think this is just because the
> workspace created by devtool was added as a layer, which probably
> isn't a good long term solution. 

You should be able to get the above structure by using 'devtool finish
recipe meta-custom-layer'. If that doesn't work you can do it manually
as described above.

> The error I get (pasted below) says I can "enforce with -f" but I'm
> not sure where that option goes exactly. Thanks for the help! 
> 
> Emily
> 
> Error on build: 
> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch:
> Command Error: 'quilt --quiltrc
> /local/d6/easmith5/rocko_bitbake/poky/build/tmp/work/aarch64-poky-
> linux/opc-ua-server-gfex/1.0+gitAUTOINC+921c563309-r0/recipe-sysroot-
> native/etc/quiltrc push' exited with 0  Output:
> Applying patch 0001-Update-Poverty-to-point-to-boost-python3.patch
> File Poverty is not a regular file -- refusing to patch
> 1 out of 1 hunk ignored -- rejects in file
> Patch 0001-Update-Poverty-to-point-to-boost-python3.patch does not
> apply (enforce with -f)
> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch:
> Function failed: patch_do_patch

I don't know why this error occurs, maybe someone else knows more.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [yocto] Patching submodules
  2020-03-20  4:10 Patching submodules Emily
  2020-03-20 10:18 ` [yocto] " Nicolas Jeker
@ 2020-03-20 11:18 ` Paul Barker
  2020-03-20 13:42   ` Emily
  2020-03-20 15:17   ` Yann Dirson
  1 sibling, 2 replies; 6+ messages in thread
From: Paul Barker @ 2020-03-20 11:18 UTC (permalink / raw)
  To: Emily; +Cc: yocto

On Fri, 20 Mar 2020 at 04:10, Emily <easmith5555@gmail.com> wrote:
>
> Hi all -
>
> I have a recipe that I'd like to patch - the source is in a repo which has a submodule, and the patch occurs in the submodule. Is there a way I can apply this patch without getting an error? I do kind of understand why it's a problem - the patch is changing the pointer of the submodule to a commit which doesn't actually exist. Do I need to build the submodule as a separate recipe and patch it separately maybe?
>
> I used devtool for the patch and if I don't run the devtool reset command, then everything builds, but I think this is just because the workspace created by devtool was added as a layer, which probably isn't a good long term solution.
>
> The error I get (pasted below) says I can "enforce with -f" but I'm not sure where that option goes exactly. Thanks for the help!
>
> Emily
>
> Error on build:
> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Command Error: 'quilt --quiltrc /local/d6/easmith5/rocko_bitbake/poky/build/tmp/work/aarch64-poky-linux/opc-ua-server-gfex/1.0+gitAUTOINC+921c563309-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
> Applying patch 0001-Update-Poverty-to-point-to-boost-python3.patch
> File Poverty is not a regular file -- refusing to patch
> 1 out of 1 hunk ignored -- rejects in file
> Patch 0001-Update-Poverty-to-point-to-boost-python3.patch does not apply (enforce with -f)
> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Function failed: patch_do_patch

The issue appears to be that patches are applied using quilt which
doesn't understand a patch like this. I don't know of a good solution
to this other than making a new commit in the top level repository and
updating SRCREV.

Perhaps it's better to carry the diff within the submodule as a patch
- so you leave the submodule commit pointer where it is and instead
include all the necessary changes to the submodule in the patch. Would
that work for you?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [yocto] Patching submodules
  2020-03-20 11:18 ` Paul Barker
@ 2020-03-20 13:42   ` Emily
  2020-03-20 15:17   ` Yann Dirson
  1 sibling, 0 replies; 6+ messages in thread
From: Emily @ 2020-03-20 13:42 UTC (permalink / raw)
  To: Paul Barker; +Cc: yocto

Hi Paul -

I’m not sure what you mean by “include all the necessary changes to the submodule in the patch”, because anytime I change something in the submodule then the git diff for the main repo just shows a change to the submodule as a whole, not a specific file inside the submodule. 

I don’t have complete control over the source but maybe I’ll see if I can make a change to the submodule itself, that seems to be the easiest. 

Thanks,
Emily 

> On Mar 20, 2020, at 6:18 AM, Paul Barker <pbarker@konsulko.com> wrote:
> 
> On Fri, 20 Mar 2020 at 04:10, Emily <easmith5555@gmail.com> wrote:
>> 
>> Hi all -
>> 
>> I have a recipe that I'd like to patch - the source is in a repo which has a submodule, and the patch occurs in the submodule. Is there a way I can apply this patch without getting an error? I do kind of understand why it's a problem - the patch is changing the pointer of the submodule to a commit which doesn't actually exist. Do I need to build the submodule as a separate recipe and patch it separately maybe?
>> 
>> I used devtool for the patch and if I don't run the devtool reset command, then everything builds, but I think this is just because the workspace created by devtool was added as a layer, which probably isn't a good long term solution.
>> 
>> The error I get (pasted below) says I can "enforce with -f" but I'm not sure where that option goes exactly. Thanks for the help!
>> 
>> Emily
>> 
>> Error on build:
>> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Command Error: 'quilt --quiltrc /local/d6/easmith5/rocko_bitbake/poky/build/tmp/work/aarch64-poky-linux/opc-ua-server-gfex/1.0+gitAUTOINC+921c563309-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
>> Applying patch 0001-Update-Poverty-to-point-to-boost-python3.patch
>> File Poverty is not a regular file -- refusing to patch
>> 1 out of 1 hunk ignored -- rejects in file
>> Patch 0001-Update-Poverty-to-point-to-boost-python3.patch does not apply (enforce with -f)
>> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Function failed: patch_do_patch
> 
> The issue appears to be that patches are applied using quilt which
> doesn't understand a patch like this. I don't know of a good solution
> to this other than making a new commit in the top level repository and
> updating SRCREV.
> 
> Perhaps it's better to carry the diff within the submodule as a patch
> - so you leave the submodule commit pointer where it is and instead
> include all the necessary changes to the submodule in the patch. Would
> that work for you?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [yocto] Patching submodules
  2020-03-20 11:18 ` Paul Barker
  2020-03-20 13:42   ` Emily
@ 2020-03-20 15:17   ` Yann Dirson
  1 sibling, 0 replies; 6+ messages in thread
From: Yann Dirson @ 2020-03-20 15:17 UTC (permalink / raw)
  To: Paul Barker; +Cc: Emily, yocto

[-- Attachment #1: Type: text/plain, Size: 2597 bytes --]

Hi Emily,

I'm not sure how the patch is generated, and (not using devtool myself) I
may understood your problem wrongly
(showing the relevant part of your diff could help), but you could try to
generate it yourself with
"git show --submodule=diff", that could be more palatable to quilt.

Le ven. 20 mars 2020 à 16:09, Paul Barker <pbarker@konsulko.com> a écrit :

> On Fri, 20 Mar 2020 at 04:10, Emily <easmith5555@gmail.com> wrote:
> >
> > Hi all -
> >
> > I have a recipe that I'd like to patch - the source is in a repo which
> has a submodule, and the patch occurs in the submodule. Is there a way I
> can apply this patch without getting an error? I do kind of understand why
> it's a problem - the patch is changing the pointer of the submodule to a
> commit which doesn't actually exist. Do I need to build the submodule as a
> separate recipe and patch it separately maybe?
> >
> > I used devtool for the patch and if I don't run the devtool reset
> command, then everything builds, but I think this is just because the
> workspace created by devtool was added as a layer, which probably isn't a
> good long term solution.
> >
> > The error I get (pasted below) says I can "enforce with -f" but I'm not
> sure where that option goes exactly. Thanks for the help!
> >
> > Emily
> >
> > Error on build:
> > ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch: Command
> Error: 'quilt --quiltrc
> /local/d6/easmith5/rocko_bitbake/poky/build/tmp/work/aarch64-poky-linux/opc-ua-server-gfex/1.0+gitAUTOINC+921c563309-r0/recipe-sysroot-native/etc/quiltrc
> push' exited with 0  Output:
> > Applying patch 0001-Update-Poverty-to-point-to-boost-python3.patch
> > File Poverty is not a regular file -- refusing to patch
> > 1 out of 1 hunk ignored -- rejects in file
> > Patch 0001-Update-Poverty-to-point-to-boost-python3.patch does not apply
> (enforce with -f)
> > ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch:
> Function failed: patch_do_patch
>
> The issue appears to be that patches are applied using quilt which
> doesn't understand a patch like this. I don't know of a good solution
> to this other than making a new commit in the top level repository and
> updating SRCREV.
>
> Perhaps it's better to carry the diff within the submodule as a patch
> - so you leave the submodule commit pointer where it is and instead
> include all the necessary changes to the submodule in the patch. Would
> that work for you?
> 
>


-- 
Yann Dirson <yann@blade-group.com>
Blade / Shadow -- http://shadow.tech

[-- Attachment #2: Type: text/html, Size: 3319 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [yocto] Patching submodules
  2020-03-20 10:18 ` [yocto] " Nicolas Jeker
@ 2020-03-20 15:29   ` Emily
  0 siblings, 0 replies; 6+ messages in thread
From: Emily @ 2020-03-20 15:29 UTC (permalink / raw)
  To: Nicolas Jeker; +Cc: yocto

Hi Nicolas - 

The recipe is already in a custom layer entirely, I just don’t have full control over the source. So I don’t think I need a .bbappend as I can just put it in the main recipe file. 

Thanks,
Emily 

> On Mar 20, 2020, at 10:06 AM, Nicolas Jeker <n.jeker@delisys.ch> wrote:
> 
> On Thu, 2020-03-19 at 23:10 -0500, Emily wrote:
>> Hi all - 
>> 
>> I have a recipe that I'd like to patch - the source is in a repo
>> which has a submodule, and the patch occurs in the submodule. Is
>> there a way I can apply this patch without getting an error? I do
>> kind of understand why it's a problem - the patch is changing the
>> pointer of the submodule to a commit which doesn't actually exist. Do
>> I need to build the submodule as a separate recipe and patch it
>> separately maybe? 
> 
> Is there a reason why you don't use a bbappend file with your patch in
> it in a custom layer?
> 
> Something like this:
> 
> package_ver.bbappend
> --------------------
> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> SRC_URI += "file://abc.patch"
> 
> 
> With this directory structure:
> 
> meta-custom-layer
> ├── package_ver.bbappend
> └── package
>    └── abc.patch
> 
> Replace "package" and "ver" with the correct values (if you don't want
> to set the version you can use "%" as a wildcard).
> 
> Maybe I missed something about your submodule situation and my advice
> is completely wrong, if so, just disregard it.
> 
>> I used devtool for the patch and if I don't run the devtool reset
>> command, then everything builds, but I think this is just because the
>> workspace created by devtool was added as a layer, which probably
>> isn't a good long term solution. 
> 
> You should be able to get the above structure by using 'devtool finish
> recipe meta-custom-layer'. If that doesn't work you can do it manually
> as described above.
> 
>> The error I get (pasted below) says I can "enforce with -f" but I'm
>> not sure where that option goes exactly. Thanks for the help! 
>> 
>> Emily
>> 
>> Error on build: 
>> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch:
>> Command Error: 'quilt --quiltrc
>> /local/d6/easmith5/rocko_bitbake/poky/build/tmp/work/aarch64-poky-
>> linux/opc-ua-server-gfex/1.0+gitAUTOINC+921c563309-r0/recipe-sysroot-
>> native/etc/quiltrc push' exited with 0  Output:
>> Applying patch 0001-Update-Poverty-to-point-to-boost-python3.patch
>> File Poverty is not a regular file -- refusing to patch
>> 1 out of 1 hunk ignored -- rejects in file
>> Patch 0001-Update-Poverty-to-point-to-boost-python3.patch does not
>> apply (enforce with -f)
>> ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch:
>> Function failed: patch_do_patch
> 
> I don't know why this error occurs, maybe someone else knows more.
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-20 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20  4:10 Patching submodules Emily
2020-03-20 10:18 ` [yocto] " Nicolas Jeker
2020-03-20 15:29   ` Emily
2020-03-20 11:18 ` Paul Barker
2020-03-20 13:42   ` Emily
2020-03-20 15:17   ` Yann Dirson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.