bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: public@smn.dk
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH] Recipes containing both git and npmsw sources in the SRC_URI fail during fetch from the shrinkwrap. It seems that when the fetcher is fetching from the shrinkwrap, the SRCREV variable has been deleted but it still ends up fetching from the git source resulting in an error because SRCREV is undefined. The root cause of this is that the Fetch class defaults to urls from the SRC_URI when the urls parameter contains an empty list. This patch will ensure that Fetch is not instantiated if the urls list is empty.
Date: Sun, 16 Apr 2023 12:56:52 -0700	[thread overview]
Message-ID: <hd1M.1681675012932104736.XKYK@lists.openembedded.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 521 bytes --]

[PATCH] Recipes containing both git and npmsw sources in the SRC_URI fail during fetch from the shrinkwrap. It seems that when the fetcher is fetching from the shrinkwrap, the SRCREV variable has been deleted but it still ends up fetching from the git source resulting in an error because SRCREV is undefined. The root cause of this is that the Fetch class defaults to urls from the SRC_URI when the urls parameter contains an empty list. This patch will ensure that Fetch is not instantiated if the urls list is empty.

[-- Attachment #1.2: Type: text/html, Size: 521 bytes --]

[-- Attachment #2: 0001-Recipes-containing-both-git-and-npmsw-sources-in-the.patch --]
[-- Type: application/octet-stream, Size: 1628 bytes --]

From 56a6e9787a87f57b9cc9da0f6f64abcd8a4a4a9a Mon Sep 17 00:00:00 2001
From: Svend Meyland Nicolaisen <svend.nicolaisen@nktphotonics.com>
Date: Sun, 16 Apr 2023 01:42:24 +0200
Subject: [PATCH] Recipes containing both git and npmsw sources in the SRC_URI
 fail during fetch from the shrinkwrap. It seems that when the fetcher is
 fetching from the shrinkwrap, the SRCREV variable has been deleted but it
 still ends up fetching from the git source resulting in an error because
 SRCREV is undefined. The root cause of this is that the Fetch class defaults
 to urls from the SRC_URI when the urls parameter contains an empty list. This
 patch will ensure that Fetch is not instantiated if the urls list is empty.

Signed-off-by: Svend Meyland Nicolaisen <svend.nicolaisen@nktphotonics.com>
---
 lib/bb/fetch2/npmsw.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/npmsw.py b/lib/bb/fetch2/npmsw.py
index 36fcbfba..cc81100b 100644
--- a/lib/bb/fetch2/npmsw.py
+++ b/lib/bb/fetch2/npmsw.py
@@ -205,7 +205,9 @@ class NpmShrinkWrap(FetchMethod):
         # This fetcher resolves multiple URIs from a shrinkwrap file and then
         # forwards it to a proxy fetcher. The management of the donestamp file,
         # the lockfile and the checksums are forwarded to the proxy fetcher.
-        ud.proxy = Fetch([dep["url"] for dep in ud.deps if dep["url"]], data)
+        shrinkwrap_urls = [dep["url"] for dep in ud.deps if dep["url"]]
+        if shrinkwrap_urls:
+            ud.proxy = Fetch(shrinkwrap_urls, data)
         ud.needdonestamp = False
 
     @staticmethod
-- 
2.39.2.windows.1


             reply	other threads:[~2023-04-16 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 19:56 public [this message]
2023-04-17 21:01 [PATCH] Recipes containing both git and npmsw sources in the SRC_URI fail during fetch from the shrinkwrap. It seems that when the fetcher is fetching from the shrinkwrap, the SRCREV variable has been deleted but it still ends up fetching from the git source resulting in an error because SRCREV is undefined. The root cause of this is that the Fetch class defaults to urls from the SRC_URI when the urls parameter contains an empty list. This patch will ensure that Fetch is not instantiated if the urls list is empty Svend Meyland Nicolaisen

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=hd1M.1681675012932104736.XKYK@lists.openembedded.org \
    --to=public@smn.dk \
    --cc=bitbake-devel@lists.openembedded.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).