bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Michael Opdenacker <michael.opdenacker@bootlin.com>
To: Yoann Congal <yoann.congal@smile.fr>,
	Fawzi KHABER <fawzi.khaber@smile.fr>,
	bitbake-devel@lists.openembedded.org
Cc: Ever ATILANO <ever.atilano@smile.fr>,
	YP docs mailing list <docs@lists.yoctoproject.org>
Subject: Re: [bitbake-devel] [PATCH v2 2/2] bitbake-user-manual: update Hello World example
Date: Tue, 28 Feb 2023 10:16:11 +0100	[thread overview]
Message-ID: <1b239014-ff1f-92f4-94a4-d756cc6e1f57@bootlin.com> (raw)
In-Reply-To: <4984ee49-eb42-4891-f9fc-7ce7dc79f2ab@smile.fr>

Hi Yoann,

On 27.02.23 at 19:13, Yoann Congal wrote:
> Hi Michael,
>
> On 2/27/23 18:42, Michael Opdenacker wrote:
>>>          When you run BitBake, it begins looking for metadata files. The
>>>        :term:`BBPATH` variable is what tells BitBake where
>>> @@ -254,17 +242,6 @@ Following is the complete "Hello World" example.
>>
>> Wait, before this, it seems you forgot to update the output of the "bitbake" command right after setting the BBPATH variable. Or maybe you didn't work with the "master" branch. Here's what I get when I use bitbake from the current Poky master branch:
>>
>> $bitbake
>> Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
>>
>> Unless there's something in my environment that makes BitBake behave differently, but that's worth double checking anyway.
> FYI, we already did some back and forth internally on this ^^
>
> Be sure to have the BBPATH envvar unset before starting. Its really easy mixing shells and reusing one that did have a OE env sourced at some point and so an active BBPATH envvar.
>
> Here is a minimal script I used to reproduce the output in the patch.
>
>    $ printenv |grep BBPATH # ensure $BBPATH is not set
>    $ git clone git://git.openembedded.org/bitbake # clone latest master bitbake
>    $ cd bitbake/
>    $ ./bin/bitbake --version
>    BitBake Build Tool Core version 2.3.1
>    
>    $ export PATH=$PWD/bin:$PATH
>    $ which bitbake # must point to the above bitbake
>    
>    $ mkdir ../hello && cd ../hello/
>    $ bitbake
>    ERROR: The BBPATH variable is not set and bitbake did not find a conf/bblayers.conf file in the expected location.
>    Maybe you accidentally invoked bitbake from the wrong directory?
>
> I guess the following differences come from the same reason.
>
> Can you try again with the above script?


I've just tested this so far, and I have the same output as you do.

However, when I run "bitbake" again after setting BBPATH (step 4), I get 
an error message that is not mentioned in the patch (which doesn't 
update step 4):

ERROR: Unable to parse 
/home/mike/work/git/git.openembedded.org/bitbake/lib/bb/parse/__init__.py
Traceback (most recent call last):
   File 
"/home/mike/work/git/git.openembedded.org/bitbake/lib/bb/parse/__init__.py", 
line 127, in resolve_file(fn='conf/bitbake.conf', 
d=<bb.data_smart.DataSmart object at 0x7fbe7a5200a0>):
              if not newfn:
     >            raise IOError(errno.ENOENT, "file %s not found in %s" 
% (fn, bbpath))
              fn = newfn
FileNotFoundError: [Errno 2] file conf/bitbake.conf not found in 
/home/mike/tmp/hello

I confirm I'm using the latest bitbake.


>>>        exists, you can run the ``bitbake`` command again::
>>>             $ bitbake
>>> -       ERROR: Traceback (most recent call last):
>>> -         File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
>>> -           return func(fn, *args)
>>> -         File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 177, in _inherit
>>> -           bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
>>> -         File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 92, in inherit
>>> -           include(fn, file, lineno, d, "inherit")
>>> -         File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
>>> -           raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
>>> -       ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
>>> -
>>>           ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
>>>          In the sample output,
>>
>> Same here. At this stage on Poky master, I get:
>> $bitbake
>> Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.


Now, I'm getting something different. Maybe I wasn´t referring to the 
right step (step 6 here). I have the same error but with extra details:

ERROR: Unable to parse 
/home/mike/work/git/git.openembedded.org/bitbake/lib/bb/parse/parse_py/BBHandler.py
Traceback (most recent call last):
   File 
"/home/mike/work/git/git.openembedded.org/bitbake/lib/bb/parse/parse_py/BBHandler.py", 
line 67, in inherit(files=['base'], fn='configuration INHERITs', 
lineno=0, d=<bb.data_smart.DataSmart object at 0x7fac30c200a0>):
              if not os.path.exists(file):
     >            raise ParseError("Could not inherit file %s" % (file), 
fn, lineno)

bb.parse.ParseError: ParseError in configuration INHERITs: Could not 
inherit file classes/base.bbclass

I think at least there should be a "..." line to indicate that there are 
more lines between the bitbake command and the final line. Unless I'm 
the only one getting this.

>>> @@ -284,7 +261,10 @@ Following is the complete "Hello World" example.
>>>          $ mkdir classes
>>>          Move to the ``classes`` directory and then create the
>>> -    ``base.bbclass`` file by inserting this single line: addtask build
>>> +    ``base.bbclass`` file by inserting this single line::
>>> +
>>> +      addtask build
>>> +
>>>        The minimal task that BitBake runs is the ``do_build`` task. This is
>>>        all the example needs in order to build the project. Of course, the
>>>        ``base.bbclass`` can have much more depending on which build
>>
>> Good catch. This is ugly in the current docs.
>>
>>> @@ -328,10 +308,11 @@ Following is the complete "Hello World" example.
>>>          BBFILES += "${LAYERDIR}/*.bb"
>>>          BBFILE_COLLECTIONS += "mylayer"
>>>          BBFILE_PATTERN_mylayer := "^${LAYERDIR_RE}/"
>>> +      LAYERSERIES_COMPAT_mylayer = "dunfell"
>> You may mention that "dunfell" is just an example, and should be adapted to the OpenEmbedded-Core version(s) that your layer supports. By the way, "kirkstone" should be a better choice as it should last longer than "dunfell".
>>
>> By the way, wishing we had a DISTRO_NAME_NO_CAP macro like in the YP manual, but that's will be a separate topic.


This should still be addressed.

Fawzi, could you send an update addressing at least the above remarks?

Then, I'll be happy to test your new instructions again.

Thanks again,

Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



  reply	other threads:[~2023-02-28  9:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 13:51 [PATCH v2 1/2] doc: ref-variables: add LAYERSERIES_COMPAT to term glossary Fawzi KHABER
2023-02-27 13:51 ` [PATCH v2 2/2] bitbake-user-manual: update Hello World example Fawzi KHABER
2023-02-27 17:42   ` [bitbake-devel] " Michael Opdenacker
2023-02-27 18:13     ` Yoann Congal
2023-02-28  9:16       ` Michael Opdenacker [this message]
2023-02-28 10:09         ` Fawzi KHABER
2023-03-01 10:42           ` Fawzi KHABER
2023-02-27 15:50 ` [bitbake-devel] [PATCH v2 1/2] doc: ref-variables: add LAYERSERIES_COMPAT to term glossary Michael Opdenacker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b239014-ff1f-92f4-94a4-d756cc6e1f57@bootlin.com \
    --to=michael.opdenacker@bootlin.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=docs@lists.yoctoproject.org \
    --cc=ever.atilano@smile.fr \
    --cc=fawzi.khaber@smile.fr \
    --cc=yoann.congal@smile.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).