From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Cc: bitbake-devel@lists.openembedded.org,
tanguy.raufflet@savoirfairelinux.com,
richard.purdie@linuxfoundation.org
Subject: Re: [bitbake-devel] [PATCH v2 2/4] npm: accept unspecified versions in package.json
Date: Sun, 14 Jul 2024 13:13:23 +0200 [thread overview]
Message-ID: <2024071411132327e82ea7@mail.local> (raw)
In-Reply-To: <20240708133357.306422-3-enguerrand.de-ribaucourt@savoirfairelinux.com>
Hello,
It is not possible t apply this patch as it touches two different
repositories: bitbake and oe-core, can you separate it?
On 08/07/2024 15:33:55+0200, Enguerrand de Ribaucourt wrote:
> Our current emulation mandates that the package.json contains a version
> field. Some packages may not provide it when they are not published to
> the registry. The actual `npm pack` would allow such packages, so
> should we.
>
> This patch adds default values to allow building such packages.
> For the shrinkwrap, we can actually use the resolved field which
> contains the exact source, including the revision, to pass integrity
> tests.
>
> This applies for instance to this package which doesn't declare a
> version:
> - https://github.com/cockpit-project/cockpit/blob/23701a555a5af13f998ee4c7526d27fdb5669d63/package.json#L2
>
> Co-authored-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
> Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
> Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
> ---
> bitbake/lib/bb/fetch2/npmsw.py | 2 +-
> meta/classes-recipe/npm.bbclass | 4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/bitbake/lib/bb/fetch2/npmsw.py b/bitbake/lib/bb/fetch2/npmsw.py
> index 018e0ad546..044f5b96f8 100644
> --- a/bitbake/lib/bb/fetch2/npmsw.py
> +++ b/bitbake/lib/bb/fetch2/npmsw.py
> @@ -97,7 +97,7 @@ class NpmShrinkWrap(FetchMethod):
>
> integrity = params.get("integrity", None)
> resolved = params.get("resolved", None)
> - version = params.get("version", None)
> + version = params.get("version", params.get("resolved", None))
>
> # Handle registry sources
> if is_semver(version) and integrity:
> diff --git a/meta/classes-recipe/npm.bbclass b/meta/classes-recipe/npm.bbclass
> index 91da3295f2..a73ff29be8 100644
> --- a/meta/classes-recipe/npm.bbclass
> +++ b/meta/classes-recipe/npm.bbclass
> @@ -72,8 +72,10 @@ def npm_pack(env, srcdir, workdir):
> j = json.load(f)
>
> # base does not really matter and is for documentation purposes
> - # only. But the 'version' part must exist because other parts of
> + # only. But the 'version' part must exist because other parts of
This is an unrelated change and two spaces after a period is correct.
I'd say don't do this unless you go and change the other 154 occurrences
(You also probably don't want to enter this debate)
> # the bbclass rely on it.
> + if 'version' not in j:
> + j['version'] = '0.0.0-unknown'
> base = j['name'].split('/')[-1]
> tarball = os.path.join(workdir, "%s-%s.tgz" % (base, j['version']));
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16403): https://lists.openembedded.org/g/bitbake-devel/message/16403
> Mute This Topic: https://lists.openembedded.org/mt/107102416/3617179
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2024-07-14 11:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 13:33 [Patch v2] bitbake: fetch2: npmsw: fix fetching git revisions not Enguerrand de Ribaucourt
2024-07-08 13:33 ` [PATCH v2 1/4] bitbake: fetch2: npmsw: fix fetching git revisions not on master Enguerrand de Ribaucourt
2024-07-08 13:33 ` [PATCH v2 2/4] npm: accept unspecified versions in package.json Enguerrand de Ribaucourt
2024-07-14 11:13 ` Alexandre Belloni [this message]
2024-07-08 13:33 ` [PATCH v2 3/4] recipetool: create_npm: resolve licenses defined " Enguerrand de Ribaucourt
2024-07-08 13:33 ` [PATCH v2 4/4] recipetool: licenses: add common-licenses md5sums Enguerrand de Ribaucourt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024071411132327e82ea7@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=enguerrand.de-ribaucourt@savoirfairelinux.com \
--cc=richard.purdie@linuxfoundation.org \
--cc=tanguy.raufflet@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.