From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 140A9C77B72 for ; Fri, 14 Apr 2023 11:42:01 +0000 (UTC) Subject: Problems having both git and npmsw sources in recipe #bitbake To: bitbake-devel@lists.openembedded.org From: public@smn.dk X-Originating-Location: Birkerød, Capital Region, DK (130.228.29.38) X-Originating-Platform: Windows Chrome 112 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Fri, 14 Apr 2023 04:41:57 -0700 Message-ID: Content-Type: multipart/alternative; boundary="LkXpKnXccfZIhGxIAAHz" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 14 Apr 2023 11:42:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14699 --LkXpKnXccfZIhGxIAAHz Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi I have posted the following topic under the group Openembedded-issues. I am= a little unsure if that is the right place, as there seems to be little or= no activity in that group? Openembedded-issues@lists.openembedded.org | Problems having both git and n= pmsw sources in recipe ( https://lists.openembedded.org/g/Openembedded-issu= es/topic/problems_having_both_git_and/98260091?p=3D,,,20,0,0,0::recentpostd= ate/sticky,,,20,2,0,98260091,previd%3D1681471653367016231,nextid%3D13285434= 07000000000&previd=3D1681471653367016231&nextid=3D1328543407000000000 ) Hi I am experiencing problems with a recipe where I have both a git and a npms= w source in the SRC_URI. It seems that when the fetcher is fetching from th= e shrinkwrap, the SRCREV variable has been deleted but it still ends up fet= ching from the git source resulting in an error because SRCREV is undefined= . The problem occurs because the Fetch class defaults to the value of SRC_URI= if the urls parameter contains an empty list. The following change to the = npmsw.py file seems to solve the problem: diff --git a/bitbake/lib/bb/fetch2/npmsw.py b/bitbake/lib/bb/fetch2/npmsw.p= y index=C2=A0a8c4d3528f..4d700a537a=C2=A0100644 ---=C2=A0a/bitbake/lib/bb/fetch2/npmsw.py +++=C2=A0b/bitbake/lib/bb/fetch2/npmsw.py @@=C2=A0-193,7=C2=A0+193,9=C2=A0@@=C2=A0class=C2=A0NpmShrinkWrap(FetchMetho= d): # 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. - =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ud.proxy =3D Fetch([dep["url"] = for dep in ud.deps if dep["url"]], data) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0shrinkwrap_urls=C2=A0=3D= =C2=A0[dep["url"]=C2=A0for=C2=A0dep=C2=A0in=C2=A0ud.deps=C2=A0if=C2=A0dep["= url"]] +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if=C2=A0shrinkwrap_urls: +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ud= .proxy=C2=A0=3D=C2=A0Fetch(shrinkwrap_urls,=C2=A0data) ud.needdonestamp=C2=A0=3D=C2=A0False Are=C2=A0this=C2=A0change=C2=A0OK=C2=A0or=C2=A0can=C2=A0it=C2=A0result=C2= =A0in=C2=A0other=C2=A0issues? Also more generally why does the Fetch class default to the value of SRC_UR= I variable if the urls parameter contains an empty list? Isn't this a stran= ge implementation? It also seems to result in issues if the shrinkwrap file= contains no dependencies. Please note that I am fairly new to bitbake and completely new to the sourc= e code. :) Kind=C2=A0regards, Svend=C2=A0Meyland=C2=A0Nicolaisen --LkXpKnXccfZIhGxIAAHz Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi

I have posted the following topic under the group Openembedde= d-issues. I am a little unsure if that is the right place, as there seems t= o be little or no activity in that group? 

Openembedded-issues@lists.= openembedded.org | Problems having both git and npmsw sources in recipe=

Hi

I am = experiencing problems with a recipe where I have both a git and a npmsw sou= rce in the SRC_URI. It seems that when the fetcher is fetching from the shr= inkwrap, 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 = problem occurs because the Fetch class defaults to the value of SRC_URI if = the urls parameter contains an empty list. The following change to the npms= w.py file seems to solve the problem:

diff --git a/bitbake/lib/bb/fetch2/npm= sw.py b/bitbake/lib/bb/fetch2/npmsw.py
index a8c4d3528f..4d700a537a 1006= 44
---&= nbsp;a/bitbake/lib/bb/fetch2/npmsw.py
+++ b/bitbake/lib/bb/fetch2/npmsw.py
@@ -= 193,7 +193,9 @@ class NpmShrinkWrap(FetchMethod):
  =        # This fetcher resolves multiple = URIs from a shrinkwrap file and then
       &nb= sp; # forwards it to a proxy fetcher. The management of the donestamp = file,
&= nbsp;        # the lockfile and the= checksums are forwarded to the proxy fetcher.
-      &nb= sp; ud.proxy =3D Fetch([dep["url"] for dep in ud.deps if dep["url"]], = data)
+=         shrinkwrap_urls =3D&nb= sp;[dep["url"] for dep in ud.deps if dep["url= "]]
+&n= bsp;       if shrinkwrap_urls:
+ &nbs= p;          ud.proxy = ;=3D Fetch(shrinkwrap_urls, data)
      &n= bsp;  ud.needdonestamp =3D False

Are this chan= ge OK or can it result in other iss= ues?


Also more generally why does the Fetch class default to the value of SR= C_URI variable if the urls parameter contains an empty list? Isn't this a s= trange implementation? It also seems to result in issues if the shrinkwrap = file contains no dependencies.

Please note that I am fairly new to bitbake a= nd completely new to the source code. :)

Kind regards,
Svend Meyland = ;Nicolaisen
--LkXpKnXccfZIhGxIAAHz--