Skip to contentSkip to conversation

Unable to build airbrake npm module in Yocto Scarthgap #bitbake #devtool #scarthgap #npm

DISCUSSION [email protected] 2 participants 4 messages Nov 25, 2024 – Dec 3, 2024

lore
Share & tools
lore
#0 lore raw

I have created airbrake npm module recipe using recipe tool by this command: devtool add "npm://registry.npmjs.org;package=airbrake;version=2.0.1". But when buiding the airbrake module using bitbake I am getting this error:

Quoted 126 lines

ERROR: airbrake-2.0.1-r0 do_compile: Error executing a python function in exec_func_python() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module> 0001:
*** 0002:npm_do_compile(d)
0003:
File:
'/home/rently/Desktop/yocto/V5.1/sources/poky/meta/classes-recipe/npm.bbclass',
lineno: 299, function: npm_do_compile
0295:
0296:        # Pack and install the main package
0297:        (tarball, _) = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)

0298:        cmd = "npm install %s %s" % (shlex.quote(tarball),
d.getVar("EXTRA_OENPM"))
*** 0299:        env.run(cmd, args=args)
0300:}
0301:
0302:npm_do_install() {
0303:    # Step three: final install
File:
'/home/rently/Desktop/yocto/V5.1/sources/poky/bitbake/lib/bb/fetch2/npm.py',
lineno: 130, function: run
0126:            if args:
0127:                for key, value in args:
0128:                    cmd += " --%s=%s" % (key, shlex.quote(value))
0129:
*** 0130:            return _run(cmd)
0131:
0132:class Npm(FetchMethod):
0133:    """Class to fetch a package from a npm registry"""
0134:
File:
'/home/rently/Desktop/yocto/V5.1/sources/poky/bitbake/lib/bb/fetch2/npm.py',
lineno: 118, function: _run
0114:
0115:            def _run(cmd):
0116:                cmd = "NPM_CONFIG_USERCONFIG=%s " %
(self.user_config.name) + cmd
0117:                cmd = "NPM_CONFIG_GLOBALCONFIG=%s " %
(self.global_config_name) + cmd
*** 0118:                return runfetchcmd(cmd, d, workdir=workdir)
0119:
0120:            if configs:
0121:                bb.warn("Use of configs argument of
NpmEnvironment.run() function"
0122:                    " is deprecated. Please use args argument
instead.")
File:
'/home/rently/Desktop/yocto/V5.1/sources/poky/bitbake/lib/bb/fetch2/__init__.py',
lineno: 960, function: runfetchcmd
0956:                bb.utils.remove(f, True)
0957:            except OSError:
0958:                pass
0959:
*** 0960:        raise FetchError(error_message)
0961:
0962:    return output
0963:
0964:def check_network_access(d, info, url):
Exception: bb.fetch2.FetchError: Fetcher failure: Fetch command export
PSEUDO_DISABLED=1; export
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export
SSH_AGENT_PID="2600"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh";
export PATH="/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/bin/python3-native:/home/rently/Desktop/yocto/V5.1/sources/poky/scripts:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot/usr/bin/crossscripts:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/sbin:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/bin:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/sbin:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/bin:/home/rently/Desktop/yocto/V5.1/sources/poky/bitbake/bin:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/hosttools"; export HOME="/tmp/tmpmztrh1m5"; NPM_CONFIG_GLOBALCONFIG=/dev/null
NPM_CONFIG_USERCONFIG=/tmp/tmp3032ad0i npm install
/tmp/tmpygfjhpxt/airbrake-2.0.1.tgz  --target_arch=arm64
--build-from-source=true --legacy-peer-deps=true failed with exit code 1,
output:
npm verb cli
/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/bin/node
/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/bin/npm

npm info using [email protected]
npm info using [email protected]
npm WARN config only Use --omit=dev to omit dev dependencies from the
install.
npm verb title npm install /tmp/tmpygfjhpxt/airbrake-2.0.1.tgz
npm verb argv "install" "/tmp/tmpygfjhpxt/airbrake-2.0.1.tgz"
"--target_arch" "arm64" "--build-from-source" "true" "--legacy-peer-deps"
"true"
npm verb logfile logs-max:10 dir:/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/npm-cache/_logs/2024-11-25T04_07_10_504Z-

npm verb logfile /home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/npm-cache/_logs/2024-11-25T04_07_10_504Z-debug-0.log

npm WARN config includes both --global and --audit, which is currently unsupported.
npm sill logfile done cleaning log files
npm sill idealTree buildDeps
npm sill fetch manifest airbrake@file:../../../../../../../../../../../../../tmp/tmpygfjhpxt/airbrake-2.0.1.tgz

npm sill placeDep ROOT [email protected] OK for:  want:
file:../../../../../../../../../../../../../tmp/tmpygfjhpxt/airbrake-2.0.1.tgz

npm sill fetch manifest [email protected]
npm sill fetch manifest [email protected]
npm sill fetch manifest [email protected]
npm sill placeDep node_modules/airbrake lodash.merge@ OK for:
[email protected] want: 4.6.2
npm sill placeDep node_modules/airbrake request@ OK for: [email protected]
want: 2.88.2
npm sill placeDep node_modules/airbrake stack-trace@ OK for:
[email protected] want: 0.0.9
npm verb stack Error: request to https://registry.npmjs.org/lodash.merge
failed: cache mode is 'only-if-cached' but no cached response is
available.
npm verb stack     at cacheFetch (/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/cache/index.js:12:13)

npm verb stack     at async fetch (/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/fetch.js:98:7)

npm verb stack     at async RegistryFetcher.packument (/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:91:19)

npm verb stack     at async RegistryFetcher.manifest (/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:129:23)

Quoted 17 lines

npm verb cwd /tmp/tmpmztrh1m5
npm verb Linux 5.15.0-125-generic
npm verb node v20.13.0
npm verb npm  v10.5.2
npm ERR! code ENOTCACHED
npm ERR! request to https://registry.npmjs.org/lodash.merge failed: cache
mode is 'only-if-cached' but no cached response is available.
npm verb exit 1
npm verb unfinished npm timer reify 1732507630680
npm verb unfinished npm timer reify:loadTrees 1732507630681
npm verb code 1
npm ERR! A complete log of this run can be found in:
/home/rently/Desktop/yocto/V5.1/core-image-base/tmp/work/armv8a-poky-linux/airbrake/2.0.1/npm-cache/_logs/2024-11-25T04_07_10_504Z-debug-0.log

But the point here is lodash.merge module is already downloaded and placed in the $WORKDIR/npm/node_modules. Still bitbake is trying to download it from npm registery.

#1 lore raw

Re: [yocto] Unable to build airbrake npm module in Yocto Scarthgap #devtool #scarthgap #npm #bitbake

Build configuration for your reference:

#2 lore raw

Re: [yocto] Unable to build airbrake npm module in Yocto Scarthgap #devtool #scarthgap #npm #bitbake

Following your description, it built on my machine without errors, once I untangled the licenses of the dependencies.

Have you changed the generated recipe on any way (beside fixing the licenses, I guess)? Just for confirmation, the error also persists after "bitbake -c clean airbrake" also, right?

Also, one thing that looks just a tiny little off: the Scarthgap branch of meta-oe has nodejs 20.12.2, but your logs indicate 20.13.0. Are you using a custom nodejs recipe? (Though my gut feeling is that this angle is a red herring, still...)

#3 lore raw

Re: [yocto] Unable to build airbrake npm module in Yocto Scarthgap #devtool #scarthgap #npm #bitbake

I am able to fix the issue.
meta-oe has 20.12.0, but i required 20.13.0, so i added the recipe for that. But missed to include nodejs-oe-cache-20.13. after including that, it is working fine now.

Thanks...