Re: Patching submodules

Nicolas Jeker

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:

SRC_URI += "file://abc.patch"

With this directory structure:

├── 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!


Error on build:
ERROR: opc-ua-server-gfex-1.0+gitAUTOINC+921c563309-r0 do_patch:
Command Error: 'quilt --quiltrc
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.

Join to automatically receive all group messages.