<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/fetch2/npmsw.py, branch master-next</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=master-next</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=master-next'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2025-01-08T11:34:04+00:00</updated>
<entry>
<title>bitbake: fetch2: npmsw: remove old lockfile format support</title>
<updated>2025-01-08T11:34:04+00:00</updated>
<author>
<name>Stefan Herbrechtsmeier</name>
<email>stefan.herbrechtsmeier@weidmueller.com</email>
</author>
<published>2025-01-07T09:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=eb0c87fa4c3cc85ecb907f42559fbe9afb25aae7'/>
<id>urn:sha1:eb0c87fa4c3cc85ecb907f42559fbe9afb25aae7</id>
<content type='text'>
Remove support for the old lockfile format. The old lockfile format is
required by npm 6 / Node.js 14 which is out of maintenance [2].

[1] https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json
[2] https://nodejs.org/en/about/previous-releases

(Bitbake rev: 7824e19483d9b60a259d6e3a4c7068fade94f2bf)

Signed-off-by: Stefan Herbrechtsmeier &lt;stefan.herbrechtsmeier@weidmueller.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2: npmsw: ignore bundled dependencies in packages</title>
<updated>2024-12-20T16:18:59+00:00</updated>
<author>
<name>Stefan Herbrechtsmeier</name>
<email>stefan.herbrechtsmeier@weidmueller.com</email>
</author>
<published>2024-12-09T10:31:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=02f8ea68657c159486940be9d59391745c517858'/>
<id>urn:sha1:02f8ea68657c159486940be9d59391745c517858</id>
<content type='text'>
The npm package lock and shrinkwrap file list bundled dependencies which
are supplied together with the parent dependency. The flag depends on
the lock file version. Add the missing `inBundle` flag to packages list
processing.

(Bitbake rev: 042d7121ddc93c18306bf03d26ea774f66379a90)

Signed-off-by: Stefan Herbrechtsmeier &lt;stefan.herbrechtsmeier@weidmueller.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2/npmsw: allow packages not declaring a registry version</title>
<updated>2024-08-23T08:48:48+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-22T07:53:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=ec86853a2691dd903428e484d0ae3f321734f60d'/>
<id>urn:sha1:ec86853a2691dd903428e484d0ae3f321734f60d</id>
<content type='text'>
We fetch npm dependencies from the npm-shrinkwrap.json file. They can
point to a package on the NPM registry with a version field, or to a
git/http/file URL with the resolved field. Such packages are allowed not
to declare a registry version field because they may not have been
published to the NPM registry. The previous implementation refuses to
fetch such packages and throws an error.

The resolved field contains the exact source, including the revision,
wich we can use to pass as SRC_URI to the git/http/file fetcher. The
integrity field is also mandatory for HTTP tarballs which will ensure
reproducibility. So even if the version field is not present, we are
still fetching a precise revision of the package.

Another commit published along this stack is also required in the npm
class to support these packages.

v5:
 - improve commit message
v3:
 - Split bitbake npmsw.py modification in another commit

Co-authored-by: Tanguy Raufflet &lt;tanguy.raufflet@savoirfairelinux.com&gt;
(Bitbake rev: 209982b5a3efc8081e65b4326bf9b64eef7f0ba0)

Signed-off-by: Tanguy Raufflet &lt;tanguy.raufflet@savoirfairelinux.com&gt;
Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2/npmsw: fix fetching git revisions not on master</title>
<updated>2024-08-23T08:48:48+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-22T07:53:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=524e6b65a64c0310918cda9eaf5c1b6dd819dd0f'/>
<id>urn:sha1:524e6b65a64c0310918cda9eaf5c1b6dd819dd0f</id>
<content type='text'>
The NPM package.json documentation[1] states that git URLs may contain
a commit-ish suffix to specify a specific revision. When running
`npm install`, this revision will be looked for on any branch of the
repository.

The bitbake implementation however translates the URL stored in
package.json into a git URL to be fetch by the bitbake git fetcher. The
bitbake fetcher git.py, enforces the branch to be master by default. If
the revision specified in the package.json is not on the master branch,
the fetch will fail while the package.json is valid.

To fix this, append the ";nobranch=1" suffix to the revision in the git
URL to be fetched. This will make the bitbake git fetcher ignore the
branch and respect the behavior of `npm install``.

This can be tested with the following command:
 $ devtool add --npm-dev https://github.com/seapath/cockpit-cluster-dashboard.git -B version
Which points to a project which has a package.json with a git URL:
```json
  "devDependencies": {
    "cockpit-repo": "git+https://github.com/cockpit-project/cockpit.git#d34cabacb8e5e1e028c7eea3d6e3b606d862b8ac"
  }
```
In this repo, the specified revision is on the "main" branch, which
would fail without this fix.

[1] https://docs.npmjs.com/cli/v10/configuring-npm/package-json#git-urls-as-dependencies

Co-authored-by: Tanguy Raufflet &lt;tanguy.raufflet@savoirfairelinux.com&gt;
(Bitbake rev: 37a35adf7882f231c13643dbf9168497c6a242a1)

Signed-off-by: Tanguy Raufflet &lt;tanguy.raufflet@savoirfairelinux.com&gt;
Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch/npmsw: The fetcher shouldn't have any knowledge of S</title>
<updated>2024-05-23T10:27:08+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-05-22T15:38:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=7812f104db9a2c72ea4dd5c458a4d50613360b08'/>
<id>urn:sha1:7812f104db9a2c72ea4dd5c458a4d50613360b08</id>
<content type='text'>
I don't know why there is hardcoded knowledge of S in the fetcher but there
shouldn't be and the OE unpack changes highlight this doing things it
shouldn't.

Drop the S reference and use rootdir which is the only place it should
be touching.

(Bitbake rev: 84f102954e10a3390fca9c26d5c3c639e952a2c9)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2: Add API for upstream source tracing</title>
<updated>2023-10-15T08:12:43+00:00</updated>
<author>
<name>Alberto Pianon</name>
<email>alberto@pianon.eu</email>
</author>
<published>2023-10-01T07:52:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=ef3e46afd910d4b7727d42c4c18b501525c65695'/>
<id>urn:sha1:ef3e46afd910d4b7727d42c4c18b501525c65695</id>
<content type='text'>
This patch adds an API to bb.fetch2 to enable users to plug in an unpack
tracer that can trace each source file back to its corresponding
upstream source url, even when multiple upstream sources are combined
together in the same unpack directory. This may be required for software
composition analysis, license compliance, and detailed SBoM generation.

This patch provides only the needed hooks in bb.fetch2 code and a dummy
abstract class defining the API; users may load their own unpack tracer
class by setting the BB_UNPACK_TRACER_CLASS config parameter.

(Bitbake rev: 05051152cc42acc52bcf9af9a696f632fac4307f)

Signed-off-by: Alberto Pianon &lt;alberto@pianon.eu&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: fetch2/npmsw: Check if there are dependencies before trying to fetch them</title>
<updated>2023-08-04T10:48:26+00:00</updated>
<author>
<name>BELOUARGA Mohamed</name>
<email>m.belouarga@technologyandstrategy.com</email>
</author>
<published>2023-07-20T23:41:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=1f92db2d2cadf623f8799d7c58495a6158d3d405'/>
<id>urn:sha1:1f92db2d2cadf623f8799d7c58495a6158d3d405</id>
<content type='text'>
When there are no dependencies, _foreach_proxy_method does not verify that there are
dependencies to fetch before fetching them.

(Bitbake rev: 48a102e49448656ef25fb689af7b0971fde523e3)

Signed-off-by: BELOUARGA Mohamed &lt;m.belouarga@technologyandstrategy.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2/npmsw: Support old and new shrinkwrap formats</title>
<updated>2023-06-30T08:50:46+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-06-30T08:49:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8ee607b9729b6bf0bcfce71d5072f4b0386ede4d'/>
<id>urn:sha1:8ee607b9729b6bf0bcfce71d5072f4b0386ede4d</id>
<content type='text'>
"fetch2/npmsw: Add support for the new format of the shrinkwrap file"
added support for the new format shrinkwrap files but this regressed
our tests which still use the old format.

Similar to how npm handles this, support both for now until we can
migrate our tests.

(Bitbake rev: 9941b480a0e2a8b57f2ed069cd583f2784394a2b)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2/npmsw: Don't fetch dev dependencies when they are not demanded</title>
<updated>2023-06-29T10:10:39+00:00</updated>
<author>
<name>BELOUARGA Mohamed</name>
<email>m.belouarga@technologyandstrategy.com</email>
</author>
<published>2023-06-04T01:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d3642c2d102787cd3b12a5ad319b37a3d58220b1'/>
<id>urn:sha1:d3642c2d102787cd3b12a5ad319b37a3d58220b1</id>
<content type='text'>
Dev dependencies should not be fetched only if it is specified in the
recipe.

(Bitbake rev: 224c2bb1fd3f16ac4063dc0eb8ba43eee34ba782)

Signed-off-by: BELOUARGA Mohamed &lt;m.belouarga@technologyandstrategy.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2/npmsw: Add support for the new format of the shrinkwrap file</title>
<updated>2023-06-29T10:10:39+00:00</updated>
<author>
<name>BELOUARGA Mohamed</name>
<email>m.belouarga@technologyandstrategy.com</email>
</author>
<published>2023-06-04T01:39:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d988d3157886e044358547bf1f504b86c9f560c7'/>
<id>urn:sha1:d988d3157886e044358547bf1f504b86c9f560c7</id>
<content type='text'>
Npm is a package manager that has its own manner to handle installation of packages.
But it is not yocto friendly, for instance NPM fetch dependencies in the middle of compilation.

The shrinkwrap file changed its format over npm versions, but npm does not version
this file, so we can use it properly.
The actual changes make NPM depencies work with the actual shrinkwrap format.

(Bitbake rev: 19b9f7f0f451a636f3fdcdc1bb283ab431ede612)

Signed-off-by: BELOUARGA Mohamed &lt;m.belouarga@technologyandstrategy.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
