All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] OE eSDK related fixes
@ 2017-02-06 20:08 Paul Eggleton
  2017-02-06 20:08 ` [PATCH 1/3] lib/bb/build: add tasksbetween() function Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-02-06 20:08 UTC (permalink / raw)
  To: bitbake-devel

One fix directly relating to the extensible SDK in OE and two for the
npm fetcher.


The following changes since commit 2a309cd20cddf3d2258bd00ad06b26452e6cc043:

  bitbake: Bump version to 1.33.0 (develoment version) (2017-01-27 10:40:53 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/bb-esdk-fixes
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bb-esdk-fixes

Paul Eggleton (3):
  lib/bb/build: add tasksbetween() function
  fetch2/npm: handle items only in optionalDependencies
  fetch2/npm: fix handling of os field

 lib/bb/build.py      | 27 +++++++++++++++++++++++++++
 lib/bb/fetch2/npm.py |  8 +++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

-- 
2.9.3



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] lib/bb/build: add tasksbetween() function
  2017-02-06 20:08 [PATCH 0/3] OE eSDK related fixes Paul Eggleton
@ 2017-02-06 20:08 ` Paul Eggleton
  2017-02-06 20:08 ` [PATCH 2/3] fetch2/npm: handle items only in optionalDependencies Paul Eggleton
  2017-02-06 20:08 ` [PATCH 3/3] fetch2/npm: fix handling of os field Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-02-06 20:08 UTC (permalink / raw)
  To: bitbake-devel

Add a utility function that gives the list of dependent tasks between
two specified tasks (just within the same recipe). This is intended to
be able to be executed from recipe context so it uses the datastore
rather than having access to the runqueue.

This will be used in OpenEmbedded-Core's populate_sdk_ext.bbclass to
get the list of tasks between do_image_complete and do_build.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/build.py | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index c08ef89..0d0100a 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -878,3 +878,30 @@ def preceedtask(task, with_recrdeptasks, d):
         if recrdeptask:
             preceed.update(recrdeptask.split())
     return preceed
+
+def tasksbetween(task_start, task_end, d):
+    """
+    Return the list of tasks between two tasks in the current recipe,
+    where task_start is to start at and task_end is the task to end at
+    (and task_end has a dependency chain back to task_start).
+    """
+    outtasks = []
+    tasks = list(filter(lambda k: d.getVarFlag(k, "task"), d.keys()))
+    def follow_chain(task, endtask, chain=None):
+        if not chain:
+            chain = []
+        chain.append(task)
+        for othertask in tasks:
+            if othertask == task:
+                continue
+            if task == endtask:
+                for ctask in chain:
+                    if ctask not in outtasks:
+                        outtasks.append(ctask)
+            else:
+                deps = d.getVarFlag(othertask, 'deps', False)
+                if task in deps:
+                    follow_chain(othertask, endtask, chain)
+        chain.pop()
+    follow_chain(task_start, task_end)
+    return outtasks
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] fetch2/npm: handle items only in optionalDependencies
  2017-02-06 20:08 [PATCH 0/3] OE eSDK related fixes Paul Eggleton
  2017-02-06 20:08 ` [PATCH 1/3] lib/bb/build: add tasksbetween() function Paul Eggleton
@ 2017-02-06 20:08 ` Paul Eggleton
  2017-02-06 20:08 ` [PATCH 3/3] fetch2/npm: fix handling of os field Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-02-06 20:08 UTC (permalink / raw)
  To: bitbake-devel

An npm package.json file has two dependency fields: dependencies and
optionalDependencies. An item in optionalDependencies *may* also be
listed in dependencies, but this is not required (and not necessary
since if it's in optionalDependencies it will be optional, adding it to
dependencies won't do anything). The code here was assuming that an
optional dependency would always be in both, that's probably because
that was true of the examples I was looking at at the time. To fix it,
just add the optional ones to the list we're iterating over.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/fetch2/npm.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py
index 3e35292..8c32f81 100644
--- a/lib/bb/fetch2/npm.py
+++ b/lib/bb/fetch2/npm.py
@@ -195,6 +195,7 @@ class Npm(FetchMethod):
 
         dependencies = pdata.get('dependencies', {})
         optionalDependencies = pdata.get('optionalDependencies', {})
+        dependencies.update(optionalDependencies)
         depsfound = {}
         optdepsfound = {}
         data[pkg]['deps'] = {}
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] fetch2/npm: fix handling of os field
  2017-02-06 20:08 [PATCH 0/3] OE eSDK related fixes Paul Eggleton
  2017-02-06 20:08 ` [PATCH 1/3] lib/bb/build: add tasksbetween() function Paul Eggleton
  2017-02-06 20:08 ` [PATCH 2/3] fetch2/npm: handle items only in optionalDependencies Paul Eggleton
@ 2017-02-06 20:08 ` Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-02-06 20:08 UTC (permalink / raw)
  To: bitbake-devel

When I originally added this check I didn't quite understand how the
values in this field should be expressed - it seems from reading the
documentation if there is an entry starting with '!' then the list is
a blacklist and we shouldn't expect "linux" to be in the list, or we'll
end up skipping important dependencies.

This fixes fetching the "statsd" npm package.

Fixes [YOCTO #10760].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/fetch2/npm.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py
index 8c32f81..15b281f 100644
--- a/lib/bb/fetch2/npm.py
+++ b/lib/bb/fetch2/npm.py
@@ -182,7 +182,12 @@ class Npm(FetchMethod):
             if pkg_os:
                 if not isinstance(pkg_os, list):
                     pkg_os = [pkg_os]
-                if 'linux' not in pkg_os or '!linux' in pkg_os:
+                blacklist = False
+                for item in pkg_os:
+                    if item.startswith('!'):
+                        blacklist = True
+                        break
+                if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
                     logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
                     return
         #logger.debug(2, "Output URL is %s - %s - %s" % (ud.basepath, ud.basename, ud.localfile))
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-06 20:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 20:08 [PATCH 0/3] OE eSDK related fixes Paul Eggleton
2017-02-06 20:08 ` [PATCH 1/3] lib/bb/build: add tasksbetween() function Paul Eggleton
2017-02-06 20:08 ` [PATCH 2/3] fetch2/npm: handle items only in optionalDependencies Paul Eggleton
2017-02-06 20:08 ` [PATCH 3/3] fetch2/npm: fix handling of os field Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.