diff mbox series

command.py: cleanup bb.cache.parse_recipe

Message ID 20221124091045.12018-1-Qi.Chen@windriver.com
State New
Headers show
Series command.py: cleanup bb.cache.parse_recipe | expand

Commit Message

Chen, Qi Nov. 24, 2022, 9:10 a.m. UTC
The parse_recipe has been removed from bb.cache, replace it with
the databuilder._parse_recipe.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 lib/bb/command.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie Nov. 24, 2022, 12:01 p.m. UTC | #1
On Thu, 2022-11-24 at 01:10 -0800, Chen Qi wrote:
> The parse_recipe has been removed from bb.cache, replace it with
> the databuilder._parse_recipe.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  lib/bb/command.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/bb/command.py b/lib/bb/command.py
> index fa9fd054c..c9571f63d 100644
> --- a/lib/bb/command.py
> +++ b/lib/bb/command.py
> @@ -564,7 +564,7 @@ class CommandsSync:
>          if config_data:
>              # We have to use a different function here if we're passing in a datastore
>              # NOTE: we took a copy above, so we don't do it here again
> -            envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
> +            envdata = command.cooker.databuilder._parse_recipe(config_data, fn, appendfiles, mc)['']
>          else:
>              # Use the standard path
>              envdata = command.cooker.databuilder.parseRecipe(fn, appendfiles)

How did you run into that? I'm a bit worried we're missing some test
coverage here?

Cheers,

Richard
Chen, Qi Nov. 24, 2022, 12:17 p.m. UTC | #2
Hi Richard,

I met the error on our layerindex.

Error message is as below.
NOTE: Starting bitbake server...
ERROR: Unable to read /home/oelayer/layerindex/git___lxgit_wrs_com_layers_meta-arm/meta-arm/recipes-bsp/trusted
-firmware-m/trusted-firmware-m_1.6.0.bb: Traceback (most recent call last):
  File "/home/oelayer/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/command.py", line 90, in runCommand
    result = command_method(self, commandline)
  File "/home/oelayer/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/command.py", line 567, in parseRecipeFile
    envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
AttributeError: module 'bb.cache' has no attribute 'parse_recipe'

Regards,
Qi

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Thursday, November 24, 2022 8:02 PM
To: Chen, Qi <Qi.Chen@windriver.com>; bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH] command.py: cleanup bb.cache.parse_recipe

On Thu, 2022-11-24 at 01:10 -0800, Chen Qi wrote:
> The parse_recipe has been removed from bb.cache, replace it with the 
> databuilder._parse_recipe.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  lib/bb/command.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/bb/command.py b/lib/bb/command.py index 
> fa9fd054c..c9571f63d 100644
> --- a/lib/bb/command.py
> +++ b/lib/bb/command.py
> @@ -564,7 +564,7 @@ class CommandsSync:
>          if config_data:
>              # We have to use a different function here if we're passing in a datastore
>              # NOTE: we took a copy above, so we don't do it here again
> -            envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
> +            envdata = 
> + command.cooker.databuilder._parse_recipe(config_data, fn, 
> + appendfiles, mc)['']
>          else:
>              # Use the standard path
>              envdata = command.cooker.databuilder.parseRecipe(fn, 
> appendfiles)

How did you run into that? I'm a bit worried we're missing some test coverage here?

Cheers,

Richard
Richard Purdie Nov. 24, 2022, 3:13 p.m. UTC | #3
Hi Qi,

On Thu, 2022-11-24 at 12:17 +0000, Chen, Qi wrote:
> I met the error on our layerindex.
> 
> Error message is as below.
> NOTE: Starting bitbake server...
> ERROR: Unable to read /home/oelayer/layerindex/git___lxgit_wrs_com_layers_meta-arm/meta-arm/recipes-bsp/trusted
> -firmware-m/trusted-firmware-m_1.6.0.bb: Traceback (most recent call last):
>   File "/home/oelayer/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/command.py", line 90, in runCommand
>     result = command_method(self, commandline)
>   File "/home/oelayer/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/command.py", line 567, in parseRecipeFile
>     envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
> AttributeError: module 'bb.cache' has no attribute 'parse_recipe'

Thanks.

I had a look at what could call parseRecipeFile(). I can see some
commented out code in layerindex but it doesn't pass a config_data. The
only other calls are from tinfoil's parse_recipe_file() function and
none of those I can see pass config_data either.

Can you see where the config_data is coming from?

It looks like we've broken this at least once before:

https://git.yoctoproject.org/poky/commit/bitbake/lib/bb/command.py?id=70ee928f8f4152f198f4db61517c958d54f1c0a7

so we really need to figure out what is using it and add a test to
ensure coverage. Is this some local customisation you have to
layerindex?

Cheers,

Richard
diff mbox series

Patch

diff --git a/lib/bb/command.py b/lib/bb/command.py
index fa9fd054c..c9571f63d 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -564,7 +564,7 @@  class CommandsSync:
         if config_data:
             # We have to use a different function here if we're passing in a datastore
             # NOTE: we took a copy above, so we don't do it here again
-            envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
+            envdata = command.cooker.databuilder._parse_recipe(config_data, fn, appendfiles, mc)['']
         else:
             # Use the standard path
             envdata = command.cooker.databuilder.parseRecipe(fn, appendfiles)