Bug 7330

Summary: Inconsistency between recipe file and layer directory information.
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Alexandru Damian <alexandru.damian>
Status: VERIFIED FIXED QA Contact: Cristina Agurida <cristina-danielax.agurida>
Severity: major    
Priority: Medium+ CC: alexandru.c.georgescu, alexandru.damian, belen.barros.pena, bluelightning, cristiana.voicu, cristina-danielax.agurida, jessica.zhang
Version: unspecified   
Target Milestone: 1.9 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
recipe file path vs layer directory path
none
recipefile-layerdir.png none

Description Belen Barros Pena 2015-02-17 17:35:27 UTC
Created attachment 2413 [details]
recipe file path vs layer directory path

We have a funny issue currently where the path shown in the 'recipe file' information is different from the path shown in the 'layer directory' information. I have attached an example of the problem. 

Since local paths are not useful when you are using Toaster in build mode (since our main use case involves people not running the builds in their local computers), we have opened bug 7301 to remove the full path to the recipe file. We have also removed the layer directory information from the build mode of Toaster. An easy workaround would be simply removing the layer directory information from Toaster alltogether (both build and analysis modes). 

But before going ahead and doing that, it would be interesting to understand which one of them (recipe file path or layer directory path) is the correct one.
Comment 1 Alexandru Damian 2015-03-09 18:50:20 UTC
Both are "correct", in the sense -

- the layer directory is where the layer is checked out by the user

- the recipe path is where bitbake finds the recipe; since toaster checks out a new copy of the layer for building, bitbake sees this copy, and finds the recipe in the new copy

I think that for "localhost" mode, the "layer path" is the important information, as the recipe path is an artifact of toaster, and not directly manageable by the user.

In "hosted" mode, both paths are irrelevant - but we actually identify correctly with layer actually triggered which recipe, so 

 - The recipe path is irrelevant, so it should be taken out. 
 - I would replace the "Layer path" with a link to the layer details page.
Comment 2 Belen Barros Pena 2015-03-12 11:25:50 UTC
(In reply to comment #1)
> Both are "correct", in the sense -
> 
> - the layer directory is where the layer is checked out by the user
> 
> - the recipe path is where bitbake finds the recipe; since toaster checks
> out a new copy of the layer for building, bitbake sees this copy, and finds
> the recipe in the new copy

The problem is, since we are talking about information shown after the build happens, both paths should be showing what was actually used during the build, i.e. the second one you are listing above. 

> 
> I think that for "localhost" mode, the "layer path" is the important
> information, as the recipe path is an artifact of toaster, and not directly
> manageable by the user.

It is still useful to know where the .bb file is inside the layer, so that I can easily look at the source if I want to.

> 
> In "hosted" mode, both paths are irrelevant - but we actually identify
> correctly with layer actually triggered which recipe, so 
> 
>  - The recipe path is irrelevant, so it should be taken out. 

Again, I don't think is irrelevant: it is useful to know where the recipe is inside the layer. 

>  - I would replace the "Layer path" with a link to the layer details page.

This sounds like a good idea. We can remove the column and turn the layer name into a link.
Comment 3 Alexandru Damian 2015-03-12 15:29:22 UTC
> > 
> > I think that for "localhost" mode, the "layer path" is the important
> > information, as the recipe path is an artifact of toaster, and not directly
> > manageable by the user.
> 
> It is still useful to know where the .bb file is inside the layer, so that I
> can easily look at the source if I want to.
...
> 
> > 
> > In "hosted" mode, both paths are irrelevant - but we actually identify
> > correctly with layer actually triggered which recipe, so 
> > 
> >  - The recipe path is irrelevant, so it should be taken out. 
> 
> Again, I don't think is irrelevant: it is useful to know where the recipe is
> inside the layer. 


With the adamian/20150309_bugz the recipe path is always listed relative to the layer.

The patch have been submitted upstream. Moving the bug In Progress Review.

> 
> >  - I would replace the "Layer path" with a link to the layer details page.
> 
> This sounds like a good idea. We can remove the column and turn the layer
> name into a link.

This should be fixed after we separate the build mode and analysis mode applications.

Opened the bug to track this work 

https://bugzilla.yoctoproject.org/show_bug.cgi?id=7452
Comment 4 Belen Barros Pena 2015-03-13 10:19:57 UTC
This sounds good. Thanks, Alex.
Comment 5 Alexandru Damian 2015-03-30 12:06:27 UTC
Merged in master as 5252c459ac1cdc8a869ce02a0d7937c9efb0b833
Comment 6 Belen Barros Pena 2015-03-31 15:25:48 UTC
Still something funny going on: see the attached screenshot recipefile-layerdir.png

Now some of the layer directory information comes from the build (see apache2 in the screenshot); in other cases it doesn't (see acl-native in the screenshot).
Comment 7 Belen Barros Pena 2015-03-31 15:26:13 UTC
Created attachment 2462 [details]
recipefile-layerdir.png
Comment 8 Alexandru Damian 2015-03-31 16:05:29 UTC
This requires a modification in the database structure and build data logger to store the path-flags (e.g. virtual, native) in a different field, and store the file paths in relative form for all recipes.

ATTENTION: The recipes are now stored relative to the Layer.local_path; this needs to invalidated to be stored relative to Layer_Version by moving the "local_path" to Layer_Version - it makes little sense to have it in the Layer class. This triggers cascading changes in the application, so I'm moving this bug to "Major" severity.
Comment 10 Alexandru Damian 2015-06-23 10:22:00 UTC
This was merged upstream.
Comment 11 Cristina Agurida 2015-06-24 08:08:01 UTC
Verified on master: 8ef99a00dc75c6eed87aa1bc1528614a2a27eddf