* [poky][PATCH] Fix npm to use https rather than http
@ 2022-08-25 20:42 Neil Horman
2022-08-26 10:43 ` [OE-core] " Luca Ceresoli
0 siblings, 1 reply; 4+ messages in thread
From: Neil Horman @ 2022-08-25 20:42 UTC (permalink / raw)
To: openembedded-core; +Cc: Neil Horman
Hit this error while building nlf-native recently:
{
"error": {
"summary": "URI malformed",
"detail": ""
}
}
Some poking about led me to discover that:
1) The npm.py tool replaces npm:// with http://, not https://
2) Some versions of the npm tool don't handle 301 redirects properly,
choosing to display the above error instead when using the default
nodejs registry
It would be good to go fix npm to handle the redirect properly, but it
seems like it would also be good to assume secure http when contacting a
registry, hence, this patch
Signed-off-by: Neil Horman <nhorman@gmail.com>
---
bitbake/lib/bb/fetch2/npm.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 8f7c10ac9b..8a179a339a 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -156,7 +156,7 @@ class Npm(FetchMethod):
raise ParameterError("Invalid 'version' parameter", ud.url)
# Extract the 'registry' part of the url
- ud.registry = re.sub(r"^npm://", "http://", ud.url.split(";")[0])
+ ud.registry = re.sub(r"^npm://", "https://", ud.url.split(";")[0])
# Using the 'downloadfilename' parameter as local filename
# or the npm package name.
--
2.37.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [OE-core] [poky][PATCH] Fix npm to use https rather than http
2022-08-25 20:42 [poky][PATCH] Fix npm to use https rather than http Neil Horman
@ 2022-08-26 10:43 ` Luca Ceresoli
2022-08-26 11:57 ` Ross Burton
0 siblings, 1 reply; 4+ messages in thread
From: Luca Ceresoli @ 2022-08-26 10:43 UTC (permalink / raw)
To: Neil Horman; +Cc: openembedded-core
Hello Neil,
thank you for your patch.
On Thu, 25 Aug 2022 16:42:50 -0400
"Neil Horman" <nhorman@gmail.com> wrote:
> Hit this error while building nlf-native recently:
> {
> "error": {
> "summary": "URI malformed",
> "detail": ""
> }
> }
>
> Some poking about led me to discover that:
> 1) The npm.py tool replaces npm:// with http://, not https://
> 2) Some versions of the npm tool don't handle 301 redirects properly,
> choosing to display the above error instead when using the default
> nodejs registry
>
> It would be good to go fix npm to handle the redirect properly, but it
> seems like it would also be good to assume secure http when contacting a
> registry, hence, this patch
>
> Signed-off-by: Neil Horman <nhorman@gmail.com>
> ---
> bitbake/lib/bb/fetch2/npm.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
Apparently you prepared this patch within the poky git repository. You
shouldn't do that, poky is an integration layer and should not be used
for bitbake development.
Since you want to patch bitbake, you should:
- clone the bitbake repository
- make your commit there
- send it to the bitbake mailing list.
Look at the README.md in the poky root directory for more info.
Thanks!
Best regards,
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [OE-core] [poky][PATCH] Fix npm to use https rather than http
2022-08-26 10:43 ` [OE-core] " Luca Ceresoli
@ 2022-08-26 11:57 ` Ross Burton
2022-08-26 12:21 ` Neil Horman
0 siblings, 1 reply; 4+ messages in thread
From: Ross Burton @ 2022-08-26 11:57 UTC (permalink / raw)
To: Neil Horman; +Cc: OE-core, Luca Ceresoli
> On 26 Aug 2022, at 11:43, Luca Ceresoli via lists.openembedded.org <luca.ceresoli=bootlin.com@lists.openembedded.org> wrote:
>
> Apparently you prepared this patch within the poky git repository. You
> shouldn't do that, poky is an integration layer and should not be used
> for bitbake development.
>
> Since you want to patch bitbake, you should:
> - clone the bitbake repository
> - make your commit there
> - send it to the bitbake mailing list.
>
> Look at the README.md in the poky root directory for more info.
FWIW, git is typically clever enough to handle this case. Feel free to post the patch you have against the poky repository directly to the bitbake mailing list.
Thanks,
Ross
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [poky][PATCH] Fix npm to use https rather than http
2022-08-26 11:57 ` Ross Burton
@ 2022-08-26 12:21 ` Neil Horman
0 siblings, 0 replies; 4+ messages in thread
From: Neil Horman @ 2022-08-26 12:21 UTC (permalink / raw)
To: Ross Burton; +Cc: OE-core, Luca Ceresoli
[-- Attachment #1: Type: text/plain, Size: 829 bytes --]
Copy that, thanks!
On Fri, Aug 26, 2022, 7:57 AM Ross Burton <Ross.Burton@arm.com> wrote:
>
> > On 26 Aug 2022, at 11:43, Luca Ceresoli via lists.openembedded.org
> <luca.ceresoli=bootlin.com@lists.openembedded.org> wrote:
> >
> > Apparently you prepared this patch within the poky git repository. You
> > shouldn't do that, poky is an integration layer and should not be used
> > for bitbake development.
> >
> > Since you want to patch bitbake, you should:
> > - clone the bitbake repository
> > - make your commit there
> > - send it to the bitbake mailing list.
> >
> > Look at the README.md in the poky root directory for more info.
>
> FWIW, git is typically clever enough to handle this case. Feel free to
> post the patch you have against the poky repository directly to the bitbake
> mailing list.
>
> Thanks,
> Ross
[-- Attachment #2: Type: text/html, Size: 1362 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-26 12:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25 20:42 [poky][PATCH] Fix npm to use https rather than http Neil Horman
2022-08-26 10:43 ` [OE-core] " Luca Ceresoli
2022-08-26 11:57 ` Ross Burton
2022-08-26 12:21 ` Neil Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox