Skip to contentSkip to conversation

nodejs-oe-cache: fix offline install of dependencies

PATCH In review Martin Hundebøll 5 participants 11 messages May 3, 2024 – May 30, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nodejs-oe-cache: fix offline install of dependencies

Apparently, npm has changed its request accept header, so that cache lookup misses. This causes an ENOTCACHED error when doing the offline install in do_compile() from npm.bbclass.

Fix it by updating the fake cache entry to match the newest behaviour from npm.

Note that npm doesn't agree with itself, as it still uses the previous header value when doing npm cache add <pkg>, but the new value when doing npm install <pkg>.

Bug submitted upstream:
https://github.com/npm/cli/issues/7465

---
 .../recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache +1 -1
index f59620764..eb0f143ea 100755
@@ -30,7 +30,7 @@ const xlate = {
 		time: Date.now(),
 		url:  key,
 		reqHeaders: {
-		    'accept': 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
+		    'accept': 'application/json',
 		},
 		resHeaders: {
 		    "content-type": "application/json",
Signature · 1 line
2.44.0
#1 lore raw

Sorry, forgot the [meta-oe] prefix.

// Martin

Quoted 39 lines · Martin Hundebøll

Apparently, npm has changed its request accept header, so that cache lookup misses. This causes an ENOTCACHED error when doing the offline install in do_compile() from npm.bbclass.

Fix it by updating the fake cache entry to match the newest behaviour from npm.

Note that npm doesn't agree with itself, as it still uses the previous
header value when doing npm cache add <pkg>, but the new value when doing npm install <pkg>.

Bug submitted upstream:
https://github.com/npm/cli/issues/7465

---
 .../recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache  | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

20.12/oe-npm-cache b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache- 20.12/oe-npm-cache
index f59620764..eb0f143ea 100755
--- a/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm- cache
+++ b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm- cache

meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache +1 -1
@@ -30,7 +30,7 @@ const xlate = {
  		time: Date.now(),
  		url:  key,
  		reqHeaders: {
-		    'accept': 'application/vnd.npm.install-v1+json;
 q=1.0, application/json; q=0.8, */*',
+		    'accept': 'application/json',
  		},
  		resHeaders: {

      "content-type": "application/json",

#2 lore raw
In reply to Martin Hundebøll

Thanks, perfect timing, I've just sent e-mail reply to nodejs upgrade that npm-10.5.0 upgrade broke this. Will test your change now. Thanks!

Quoted 45 lines · Martin Hundeb?ll via lists.openembedded.org

Apparently, npm has changed its request accept header, so that cache lookup misses. This causes an ENOTCACHED error when doing the offline install in do_compile() from npm.bbclass.

Fix it by updating the fake cache entry to match the newest behaviour from npm.

Note that npm doesn't agree with itself, as it still uses the previous header value when doing npm cache add <pkg>, but the new value when doing npm install <pkg>.

Bug submitted upstream:
https://github.com/npm/cli/issues/7465

---
 .../recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache +1 -2
index f59620764..eb0f143ea 100755
@@ -30,7 +30,7 @@ const xlate = {
                time: Date.now(),
                url:  key,
                reqHeaders: {
-                   'accept': 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
+                   'accept': 'application/json',
                },
                resHeaders: {
                    "content-type": "application/json",
--

2.44.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110244): https://lists.openembedded.org/g/openembedded-devel/message/110244
Mute This Topic: https://lists.openembedded.org/mt/105884883/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 3 lines · Martin Jansa via lists.openembedded.org

Thanks, perfect timing, I've just sent e-mail reply to nodejs upgrade that npm-10.5.0 upgrade broke this. Will test your change now. Thanks!

And it works for me, thanks again.

Cheers,

#5 lore raw
In reply to Martin Hundebøll

Hi Khem,

Please pick this patch for scarthgap too.

Thanks,
Martin

Quoted 39 lines · Martin Hundebøll

Apparently, npm has changed its request accept header, so that cache lookup misses. This causes an ENOTCACHED error when doing the offline install in do_compile() from npm.bbclass.

Fix it by updating the fake cache entry to match the newest behaviour from npm.

Note that npm doesn't agree with itself, as it still uses the previous
header value when doing npm cache add <pkg>, but the new value when doing npm install <pkg>.

Bug submitted upstream:
https://github.com/npm/cli/issues/7465

---
 .../recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache  | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

20.12/oe-npm-cache b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache- 20.12/oe-npm-cache
index f59620764..eb0f143ea 100755
--- a/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm- cache
+++ b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm- cache

meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache +1 -1
@@ -30,7 +30,7 @@ const xlate = {
  		time: Date.now(),
  		url:  key,
  		reqHeaders: {
-		    'accept': 'application/vnd.npm.install-v1+json;
 q=1.0, application/json; q=0.8, */*',
+		    'accept': 'application/json',
  		},
  		resHeaders: {

      "content-type": "application/json",

#6 lore raw

+Armin. as Armin is already preparing first batch of changes for scarthgap.

Quoted 58 lines · Martin Hundeb?ll via lists.openembedded.org

Hi Khem,

Please pick this patch for scarthgap too.

Thanks,
Martin

Quoted 38 lines · Martin Hundebøll

Apparently, npm has changed its request accept header, so that cache lookup misses. This causes an ENOTCACHED error when doing the offline install in do_compile() from npm.bbclass.

Fix it by updating the fake cache entry to match the newest behaviour from npm.

Note that npm doesn't agree with itself, as it still uses the previous
header value when doing npm cache add <pkg>, but the new value when doing npm install <pkg>.

Bug submitted upstream:
https://github.com/npm/cli/issues/7465

---
 .../recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache  | 2
+-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

20.12/oe-npm-cache b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache- 20.12/oe-npm-cache
index f59620764..eb0f143ea 100755
--- a/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm- cache
+++ b/meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm- cache

meta-oe/recipes-devtools/nodejs/nodejs-oe-cache-20.12/oe-npm-cache +1 -1
@@ -30,7 +30,7 @@ const xlate = {
              time: Date.now(),
              url:  key,
              reqHeaders: {
-                 'accept': 'application/vnd.npm.install-v1+json;
 q=1.0, application/json; q=0.8, */*',
+                 'accept': 'application/json',
              },
              resHeaders: {
Quoted 1 line

"content-type": "application/json",

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110259): https://lists.openembedded.org/g/openembedded-devel/message/110259
Mute This Topic: https://lists.openembedded.org/mt/105884883/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw

When is the expected next update to the scarthgap branch? I've watched the patch move from  master-next  to  master, but there does not seem to be a visible scarthgap-next branch to watch.

#8 lore raw
Quoted 2 lines · Geoff Parker via lists.openembedded.org

When is the expected next update to the scarthgap branch? I've watched the patch move from master-next to master, but there does not seem to be a visible scarthgap-next branch to watch.

Usually there is a monthly release update to stable branches that Armin queues up in contrib repo e.g.

https://git.openembedded.org/meta-openembedded-contrib/log/?h=stable/scarthgap-nut

eventually when this branch is gone through some level of testing, it is proposed to upstream
branch via scarthgap-next in main repo.

Quoted 8 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110334): https://lists.openembedded.org/g/openembedded-devel/message/110334
Mute This Topic: https://lists.openembedded.org/mt/105884883/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#9 lore raw

Thanks Khem for the link to openembedded-contrib and information on how scarthgap updates
are staged. However, I'm not seeing the nodejs-os-cache commit in the stable/scarthgap-nut
branch which is needed to fix nodejs builds on scarthgap also. Are recent fixes in
meta-openembedded master backported also?

cc Armin
Quoted 24 lines · Khem Raj
Quoted 2 lines · Geoff Parker via lists.openembedded.org

When is the expected next update to the scarthgap branch? I've watched the patch move from master-next to master, but there does not seem to be a visible scarthgap-next branch to watch.

Usually there is a monthly release update to stable branches that Armin queues up in contrib repo e.g.

https://git.openembedded.org/meta-openembedded-contrib/log/?h=stable/scarthgap-nut

eventually when this branch is gone through some level of testing, it is proposed to upstream
branch via scarthgap-next in main repo.

Quoted 8 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110334): https://lists.openembedded.org/g/openembedded-devel/message/110334
Mute This Topic: https://lists.openembedded.org/mt/105884883/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Tested-by
#10 lore raw

Hi,

Op 14-05-2024 om 19:39 schreef Geoff Parker:

Quoted 8 lines

Thanks Khem for the link to openembedded-contrib and information on how scarthgap updates
are staged. However, I'm not seeing the nodejs-os-cache commit in the stable/scarthgap-nut
branch which is needed to fix nodejs builds on scarthgap also. Are recent fixes in
meta-openembedded master backported also?

Quoted 9 lines
cc Armin
Quoted 6 lines · Khem Raj
Quoted 2 lines · Geoff Parker via lists.openembedded.org

When is the expected next update to the scarthgap branch? I've watched the patch move from master-next to master, but there does not seem to be a visible scarthgap-next branch to watch.

Indeed

Quoted 4 lines
Quoted 4 lines

Usually there is a monthly release update to stable branches that Armin queues up in contrib repo e.g.

https://git.openembedded.org/meta-openembedded-contrib/log/?h=stable/scarthgap-nut

Not there yet

Quoted 3 lines
Quoted 3 lines

eventually when this branch is gone through some level of testing, it is proposed to upstream
branch via scarthgap-next in main repo.

I am guessing this patch is badly needed to get many nodejs modules to build.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
#11 lore raw

Hi,

Op 21-05-2024 om 21:33 schreef Ferry Toth:

Quoted 21 lines

Hi,

Op 14-05-2024 om 19:39 schreef Geoff Parker:

Quoted 8 lines

Thanks Khem for the link to openembedded-contrib and information on how scarthgap updates
are staged. However,  I'm not seeing the nodejs-os-cache commit in the stable/scarthgap-nut
branch which is needed to fix nodejs builds on scarthgap also. Are recent fixes in
meta-openembedded master backported also?

Quoted 9 lines
cc Armin
Quoted 6 lines · Khem Raj
Quoted 2 lines · Geoff Parker via lists.openembedded.org

When is the expected next update to the scarthgap branch? I've watched the patch move from  master-next  to  master, but there does not seem to be a visible scarthgap-next branch to watch.

Quoted 8 lines

Indeed

Quoted 4 lines
Quoted 4 lines

Usually there is a monthly release update to stable branches that Armin queues up in contrib repo e.g.

https://git.openembedded.org/meta-openembedded-contrib/log/?h=stable/scarthgap-nut

Not there yet

Thanks, it landed in scarthgap.

Quoted 19 lines
Quoted 3 lines
Quoted 3 lines

eventually when this branch is gone through some level of testing, it is proposed to upstream
branch via scarthgap-next in main repo.

I am guessing this patch is badly needed to get many nodejs modules to build.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines