We have built a custom BSP Reference Minimal Image with docker and nodejs packages, that is working on our custom board with no problems.
But now we need to add some nodejs packages into this image.
I’ve created the workspace recipe using devtool as below:
$ devtool add "npm://registry.npmjs.org;package=sqlite3;version=5.1.7"
But I got the following errors trying to build using devtool build sqlite3:
ERROR: sqlite3-5.1.7-r0 do_configure: 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_configure(d)
0003:
File: '/home/smar/toradex/oe-bsp/build/../layers/openembedded-core/meta/classes/npm.bbclass', lineno: 220, function: npm_do_configure
0216: cached_manifest[depkey] = {}
0217: cached_manifest[depkey][name] = version
0218:
0219: if has_shrinkwrap_file:
*** 0220: _update_manifest("dependencies")
0221:
0222: if dev:
0223: if has_shrinkwrap_file:
0224: _update_manifest("devDependencies")
File: '/home/smar/toradex/oe-bsp/build/../layers/openembedded-core/meta/classes/npm.bbclass', lineno: 214, function: _update_manifest
0210:
0211: # Configure the cached manifest file and cached shrinkwrap file
0212: def _update_manifest(depkey):
0213: for name in orig_manifest.get(depkey, {}):
*** 0214: version = cached_shrinkwrap["dependencies"][name]["version"]
0215: if depkey not in cached_manifest:
0216: cached_manifest[depkey] = {}
0217: cached_manifest[depkey][name] = version
0218:
Exception: KeyError: 'dependencies'
ERROR: Logfile of failure stored in: /home/smar/toradex/oe-bsp/build/tmp/work/armv7at2hf-neon-tdx-linux-gnueabi/sqlite3/5.1.7-r0/temp/log.do_configure.107126
ERROR: Task (/home/smar/toradex/oe-bsp/build/workspace/recipes/sqlite3/sqlite3_5.1.7.bb:do_configure) failed with exit code '1'
I managed that was missing the npm-shrinkwrap.json in the SRC_URI at the sqlite3_5.1.7.bb file, so I put it there as below:
SRC_URI = " \
npm://registry.npmjs.org/;package=node-sqlite3;version=${PV} \
npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \
"
And now I got another kind of errors as below:
ERROR: ExpansionError during parsing /home/smar/toradex/oe-bsp/build/workspace/recipes/sqlite3/sqlite3_5.1.7.bb | ETA: --:--:--
Traceback (most recent call last):
File "/home/smar/toradex/oe-bsp/layers/openembedded-core/bitbake/lib/bb/data_smart.py", line 470, in DataSmart.expandWithRefs(s="${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}", varname='PN'):
tb = sys.exc_info()[2]
> raise ExpansionError(varname, s, exc).with_traceback(tb) from exc
File "/home/smar/toradex/oe-bsp/layers/openembedded-core/bitbake/lib/bb/data_smart.py", line 454, in DataSmart.expandWithRefs(s="${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}", varname='PN'):
try:
> s = __expand_python_regexp__.sub(varparse.python_sub, s)
except SyntaxError as e:
File "/home/smar/toradex/oe-bsp/layers/openembedded-core/bitbake/lib/bb/data_smart.py", line 131, in VariableParse.python_sub(match=<re.Match object; span=(0, 77), match="${@bb.parse.vars_from_file(d.getVar('FILE', False>):
if self.varname:
> vardeps = self.d.getVarFlag(self.varname, "vardeps")
if vardeps is None:
File "/home/smar/toradex/oe-bsp/layers/openembedded-core/bitbake/lib/bb/data_smart.py", line 852, in DataSmart.getVarFlag(var='PN', flag='vardeps', expand=True, noweakdefault=False, parsing=False, retparser=False):
if expand or retparser:
> parser = self.expandWithRefs(value, cachename)
if expand:
File "/home/smar/toradex/oe-bsp/layers/openembedded-core/bitbake/lib/bb/data_smart.py", line 445, in DataSmart.expandWithRefs(s=None, varname='PN[vardeps]'):
if not isinstance(s, str): # sanity check
> return VariableParse(varname, self, s)
bb.data_smart.ExpansionError: Failure expanding variable PN, expression was ${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'} which triggered exception RecursionError: maximum recursion depth exceeded
The variable dependency chain for the failure is: PN -> BPN -> SRC_URI
ERROR: Parsing halted due to errors, see error messages above
NOTE: We cannot use Torizon TCBuilder right now. This will be studied later.
Best regards,
Vilson Balestero
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 6.1.95-rt34-6.7.0+git.7d6bbd3e0ef0 #1 SMP Wed Jun 26 1 5:24:17 UTC 2024
Kernel command line: enable_wait_mode=off galcore.contiguousSize=50331648 r oot=PARTUUID=4e5d7f3a-02 ro rootwait fec_mac=00:14:2d:ac:5e:30 consoleblank=0 no _console_suspend=1 console=tty1 console=ttymxc0,115200n8 fbmem=8M
Distro name: NAME="DCN I/O Gateway"
Distro version: VERSION_ID=6.7.0-build.0
Distro variant: -
Hostname: dcnio
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Colibri iMX6DL/S on Colibri Evaluation Board V 3
Toradex version: 0017 V1.1B
Serial number: 11296304
Processor arch: armv7l
------------------------------------------------------------