* [PATCH v2 1/3] npm.bbclass: Fix file permissions before opening it for writing [not found] <16EEAE47FC3C363C.27599@lists.openembedded.org> @ 2022-05-13 15:30 ` Zoltan Boszormenyi 2022-05-13 15:30 ` [PATCH v2 2/3] npm.bbclass: Don't create /usr/lib/node symlink Zoltan Boszormenyi 2022-05-13 15:30 ` [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink Zoltan Boszormenyi 0 siblings, 2 replies; 6+ messages in thread From: Zoltan Boszormenyi @ 2022-05-13 15:30 UTC (permalink / raw) To: openembedded-core Cc: Jean-Marie LEMETAYER, Zoltán Böszörményi From: Zoltán Böszörményi <zboszor@gmail.com> Some node module archives in npmjs.org contain wrong permissions. I found a case with package.json in the archive being r-xr-xr-x for which open(..., "w") fails. Modify the manifest file permissions to add the write bit for the owner. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --- meta/classes/npm.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index ba50fcac20..86ee0f665a 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -81,6 +81,7 @@ python npm_do_configure() { import json import re import shlex + import stat import tempfile from bb.fetch2.npm import NpmEnvironment from bb.fetch2.npm import npm_unpack @@ -202,6 +203,7 @@ python npm_do_configure() { if has_shrinkwrap_file: _update_manifest("devDependencies") + os.chmod(cached_manifest_file, os.stat(cached_manifest_file).st_mode | stat.S_IWUSR) with open(cached_manifest_file, "w") as f: json.dump(cached_manifest, f, indent=2) -- 2.36.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] npm.bbclass: Don't create /usr/lib/node symlink 2022-05-13 15:30 ` [PATCH v2 1/3] npm.bbclass: Fix file permissions before opening it for writing Zoltan Boszormenyi @ 2022-05-13 15:30 ` Zoltan Boszormenyi 2022-05-13 15:30 ` [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink Zoltan Boszormenyi 1 sibling, 0 replies; 6+ messages in thread From: Zoltan Boszormenyi @ 2022-05-13 15:30 UTC (permalink / raw) To: openembedded-core Cc: Jean-Marie LEMETAYER, Zoltán Böszörményi From: Zoltán Böszörményi <zboszor@gmail.com> When a recipe DEPENDS on multiple other npm based recipes, the symlink will create a conflict. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --- meta/classes/npm.bbclass | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 86ee0f665a..dbfc2e728e 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -307,10 +307,6 @@ npm_do_install() { # Remove the shrinkwrap file which does not need to be packed rm -f ${D}/${nonarch_libdir}/node_modules/*/npm-shrinkwrap.json rm -f ${D}/${nonarch_libdir}/node_modules/@*/*/npm-shrinkwrap.json - - # node(1) is using /usr/lib/node as default include directory and npm(1) is - # using /usr/lib/node_modules as install directory. Let's make both happy. - ln -fs node_modules ${D}/${nonarch_libdir}/node } FILES:${PN} += " \ -- 2.36.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink 2022-05-13 15:30 ` [PATCH v2 1/3] npm.bbclass: Fix file permissions before opening it for writing Zoltan Boszormenyi 2022-05-13 15:30 ` [PATCH v2 2/3] npm.bbclass: Don't create /usr/lib/node symlink Zoltan Boszormenyi @ 2022-05-13 15:30 ` Zoltan Boszormenyi 2022-05-13 15:42 ` [OE-core] " Alexander Kanavin 1 sibling, 1 reply; 6+ messages in thread From: Zoltan Boszormenyi @ 2022-05-13 15:30 UTC (permalink / raw) To: openembedded-core Cc: Jean-Marie LEMETAYER, Zoltán Böszörményi From: Zoltán Böszörményi <zboszor@gmail.com> While /usr/lib/node_modules and all npm-related modules are shipped in the npm subpackage, keep the symlink in the main package because 3rd party modules that don't need npm are also installed into /usr/lib/node_modules. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --- meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb index 62188f94a..be68afd4c 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb @@ -159,6 +159,10 @@ do_compile () { do_install () { oe_runmake install DESTDIR=${D} + + # node(1) is using /usr/lib/node as default include directory and npm(1) is + # using /usr/lib/node_modules as install directory. Let's make both happy. + ln -fs node_modules ${D}/${nonarch_libdir}/node } BINARIES = " \ @@ -176,6 +180,7 @@ do_install:append:class-native() { } PACKAGES =+ "${PN}-npm" +FILES:${PN} += "${nonarch_libdir}/node" FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx" RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ python3-misc python3-multiprocessing" -- 2.36.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-core] [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink 2022-05-13 15:30 ` [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink Zoltan Boszormenyi @ 2022-05-13 15:42 ` Alexander Kanavin 2022-05-13 16:48 ` Zoltan Boszormenyi 0 siblings, 1 reply; 6+ messages in thread From: Alexander Kanavin @ 2022-05-13 15:42 UTC (permalink / raw) To: Böszörményi Zoltán Cc: OE-core, Jean-Marie LEMETAYER, Zoltán Böszörményi This needs to be sent to the openembedded-devel list. Alex On Fri, 13 May 2022 at 17:31, Zoltan Boszormenyi via lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote: > > From: Zoltán Böszörményi <zboszor@gmail.com> > > While /usr/lib/node_modules and all npm-related modules are > shipped in the npm subpackage, keep the symlink in the main > package because 3rd party modules that don't need npm are > also installed into /usr/lib/node_modules. > > Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> > --- > meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb > index 62188f94a..be68afd4c 100644 > --- a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb > +++ b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb > @@ -159,6 +159,10 @@ do_compile () { > > do_install () { > oe_runmake install DESTDIR=${D} > + > + # node(1) is using /usr/lib/node as default include directory and npm(1) is > + # using /usr/lib/node_modules as install directory. Let's make both happy. > + ln -fs node_modules ${D}/${nonarch_libdir}/node > } > > BINARIES = " \ > @@ -176,6 +180,7 @@ do_install:append:class-native() { > } > > PACKAGES =+ "${PN}-npm" > +FILES:${PN} += "${nonarch_libdir}/node" > FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx" > RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ > python3-misc python3-multiprocessing" > -- > 2.36.1 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#165573): https://lists.openembedded.org/g/openembedded-core/message/165573 > Mute This Topic: https://lists.openembedded.org/mt/91083341/1686489 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink 2022-05-13 15:42 ` [OE-core] " Alexander Kanavin @ 2022-05-13 16:48 ` Zoltan Boszormenyi 2022-05-13 17:50 ` Khem Raj 0 siblings, 1 reply; 6+ messages in thread From: Zoltan Boszormenyi @ 2022-05-13 16:48 UTC (permalink / raw) To: Alexander Kanavin Cc: OE-core, Jean-Marie LEMETAYER, Zoltán Böszörményi 2022. 05. 13. 17:42 keltezéssel, Alexander Kanavin írta: > This needs to be sent to the openembedded-devel list. Is it ok just to cc openembedded-devel? Because applying this 3rd patch to meta-oe without applying the second to oe-core will cause conflicts and has a high chance to be rejected. > > Alex > > On Fri, 13 May 2022 at 17:31, Zoltan Boszormenyi via > lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote: >> >> From: Zoltán Böszörményi <zboszor@gmail.com> >> >> While /usr/lib/node_modules and all npm-related modules are >> shipped in the npm subpackage, keep the symlink in the main >> package because 3rd party modules that don't need npm are >> also installed into /usr/lib/node_modules. >> >> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> >> --- >> meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb >> index 62188f94a..be68afd4c 100644 >> --- a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb >> +++ b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb >> @@ -159,6 +159,10 @@ do_compile () { >> >> do_install () { >> oe_runmake install DESTDIR=${D} >> + >> + # node(1) is using /usr/lib/node as default include directory and npm(1) is >> + # using /usr/lib/node_modules as install directory. Let's make both happy. >> + ln -fs node_modules ${D}/${nonarch_libdir}/node >> } >> >> BINARIES = " \ >> @@ -176,6 +180,7 @@ do_install:append:class-native() { >> } >> >> PACKAGES =+ "${PN}-npm" >> +FILES:${PN} += "${nonarch_libdir}/node" >> FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx" >> RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ >> python3-misc python3-multiprocessing" >> -- >> 2.36.1 >> >> >> >> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink 2022-05-13 16:48 ` Zoltan Boszormenyi @ 2022-05-13 17:50 ` Khem Raj 0 siblings, 0 replies; 6+ messages in thread From: Khem Raj @ 2022-05-13 17:50 UTC (permalink / raw) To: Böszörményi Zoltán Cc: Alexander Kanavin, OE-core, Jean-Marie LEMETAYER, Zoltán Böszörményi On Fri, May 13, 2022 at 9:49 AM Zoltan Boszormenyi via lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote: > > 2022. 05. 13. 17:42 keltezéssel, Alexander Kanavin írta: > > This needs to be sent to the openembedded-devel list. > > Is it ok just to cc openembedded-devel? Because applying > this 3rd patch to meta-oe without applying the second to > oe-core will cause conflicts and has a high chance to be > rejected. get the oe-core things done first. > > > > > Alex > > > > On Fri, 13 May 2022 at 17:31, Zoltan Boszormenyi via > > lists.openembedded.org <zboszor=pr.hu@lists.openembedded.org> wrote: > >> > >> From: Zoltán Böszörményi <zboszor@gmail.com> > >> > >> While /usr/lib/node_modules and all npm-related modules are > >> shipped in the npm subpackage, keep the symlink in the main > >> package because 3rd party modules that don't need npm are > >> also installed into /usr/lib/node_modules. > >> > >> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> > >> --- > >> meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >> diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb > >> index 62188f94a..be68afd4c 100644 > >> --- a/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb > >> +++ b/meta-oe/recipes-devtools/nodejs/nodejs_16.14.2.bb > >> @@ -159,6 +159,10 @@ do_compile () { > >> > >> do_install () { > >> oe_runmake install DESTDIR=${D} > >> + > >> + # node(1) is using /usr/lib/node as default include directory and npm(1) is > >> + # using /usr/lib/node_modules as install directory. Let's make both happy. > >> + ln -fs node_modules ${D}/${nonarch_libdir}/node > >> } > >> > >> BINARIES = " \ > >> @@ -176,6 +180,7 @@ do_install:append:class-native() { > >> } > >> > >> PACKAGES =+ "${PN}-npm" > >> +FILES:${PN} += "${nonarch_libdir}/node" > >> FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx" > >> RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ > >> python3-misc python3-multiprocessing" > >> -- > >> 2.36.1 > >> > >> > >> > >> > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#165580): https://lists.openembedded.org/g/openembedded-core/message/165580 > Mute This Topic: https://lists.openembedded.org/mt/91083341/1997914 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-05-13 17:50 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <16EEAE47FC3C363C.27599@lists.openembedded.org> 2022-05-13 15:30 ` [PATCH v2 1/3] npm.bbclass: Fix file permissions before opening it for writing Zoltan Boszormenyi 2022-05-13 15:30 ` [PATCH v2 2/3] npm.bbclass: Don't create /usr/lib/node symlink Zoltan Boszormenyi 2022-05-13 15:30 ` [meta-oe][PATCH v2 3/3] nodejs: Add /usr/lib/node -> node_modules symlink Zoltan Boszormenyi 2022-05-13 15:42 ` [OE-core] " Alexander Kanavin 2022-05-13 16:48 ` Zoltan Boszormenyi 2022-05-13 17:50 ` Khem Raj
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.