Bug 7603 - Toaster is not storing in its database information about SDK artifacts
Summary: Toaster is not storing in its database information about SDK artifacts
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.1 M3
Assignee: Elliot Smith
QA Contact: Alexandru Roman
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-04-13 14:59 UTC by Belen Barros Pena
Modified: 2016-02-15 15:51 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Design - Downloading SDK artifacts (425.24 KB, application/pdf)
2015-04-13 14:59 UTC, Belen Barros Pena
no flags Details
artifacts.png (288.49 KB, image/png)
2016-01-12 11:56 UTC, Belen Barros Pena
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Belen Barros Pena 2015-04-13 14:59:33 UTC
Created attachment 2472 [details]
Design - Downloading SDK artifacts

Toaster is not storing in its database any of the artifacts in /tmp/deploy/sdk.

According to the design specification, those should be listed in the "Other artifacts" section of the build dashboard.
Comment 1 Elliot Smith 2015-12-18 10:38:43 UTC
To build a target in toaster with SDK bits:

<target>:populate_sdk in the "Build" input box
Comment 2 Elliot Smith 2015-12-21 16:39:18 UTC
Or on the command line:

bitbake -c populate_sdk core-image-minimal
Comment 3 Elliot Smith 2016-01-11 19:39:10 UTC
These artifacts are being stored, but only for the first build which produces them.

If you start with a clean database (or delete everything in the orm_buildartifact table) then run a build, the next build you run will have the artifacts listed.

The issue here is that the SDK deploy directory is not build-specific: it has a path like /home/elliot/poky/build/tmp/deploy/sdk/, so you can't tell which build it came from.

What we're doing at the moment is just associating any files in this directory with the current build, providing they haven't been associated with a previous build. I'm not sure if this is what we want.
Comment 4 Elliot Smith 2016-01-12 08:24:21 UTC
I neglected some information in the above comment. The SDK artifacts only seem to be picked up if I add postfuncs which run after do_populate_sdk; and the directory we were looking for previously may have been incorrect, as we should be looking in SDK_DEPLOY.

I will make the minimal changes required to fix the current code so that SDK artifacts are associated with the first build which produces them, then we can decide where to go from there.
Comment 5 Belen Barros Pena 2016-01-12 11:56:35 UTC
> 
> What we're doing at the moment is just associating any files in this
> directory with the current build, providing they haven't been associated
> with a previous build. I'm not sure if this is what we want.

I guess this was the simplest thing to do at the time, but it causes issues such as artifacts being listed as 'other' simply because they happen to be in the tmp/deploy/images directory. 

Toaster also seems to get a bit confused when you run a build with more than one target (see attached artifacts.png). 

Ideally, we would find a more reliable way of matching builds to artifacts, but I have no idea how :/
Comment 6 Belen Barros Pena 2016-01-12 11:56:56 UTC
Created attachment 2927 [details]
artifacts.png
Comment 7 Elliot Smith 2016-01-12 12:15:07 UTC
The SDK artifacts are actually in tmp/deploy/sdk, which is what you correctly put in your initial bug report.

This is set via the SDK_DEPLOY variable, which is what I'm using to find the artifacts (and which now works, though the artifacts can't be downloaded yet, so I'm working on that next).

However, all the SDK artifacts seem to be in this directory; the only clue about which build they might belong to is in the filename, but that's not a straight correspondence. For example, doing "bitbake -c populate_sdk core-image-minimal" with qemux86 as the machine produces:

tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-2.0+snapshot.host.manifest (9.4 KB) 

tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-2.0+snapshot.sh (144.5 MB)

tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-2.0+snapshot.target.manifest (7.2 KB) 

Maybe we could do one of the following to deal with this:

* Change SDK_DEPLOY in Toaster so we can split the artifacts up into separate directories (sort of what I did with the console output to fix the build logs issue).

OR

* Keep track of what's in the tmp/deploy/sdk directory in buildinfohelper; when new files are added to that directory, associate them with the current build.
Comment 8 Elliot Smith 2016-01-13 11:09:06 UTC
Submitted to Toaster mailing list for review.
Comment 9 Elliot Smith 2016-01-21 12:39:49 UTC
Fixed in master
Comment 10 Alexandru Roman 2016-02-15 15:51:00 UTC
Verified on master: 36b43b233c841b3c09fc17e04686b4b758780963