[OE-core] what is the precise search path for resolving "include" or "require" .inc files?

Robert P. J. Day rpjday at crashcourse.ca
Fri Mar 11 17:07:57 UTC 2016


Quoting Christopher Larson <clarson at kergoth.com>:

> On Fri, Mar 11, 2016 at 5:08 AM Robert P. J. Day <rpjday at crashcourse.ca>
> wrote:
>
>>    not sure why i never noticed this before, but what is the search order
>> or precedence or priority for resolving recipe file directives "include"
>> or "require"? i was just perusing the bitbake user manual, and noticed
>> the explanation that those directives use BBPATH to track down the first
>> include file by a given name.
>>
>>    but AIUI, BBPATH is supposed to represent an ordered set of *layers*
>> (i just examined BBPATH for a current [wind river linux] build, and that
>> is exactly what it seems to contain). so when a recipe file like
>> busybox.whatever.bb contains the line:
>>
>>    require busybox.inc
>>
>> i always just assumed the search would look in the current busybox
>> directory, but that directory is not technically a layer directory --
>> it's not a directory specified on the alleged BBPATH search path.
>>
>>    i never thought about this until i noticed some .bbappend files
>> specifically using directives like:
>>
>>    require recipes-bsp/u-boot/u-boot.inc
>>
>> where that file reference *does* refer to a file relative to some
>> actual layer directory somewhere.
>>
>>    what am i missing here?
>>
>
> BBPATH is temporarily prepended to include the directory the recipe lives
> in, as a special case.

   i *assumed* that must have been what was happening, i just didn't see
that explicitly mentioned in the bitbake user manual. and while we're
talking about the bitbake user manual here:

http://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html

this can't be right, can it?

"3.3.1. Locating Include and Class Files¶

"BitBake uses the BBPATH variable to locate needed include and class files.
The BBPATH variable is analogous to the environment variable PATH.

"In order for include and class files to be found by BitBake, they need to
be located in a "classes" subdirectory that can be found in BBPATH."

   while that statement might be true for class files, pretty sure it
isn't true for *include* files, as it suggests.

rday

p.s. i should probably submit another proofreading patch, to tweak stuff
like this in section 3.3.2:

"In this case, BitBake would search for the directory [sic]  
classes/autotools.bbclass in BBPATH."






More information about the Openembedded-core mailing list