diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-07-12 15:54:53 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-19 08:56:52 +0100 |
commit | 1027e0e313c4743a7ddb5e192013fba5d7ad0e1c (patch) | |
tree | 1e9c3f5be3bc8dd6fb80d270c21fd3943788e552 /bitbake | |
parent | adbf206526d1237c1ae99f26bb405183e06febe0 (diff) | |
download | poky-1027e0e313c4743a7ddb5e192013fba5d7ad0e1c.tar.gz |
bitbake: toaster: better display of targets which produced no images
SDK targets (populate_sdk) produce SDK artifacts but no image files.
Currently, these targets appear under the "Images" heading in the
build dashboard, even though they aren't strictly image targets.
Change the heading to "Build artifacts". Also remove the section
which states that a build produced no image files: this is not
correct for populate_sdk targets (those targets don't produce
image files under any circumstances); and other changes mean
that all targets which do produce images will now show those
files.
The check for whether to display the "Build artifacts" section also
needs to change, as we show targets here which didn't produce any
images but did produce SDK artifacts.
[YOCTO #8556]
(Bitbake rev: b4dce68045c4615e7a6a474e952f670721a3b54e)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/builddashboard.html | 29 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 51 |
2 files changed, 36 insertions, 44 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index febf8af747..32212ea8d4 100644 --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html | |||
@@ -69,11 +69,11 @@ | |||
69 | 69 | ||
70 | {%if build.outcome == build.SUCCEEDED%} | 70 | {%if build.outcome == build.SUCCEEDED%} |
71 | <!-- built images --> | 71 | <!-- built images --> |
72 | {% if hasImages %} | 72 | {% if hasArtifacts %} |
73 | <h2>Images</h2> | 73 | <h2>Build artifacts</h2> |
74 | {% for target in targets %} | 74 | {% for target in targets %} |
75 | {% if target.target.is_image %} | 75 | {% if target.target.is_image %} |
76 | <div class="well well-transparent dashboard-section"> | 76 | <div class="well well-transparent dashboard-section" data-artifacts-for-target="{{target.target.pk}}"> |
77 | <h3><a href="{% url 'target' build.pk target.target.pk %}">{{target.target.target}}</a></h3> | 77 | <h3><a href="{% url 'target' build.pk target.target.pk %}">{{target.target.target}}</a></h3> |
78 | <dl class="dl-horizontal"> | 78 | <dl class="dl-horizontal"> |
79 | <dt>Packages included</dt> | 79 | <dt>Packages included</dt> |
@@ -81,26 +81,7 @@ | |||
81 | <dt>Total package size</dt> | 81 | <dt>Total package size</dt> |
82 | <dd>{{target.pkgsz|filtered_filesizeformat}}</dd> | 82 | <dd>{{target.pkgsz|filtered_filesizeformat}}</dd> |
83 | </dl> | 83 | </dl> |
84 | {% if target.targetHasNoImages %} | 84 | {% if target.targetHasImages %} |
85 | <div class="row"> | ||
86 | <div class="col-md-7"> | ||
87 | <div class="alert alert-info"> | ||
88 | <p> | ||
89 | <strong>This build did not create any image files</strong> | ||
90 | </p> | ||
91 | <p> | ||
92 | This is probably because valid image and license manifest | ||
93 | files from a previous build already exist in your | ||
94 | <code>build/tmp/deploy</code> | ||
95 | directory. You can | ||
96 | also <a href="{% url 'target' build.pk target.target.pk %}">view the | ||
97 | license manifest information</a> in Toaster. | ||
98 | </p> | ||
99 | </div> | ||
100 | </div> | ||
101 | </div> | ||
102 | {% endif %} | ||
103 | {% if not target.targetHasNoImages %} | ||
104 | <dl class="dl-horizontal"> | 85 | <dl class="dl-horizontal"> |
105 | <dt> | 86 | <dt> |
106 | Manifests | 87 | Manifests |
@@ -163,7 +144,7 @@ | |||
163 | </div> | 144 | </div> |
164 | {% endif %} | 145 | {% endif %} |
165 | {% endfor %} | 146 | {% endfor %} |
166 | {% endif %} | 147 | {% endif %} |
167 | 148 | ||
168 | {%else%} | 149 | {%else%} |
169 | <!-- error dump --> | 150 | <!-- error dump --> |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 02caf54d50..baaa2883bc 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -472,46 +472,57 @@ def builddashboard( request, build_id ): | |||
472 | tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' ); | 472 | tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' ); |
473 | 473 | ||
474 | # set up custom target list with computed package and image data | 474 | # set up custom target list with computed package and image data |
475 | targets = [ ] | 475 | targets = [] |
476 | ntargets = 0 | 476 | ntargets = 0 |
477 | 477 | ||
478 | targetHasNoImages = False | 478 | # True if at least one target for this build has an SDK artifact |
479 | # or image file | ||
480 | has_artifacts = False | ||
481 | |||
479 | for t in tgts: | 482 | for t in tgts: |
480 | elem = { } | 483 | elem = {} |
481 | elem[ 'target' ] = t | 484 | elem['target'] = t |
485 | |||
486 | target_has_images = False | ||
487 | image_files = [] | ||
488 | |||
482 | npkg = 0 | 489 | npkg = 0 |
483 | pkgsz = 0 | 490 | pkgsz = 0 |
484 | package = None | 491 | package = None |
485 | for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]): | 492 | for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]): |
486 | pkgsz = pkgsz + package.size | 493 | pkgsz = pkgsz + package.size |
487 | if ( package.installed_name ): | 494 | if package.installed_name: |
488 | npkg = npkg + 1 | 495 | npkg = npkg + 1 |
489 | elem[ 'npkg' ] = npkg | 496 | elem['npkg'] = npkg |
490 | elem[ 'pkgsz' ] = pkgsz | 497 | elem['pkgsz'] = pkgsz |
491 | ti = Target_Image_File.objects.filter( target_id = t.id ) | 498 | ti = Target_Image_File.objects.filter(target_id = t.id) |
492 | imageFiles = [ ] | ||
493 | for i in ti: | 499 | for i in ti: |
494 | ndx = i.file_name.rfind( '/' ) | 500 | ndx = i.file_name.rfind('/') |
495 | if ( ndx < 0 ): | 501 | if ndx < 0: |
496 | ndx = 0; | 502 | ndx = 0; |
497 | f = i.file_name[ ndx + 1: ] | 503 | f = i.file_name[ndx + 1:] |
498 | imageFiles.append({ | 504 | image_files.append({ |
499 | 'id': i.id, | 505 | 'id': i.id, |
500 | 'path': f, | 506 | 'path': f, |
501 | 'size': i.file_size, | 507 | 'size': i.file_size, |
502 | 'suffix': i.suffix | 508 | 'suffix': i.suffix |
503 | }) | 509 | }) |
504 | if t.is_image and (len(imageFiles) <= 0 or len(t.license_manifest_path) <= 0): | 510 | if len(image_files) > 0: |
505 | targetHasNoImages = True | 511 | target_has_images = True |
506 | elem[ 'imageFiles' ] = imageFiles | 512 | elem['targetHasImages'] = target_has_images |
507 | elem[ 'targetHasNoImages' ] = targetHasNoImages | 513 | |
514 | elem['imageFiles'] = image_files | ||
508 | elem['target_kernel_artifacts'] = t.targetkernelfile_set.all() | 515 | elem['target_kernel_artifacts'] = t.targetkernelfile_set.all() |
509 | 516 | ||
510 | target_sdk_files = t.targetsdkfile_set.all() | 517 | target_sdk_files = t.targetsdkfile_set.all() |
511 | elem['target_sdk_artifacts_count'] = target_sdk_files.count() | 518 | target_sdk_artifacts_count = target_sdk_files.count() |
519 | elem['target_sdk_artifacts_count'] = target_sdk_artifacts_count | ||
512 | elem['target_sdk_artifacts'] = target_sdk_files | 520 | elem['target_sdk_artifacts'] = target_sdk_files |
513 | 521 | ||
514 | targets.append( elem ) | 522 | if target_has_images or target_sdk_artifacts_count > 0: |
523 | has_artifacts = True | ||
524 | |||
525 | targets.append(elem) | ||
515 | 526 | ||
516 | ## | 527 | ## |
517 | # how many packages in this build - ignore anonymous ones | 528 | # how many packages in this build - ignore anonymous ones |
@@ -528,7 +539,7 @@ def builddashboard( request, build_id ): | |||
528 | context = { | 539 | context = { |
529 | 'build' : build, | 540 | 'build' : build, |
530 | 'project' : build.project, | 541 | 'project' : build.project, |
531 | 'hasImages' : build.has_images(), | 542 | 'hasArtifacts' : has_artifacts, |
532 | 'ntargets' : ntargets, | 543 | 'ntargets' : ntargets, |
533 | 'targets' : targets, | 544 | 'targets' : targets, |
534 | 'recipecount' : recipeCount, | 545 | 'recipecount' : recipeCount, |