[bitbake-devel] devtool hardcodes using 'git' patchtool which causes errors

Adrian Ambrożewicz adrian.ambrozewicz at linux.intel.com
Wed Jan 22 15:05:58 UTC 2020

I actually gave the problem some thought and I believe i must take back 
my first assumption that 'git' patcher is wrong. In fact - is either 
quilt or the way we achieve certain thing described here:

We have repo with project in nested directory. Lets imagine repo with 
following structure
\ // repo root
  \ project_dir
  \ other_project_dir

We have a recipe, which is set to build project from this repo. We do 
that by modyfing S variable to:
S = "${WORKDIR}/git/project_dir/"

Our local patches aims the repository structure, so they modify paths 
like "+++ a/project_dir/src/file.cpp". They don't apply cleanly during 
'bitbake -c patch [project]', as quilt tries to apply them from inside S 
directory ('${WORKDIR}/git/project_dir'). To mitigate that - author of 
recipe used 'striplevel=2' to allow proper building in such case.

Now that I analyzed that I see why 'git' patcher has problems with that. 
Git patcher uses 'git am', which naturally knows where the root of 
repository is (even if it was called from subdirectory). In case of 
'git' patcher striplevel should be defaulted to 1.

My question is - is there a way to have both of these patchers working 
with such folder structure? Maybe 'S' overwriting was not a good idea 
after all?


W dniu 1/22/2020 o 09:49, Adrian Ambrożewicz pisze:
> I see. However - this looks like quite a minefield :)
> W dniu 1/21/2020 o 11:49, Alexander Kanavin pisze:
>> I am not entirely sure about this, but I believe devtool is using git 
>> to keep track of patches when modifying or upgrading (e.g. adding, 
>> modifying or rebasing custom recipe patches), so using quilt may not 
>> be an option. Fixing the scenarios that go wrong for you is probably a 
>> better path.
>> Alex
>> On Tue, 21 Jan 2020 at 10:44, Adrian Ambrożewicz 
>> <adrian.ambrozewicz at linux.intel.com 
>> <mailto:adrian.ambrozewicz at linux.intel.com>> wrote:
>>     In poky sources i can see that default PATCHTOOL used is 'quilt'
>> (https://github.com/openembedded/openembedded-core/blob/master/meta/conf/bitbake.conf) 
>>     and it works flawlessly. Devtool however still defaults to legacy 
>> 'git'
>>     PATCHTOOL, as specified here:
>> http://git.yoctoproject.org/cgit.cgi/poky/plain/scripts/lib/devtool/standard.py 
>>        > f.write('PATCHTOOL = "git"\n')
>>     Request:
>>     I've tried to debug the problem but I'm not very familiar with 
>> Bitbake
>>     code, so I wonder if we could default to 'quilt' for devtool as well?
>>     Rationale:
>>     'git' PATCHER doesn't work well when he have nested WORKDIR and
>>     striplevel used. 'bitbake -c patch [pkg]' works fine, but 'devtool
>>     modify [pkg]' fails with weird behavior. For example - new files
>>     created
>>     by patches are created in wrong location (WORKDIR instead of nested
>>     directory) and package doesn't compile until manually fixed.
>>     Regards,
>>     Adrian
>>     --     _______________________________________________
>>     bitbake-devel mailing list
>>     bitbake-devel at lists.openembedded.org
>>     <mailto:bitbake-devel at lists.openembedded.org>
>>     http://lists.openembedded.org/mailman/listinfo/bitbake-devel

More information about the bitbake-devel mailing list