Skip to contentSkip to conversation

toaster: cummulative 100119 patch

PATCH In review David Reyna 1 participant 4 messages Oct 1, 2019 – Oct 15, 2019

lore
Share & tools
lore
#0 lore raw

cover toaster: cummulative 100119 patch

From: David Reyna <[email protected]>

Toaster cummulative patch October 01, 2019
[YOCTO #13385] toaster: issues in import layer when clicking 'add layer' [YOCTO #13386]toaster: improve warnings when adding dependency to packages

The following changes since commit a73cbe649af5e988eddb4a35b81011cb482d7480:

bitbake: siggen: Remove full path from unitaskhashes keys (2019-09-30 17:23:35 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib dreyna/submit/dreyna/toaster/toaster_cummulative_100119
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dreyna/submit/dreyna/toaster/toaster_cummulative_100119

David Reyna (2):
toaster: issues in import layer when clicking 'add layer'
toaster: improve warnings when adding dependency to packages

 lib/bb/ui/buildinfohelper.py                    | 10 ++++++++++
 lib/toaster/toastergui/static/js/importlayer.js | 12 ++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 toaster: issues in import layer when clicking 'add layer'

From: David Reyna <[email protected]>

There were three issues in this one bug.
1) The Add Layer button allows empty layers
2) The internal XHR URL was wrong, which caused a hidden AJAX error and did not correctly complete the action nor disable the button after an add.
3) There was a race condition between typing in the dependent layer select text box (which would normally disable the add button), and the typeahead pull-down selection (which would normally enable the add button). This forced the user to select the typedahead layer twice.

[YOCTO #13385]

---
 lib/toaster/toastergui/static/js/importlayer.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
lib/toaster/toastergui/static/js/importlayer.js +10 -2
index 2964839..8e2032d 100644
@@ -17,11 +17,15 @@ function importLayerPageInit (ctx) {
   var currentLayerDepSelection;
   var validLayerName = /^(\w|-)+$/;
 
+  /* Catch 'disable' race condition between type-ahead started and "input change" */
+  var typeAheadStarted = 0;
+
   libtoaster.makeTypeahead(layerDepInput,
                            libtoaster.ctx.layersTypeAheadUrl,
                            { include_added: "true" }, function(item){
     currentLayerDepSelection = item;
     layerDepBtn.removeAttr("disabled");
+    typeAheadStarted = 1;
   });
 
   layerDepInput.on("typeahead:select", function(event, data){
@@ -34,7 +38,10 @@ function importLayerPageInit (ctx) {
   // disable the "Add layer" button when the layer input typeahead is empty
   // or not in the typeahead choices
   layerDepInput.on("input change", function(){
-    layerDepBtn.attr("disabled","disabled");
+    if (0 == typeAheadStarted) {
+      layerDepBtn.attr("disabled","disabled");
+    }
+    typeAheadStarted = 0;
   });
 
   /* We automatically add "openembedded-core" layer for convenience as a
@@ -50,6 +57,7 @@ function importLayerPageInit (ctx) {
   });
 
   layerDepBtn.click(function(){
+    typeAheadStarted = 0;
     if (currentLayerDepSelection == undefined)
       return;
 
@@ -77,7 +85,7 @@ function importLayerPageInit (ctx) {
 
     $("#layer-deps-list").append(newLayerDep);
 
-    libtoaster.getLayerDepsForProject(currentLayerDepSelection.layerdetailurl,
+    libtoaster.getLayerDepsForProject(currentLayerDepSelection.xhrLayerUrl,
                                       function (data){
         /* These are the dependencies of the layer added as a dependency */
         if (data.list.length > 0) {
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 toaster: improve warnings when adding dependency to packages

In reply to David Reyna

From: David Reyna <[email protected]>

Some of the objects that bitbake reports to Toaster as dependencies to packages are known objects that are not packages, for example library files and kernel modules. In the Toaster logs, mark these as "Info" instead of "Warning".

[YOCTO #13386]

---
 lib/bb/ui/buildinfohelper.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
lib/bb/ui/buildinfohelper.py +10 -0
index f2151c2..5cbca97 100644
@@ -646,6 +646,9 @@ class ORMWrapper(object):
                 Target_Installed_Package.objects.create(target = target_obj, package = packagedict[p]['object'])
 
         packagedeps_objs = []
+        pattern_so = re.compile(r'.*\.so(\.\d*)?$')
+        pattern_lib = re.compile(r'.*\-suffix(\d*)?$')
+        pattern_ko = re.compile(r'^kernel-module-.*')
         for p in packagedict:
             for (px,deptype) in packagedict[p]['depends']:
                 if deptype == 'depends':
@@ -654,6 +657,13 @@ class ORMWrapper(object):
                     tdeptype = Package_Dependency.TYPE_TRECOMMENDS
 
                 try:
+                    # Skip known non-package objects like libraries and kernel modules
+                    if pattern_so.match(px) or pattern_lib.match(px):
+                        logger.info("Toaster does not add library file dependencies to packages (%s,%s)", p, px)
+                        continue
+                    if pattern_ko.match(px):
+                        logger.info("Toaster does not add kernel module dependencies to packages (%s,%s)", p, px)
+                        continue
                     packagedeps_objs.append(Package_Dependency(
                         package = packagedict[p]['object'],
                         depends_on = packagedict[px]['object'],
Signature · 1 line
1.9.1
#3 lore raw

Re: [PATCH 2/2] toaster: improve warnings when adding dependency to packages

Hi Richard,

This is the second of two patches that I sent. The first one got merged but this one did not.

- David

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of David Reyna
Sent: Tuesday, October 01, 2019 4:18 PM
To: [email protected]
Subject: [bitbake-devel] [PATCH 2/2] toaster: improve warnings when adding dependency to packages

From: David Reyna <[email protected]>

Some of the objects that bitbake reports to Toaster as dependencies to packages are known objects that are not packages, for example library files and kernel modules. In the Toaster logs, mark these as "Info" instead of "Warning".

[YOCTO #13386]

---
 lib/bb/ui/buildinfohelper.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
lib/bb/ui/buildinfohelper.py +10 -0
index f2151c2..5cbca97 100644
@@ -646,6 +646,9 @@ class ORMWrapper(object):
                 Target_Installed_Package.objects.create(target = target_obj, package = packagedict[p]['object'])
 
         packagedeps_objs = []
+        pattern_so = re.compile(r'.*\.so(\.\d*)?$')
+        pattern_lib = re.compile(r'.*\-suffix(\d*)?$')
+        pattern_ko = re.compile(r'^kernel-module-.*')
         for p in packagedict:
             for (px,deptype) in packagedict[p]['depends']:
                 if deptype == 'depends':
@@ -654,6 +657,13 @@ class ORMWrapper(object):
                     tdeptype = Package_Dependency.TYPE_TRECOMMENDS
 
                 try:
+                    # Skip known non-package objects like libraries and kernel modules
+                    if pattern_so.match(px) or pattern_lib.match(px):
+                        logger.info("Toaster does not add library file dependencies to packages (%s,%s)", p, px)
+                        continue
+                    if pattern_ko.match(px):
+                        logger.info("Toaster does not add kernel module dependencies to packages (%s,%s)", p, px)
+                        continue
                     packagedeps_objs.append(Package_Dependency(
                         package = packagedict[p]['object'],
                         depends_on = packagedict[px]['object'],
Signature · 7 lines
1.9.1

-- 
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel