<?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>14236</bug_id>
          
          <creation_ts>2021-02-17 13:50:16 +0000</creation_ts>
          <short_desc>npmsw does not support github URLs in the npm-shrinkwrap.json file</short_desc>
          <delta_ts>2023-02-28 17:53:07 +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>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</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>enhancement</bug_severity>
          <target_milestone>4.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paulo Castro">pefcastro</reporter>
          <assigned_to name="Mark">mark.asselstine</assigned_to>
          <cc>mark.asselstine</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</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>89282</commentid>
    <comment_count>0</comment_count>
    <who name="Paulo Castro">pefcastro</who>
    <bug_when>2021-02-17 13:50:16 +0000</bug_when>
    <thetext>It seems that npmsw does not support github URLs in the following format:

github:balena-io-modules/unbzip2-stream#942fc218013c14adab01cf693b0500cf6ac83193

or even:

balena-io-modules/unbzip2-stream#942fc218013c14adab01cf693b0500cf6ac83193

which are supported by the &quot;standard&quot; npm tool and documented at:

https://docs.npmjs.com/cli/v6/commands/npm-install 

It looks like the relevant poky / bitbake lines of code are around:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/bb/fetch2/npmsw.py?id=507a47a4e5077d5f8f76d9629be6b871dfd8eb90#n125

Please add support for those github URL formats. Thanks!

Additional info:

The balena CLI is an open source Node.js / npm project:
https://github.com/balena-io/balena-cli
It includes a fairly large npm-shrinkwrap.json file:
https://github.com/balena-io/balena-cli/blob/master/npm-shrinkwrap.json

One of our users attempted building the balena CLI using Yocto / Bitbake and reported getting errors from Bitbake&apos;s npmsw regarding github URLs.

A workaround seems to be to modify the URLs to use the following (older?) format:

git+https://github.com/resin-io-modules/unbzip2-stream.git#942fc218013c14adab01cf693b0500cf6ac83193

The error / bug was originally reported at:
https://forums.balena.io/t/balena-cli-compilation-issues-in-yocto/252703

I have also created a counterpart issue in the balena CLI repo:
https://github.com/balena-io/balena-cli/issues/2192</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89283</commentid>
    <comment_count>1</comment_count>
    <who name="Paulo Castro">pefcastro</who>
    <bug_when>2021-02-17 14:06:30 +0000</bug_when>
    <thetext>It was also reported that npmsw does not support &quot;the from: line to specify branches with commits not merged to master (branch must be specified in the version: line before the commit hash)&quot;.

I think it regards the &quot;from&quot; property of shrinkwrap blocks such as:

&quot;multicast-dns&quot;: {
  &quot;version&quot;: &quot;git+https://github.com/resin-io-modules/multicast-dns.git#a15c63464eb43e8925b187ed5cb9de6892e8aacc&quot;,
  &quot;from&quot;: &quot;git+https://github.com/resin-io-modules/multicast-dns.git#listen-on-all-interfaces&quot;,
  ...
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89294</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-02-18 15:42:37 +0000</bug_when>
    <thetext>A valid bug but we don&apos;t have anyone to work on it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92204</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-12-21 22:24:28 +0000</bug_when>
    <thetext>Paulo, would you like to work on this bug? Bumping to M2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94964</commentid>
    <comment_count>4</comment_count>
    <who name="Mark">mark.asselstine</who>
    <bug_when>2023-02-17 21:44:10 +0000</bug_when>
    <thetext>This has partially been addressed by
---
commit 1d8af6aed0a929f493d2c3e31b8d3ee3a70beb43
Author: Stefan Herbrechtsmeier &lt;stefan.herbrechtsmeier@weidmueller.com&gt;
Date:   Thu Oct 28 14:41:43 2021 +0200

    fetch2: npmsw: Add support for github prefix in npm shrinkwrap version
---

I have added the other shortforms for bitbucket, gist, and gitlab along with some tests. I will send the review out next week.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95026</commentid>
    <comment_count>5</comment_count>
    <who name="Mark">mark.asselstine</who>
    <bug_when>2023-02-28 17:53:07 +0000</bug_when>
    <thetext>This was partially fixed by commit 1d8af6aed0a9 (Thu Oct 28 14:41:43 2021 +0200) [fetch2: npmsw: Add support for github prefix in npm shrinkwrap version] which added support for the github prefix.

To complete the fix, commit 0ac6f6cb5d807919ed13a8b7bb3fb551b79c5a71 (Fri Feb 24 15:43:44 2023 -0500) [fetch/npmsw: add more short forms for git operations] was merged which adds support for the gist, gitlab and bitbucket prefixes as well as the gitlab short form which forgoes any prefix at all.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>