poky/scripts/lib/recipetool
Paul Eggleton bb8f141d0c devtool: add: fix node.js/npm handling with recipe specific sysroots
The change over to recipe specific sysroots means that we can no longer
get a known location simply from configuration for the npm binary - we
need to get the recipe sysroot for nodejs-native, look there for npm if
we need to check it's present, and add that to PATH when calling out to
npm. Unfortunately this means anywhere we need to get that path we have
to have parsed all recipes, otherwise we have no reliable way of
resolving nodejs-native. Thus we have to change recipetool create to
always parse all recipes (the structure of the code does not allow us to
do this conditionally).

In the worst case, if npm hasn't already been added to its own sysroot
and we are fetching from a source repository rather than an npm
registry, this gets a bit ugly because we end up parsing recipes three
times:
1) recipetool startup, which then fetches the code and determines it's
   a node.js module, finds that npm isn't available and then exits with
   a specific error to tell devtool it needs to build npm
2) when we invoke bitbake -c addto_recipe_sysroot nodejs-native
3) when we re-invoke recipetool

This code is badly in need of refactoring, but now is unfortunately not
the time to do that, so we're going to have to live with this ugliness
for now.

Fixes [YOCTO #10992].

(From OE-Core rev: acfdbd796c99882b8586023c8c6b848716105c8d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-13 10:54:10 +01:00
..
__init__.py scripts/recipetool: Add a recipe auto-creation script 2014-12-23 10:18:15 +00:00
append.py scripts: remove True option to getVarFlag calls 2016-12-16 10:23:23 +00:00
create_buildsys_python.py scripts: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
create_buildsys.py recipetool: create: pick up AC_PROG_SWIG 2016-09-20 15:11:07 +01:00
create_kernel.py scripts: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
create_kmod.py recipetool: create: avoid decoding errors with Python 3 2016-07-08 09:57:24 +01:00
create_npm.py devtool: add: fix node.js/npm handling with recipe specific sysroots 2017-04-13 10:54:10 +01:00
create.py devtool: add: fix node.js/npm handling with recipe specific sysroots 2017-04-13 10:54:10 +01:00
newappend.py scripts: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
setvar.py devtool / recipetool: use tinfoil parsing API 2016-12-14 12:30:49 +00:00