<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13901</bug_id>
          
          <creation_ts>2020-05-17 02:28:29 +0000</creation_ts>
          <short_desc>npm build error when the shrinkwrap file has no dependencies</short_desc>
          <delta_ts>2021-04-29 19:11:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>5.99</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>3.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean-Marie Lemetayer">jeanmarie.lemetayer</reporter>
          <assigned_to name="Jean-Marie Lemetayer">jeanmarie.lemetayer</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tim.orling</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87216</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Marie Lemetayer">jeanmarie.lemetayer</who>
    <bug_when>2020-05-17 02:28:29 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
poky master
meta-oe master

Triggering Action/Cause
-----------------------
% devtool add &apos;npm://registry.npmjs.org;package=typescript;version=latest&apos;
...

INFO: Recipe /home/jmlemetayer/yolo-yocto/build/workspace/recipes/typescript/typescript_3.9.2.bb has been automatically created; further editing may be required to make it fully functional

% devtool build typescript

NOTE: Starting bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
Loading cache...done.
Loaded 2300 entries from dependency cache.
Parsing recipes...ERROR: ExpansionError during parsing /home/jmlemetayer/yolo-yocto/build/workspace/recipes/typescript/typescript_3.9.2.bb
Traceback (most recent call last):
  File &quot;/home/jmlemetayer/yolo-yocto/platform/poky/bitbake/lib/bb/data_smart.py&quot;, line 416, in DataSmart.expandWithRefs(s=&apos;${TUNE_FEATURES_tune-${DEFAULTTUNE}}&apos;, varname=&apos;TUNE_FEATURES&apos;):
                     tb = sys.exc_info()[2]
    &gt;                raise ExpansionError(varname, s, exc).with_traceback(tb) from exc

  File &quot;/home/jmlemetayer/yolo-yocto/platform/poky/bitbake/lib/bb/data_smart.py&quot;, line 401, in DataSmart.expandWithRefs(s=&apos;${TUNE_FEATURES_tune-${DEFAULTTUNE}}&apos;, varname=&apos;TUNE_FEATURES&apos;):
                 try:
    &gt;                s = __expand_var_regexp__.sub(varparse.var_sub, s)
                     try:
  File &quot;/home/jmlemetayer/yolo-yocto/platform/poky/bitbake/lib/bb/data_smart.py&quot;, line 97, in VariableParse.var_sub(match=&lt;_sre.SRE_Match object; span=(21, 35), match=&apos;${DEFAULTTUNE}&apos;&gt;):
                         raise Exception(&quot;variable %s references itself!&quot; % self.varname)
    &gt;            var = self.d.getVarFlag(key, &quot;_content&quot;)
                 self.references.add(key)
  File &quot;/home/jmlemetayer/yolo-yocto/platform/poky/bitbake/lib/bb/data_smart.py&quot;, line 772, in DataSmart.getVarFlag(var=&apos;DEFAULTTUNE&apos;, flag=&apos;_content&apos;, expand=True, noweakdefault=False, parsing=False, retparser=False):
             if expand or retparser:
    &gt;            parser = self.expandWithRefs(value, cachename)
             if expand:
  File &quot;/home/jmlemetayer/yolo-yocto/platform/poky/bitbake/lib/bb/data_smart.py&quot;, line 396, in DataSmart.expandWithRefs(s=&apos;core2-64&apos;, varname=&apos;DEFAULTTUNE&apos;):

    &gt;        varparse = VariableParse(varname, self)

bb.data_smart.ExpansionError: Failure expanding variable TUNE_FEATURES, expression was ${TUNE_FEATURES_tune-${DEFAULTTUNE}} which triggered exception RecursionError: maximum recursion depth exceeded while calling a Python object


Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to start bitbake environment


Expectation
-----------
The package should be build.

Actual Result
-------------
An error is raised.

This is because the shrinkwrap file has no dependencies. A workaround is to delete the &apos;npmsw://...&apos; line in the generated .bb file.


Reproducibility
---------------
Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88934</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-01-14 16:11:08 +0000</bug_when>
    <thetext>There is a patch bootlin on the mailing list. Moving to M3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90188</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-04-29 19:11:06 +0000</bug_when>
    <thetext>Fixed by:
https://git.openembedded.org/openembedded-core/commit/?id=ef153ad36d0299e83a03af8f207686d0d8a238b3

and the test case:
$ devtool add &apos;npm://registry.npmjs.org;package=typescript;version=latest&apos;
passed for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90189</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-04-29 19:11:24 +0000</bug_when>
    <thetext>As per previous comment.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>