DEVELOPERS: add Thomas Petazzoni for nodejs
RFC PATCH 1/4 DEVELOPERS: add Thomas Petazzoni for nodejs
--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)
DEVELOPERS +1 -0
@@ -2902,6 +2902,7 @@ F: package/msmtp/ F: package/musl/ F: package/musl-fts/ F: package/ne10/ +F: package/nodejs/ F: package/pkg-python.mk F: package/pkg-autotools.mk F: package/pkg-generic.mk
Signature · 6 lines
2.37.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
RFC PATCH 2/4 package/nodejs-bin: new package
For now, it is not exposed in any way, but in the next commit, it will be offered as an alternative to build host-nodejs from source.
--- DEVELOPERS | 1 + package/nodejs-bin/nodejs-bin.hash | 7 ++++++ package/nodejs-bin/nodejs-bin.mk | 34 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 package/nodejs-bin/nodejs-bin.hash create mode 100644 package/nodejs-bin/nodejs-bin.mk
DEVELOPERS +1 -0
@@ -2903,6 +2903,7 @@ F: package/musl/ F: package/musl-fts/ F: package/ne10/ F: package/nodejs/ +F: package/nodejs-bin/ F: package/pkg-python.mk F: package/pkg-autotools.mk F: package/pkg-generic.mk
package/nodejs-bin/nodejs-bin.hash new file +7 -0
@@ -0,0 +1,7 @@ +# From https://nodejs.org/dist/v16.17.1/SHASUMS256.txt.asc +sha256 3dfb8fd8f6b97df69cdc56524abc906c50ef1d0bf091188616802e6c7c731389 node-v16.17.1-linux-arm64.tar.xz +sha256 a035ceefb5e16f5fce98c8ddfdf721b96eec20542c72fb8781bcbb6ef20c5550 node-v16.17.1-linux-armv7l.tar.xz +sha256 70305934661f89fca64053b85317a75f233d5e3fdb2caa6546a19262a519cf20 node-v16.17.1-linux-ppc64le.tar.xz +sha256 06ba2eb34aa385967f5f58c87a44753f83212f6cccea892b33f80a2e7fda8384 node-v16.17.1-linux-x64.tar.xz +# Locally calculated +sha256 69090e865afa7c62715b97f0712632d2923bd7a5faba91f94e4e75a2f9219d5e LICENSE
package/nodejs-bin/nodejs-bin.mk new file +34 -0
@@ -0,0 +1,34 @@ +################################################################################ +# +# nodejs-bin +# +################################################################################ + +# keep in sync with package/nodejs/nodejs.mk +NODEJS_BIN_VERSION = 16.17.1 +NODEJS_BIN_SITE = https://nodejs.org/dist/v$(NODEJS_BIN_VERSION) + +ifeq ($(HOSTARCH),aarch64) +NODEJS_BIN_ARCH = arm64 +else ifeq ($(HOSTARCH),arm) +# We assume that if someone does a build on ARM, it will be on an +# ARMv7 machine +NODEJS_BIN_ARCH = armv7l +else ifeq ($(HOSTARCH),ppc64le) +NODEJS_BIN_ARCH = ppc64le +else ifeq ($(HOSTARCH),x86_64) +NODEJS_BIN_ARCH = x64 +endif + +NODEJS_BIN_SOURCE = node-v$(NODEJS_BIN_VERSION)-linux-$(NODEJS_BIN_ARCH).tar.xz +NODEJS_BIN_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components) +NODEJS_BIN_LICENSE_FILES = LICENSE +NODEJS_BIN_CPE_ID_VENDOR = nodejs +NODEJS_BIN_CPE_ID_PRODUCT = node.js + +define HOST_NODEJS_BIN_INSTALL_CMDS + rsync -a --exclude=CHANGELOG.md --exclude=LICENSE --exclude=README.md \ + $(@D)/* $(HOST_DIR)/ +endef + +$(eval $(host-generic-package))
Signature · 6 lines
2.37.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH RFC 2/4] package/nodejs-bin: new package
Quoted 44 lines · Thomas Petazzoni
For now, it is not exposed in any way, but in the next commit, it will be offered as an alternative to build host-nodejs from source.
Signed-off-by Thomas Petazzoni <[email protected]>--- DEVELOPERS | 1 + package/nodejs-bin/nodejs-bin.hash | 7 ++++++ package/nodejs-bin/nodejs-bin.mk | 34 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 package/nodejs-bin/nodejs-bin.hash create mode 100644 package/nodejs-bin/nodejs-bin.mkDEVELOPERS +1
-0@@ -2903,6 +2903,7 @@ F: package/musl/ F: package/musl-fts/ F: package/ne10/ F: package/nodejs/ +F: package/nodejs-bin/ F: package/pkg-python.mk F: package/pkg-autotools.mk F: package/pkg-generic.mkpackage/nodejs-bin/nodejs-bin.hash new file +7
-0@@ -0,0 +1,7 @@ +# From https://nodejs.org/dist/v16.17.1/SHASUMS256.txt.asc +sha256 3dfb8fd8f6b97df69cdc56524abc906c50ef1d0bf091188616802e6c7c731389 node-v16.17.1-linux-arm64.tar.xz +sha256 a035ceefb5e16f5fce98c8ddfdf721b96eec20542c72fb8781bcbb6ef20c5550 node-v16.17.1-linux-armv7l.tar.xz +sha256 70305934661f89fca64053b85317a75f233d5e3fdb2caa6546a19262a519cf20 node-v16.17.1-linux-ppc64le.tar.xz +sha256 06ba2eb34aa385967f5f58c87a44753f83212f6cccea892b33f80a2e7fda8384 node-v16.17.1-linux-x64.tar.xz +# Locally calculated +sha256 69090e865afa7c62715b97f0712632d2923bd7a5faba91f94e4e75a2f9219d5e LICENSEpackage/nodejs-bin/nodejs-bin.mk new file +0
-0
package/nodejs-bin/nodejs-bin.mk line 8
Quoted 8 lines
package/nodejs-bin/nodejs-bin.mk new file +8
-0@@ -0,0 +1,34 @@ +################################################################################ +# +# nodejs-bin +# +################################################################################ + +# keep in sync with package/nodejs/nodejs.mk +NODEJS_BIN_VERSION = 16.17.1
Silly question(s) from me.
This may go against some BR guidelines.
But, what if you were to add a 'package/nodejs/version' file and include it here like include ../package/nodejs/version ?
Another idea would be to maybe add a new folder sub-level like 'package/nodejs/nodejs/<the current one>' & 'package/nodejs/nodejs-bin/<this new one>' and have a 'package/nodejs/nodejs.mk' which includes the mk files from the sub-dirs.
But ¯\_(ツ)_/¯
Still don't know if it goes against BR guidelines.
Quoted 27 lines
package/nodejs-bin/nodejs-bin.mk new file +26
-1+NODEJS_BIN_SITE = https://nodejs.org/dist/v$(NODEJS_BIN_VERSION) + +ifeq ($(HOSTARCH),aarch64) +NODEJS_BIN_ARCH = arm64 +else ifeq ($(HOSTARCH),arm) +# We assume that if someone does a build on ARM, it will be on an +# ARMv7 machine +NODEJS_BIN_ARCH = armv7l +else ifeq ($(HOSTARCH),ppc64le) +NODEJS_BIN_ARCH = ppc64le +else ifeq ($(HOSTARCH),x86_64) +NODEJS_BIN_ARCH = x64 +endif + +NODEJS_BIN_SOURCE = node-v$(NODEJS_BIN_VERSION)-linux-$(NODEJS_BIN_ARCH).tar.xz +NODEJS_BIN_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components) +NODEJS_BIN_LICENSE_FILES = LICENSE +NODEJS_BIN_CPE_ID_VENDOR = nodejs +NODEJS_BIN_CPE_ID_PRODUCT = node.js + +define HOST_NODEJS_BIN_INSTALL_CMDS + rsync -a --exclude=CHANGELOG.md --exclude=LICENSE --exclude=README.md \ + $(@D)/* $(HOST_DIR)/ +endef + +$(eval $(host-generic-package)) --
Quoted 2 lines
2.37.3
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH RFC 2/4] package/nodejs-bin: new package
Quoted 5 lines · On Mon, 26 Sep 2022 10:56:10 +0300 Alexandru Ardelean <[email protected]>…
Silly question(s) from me.
This may go against some BR guidelines.But, what if you were to add a 'package/nodejs/version' file and include it here like
include ../package/nodejs/version?
We've not been doing this like this for now.
Quoted 5 lines
Another idea would be to maybe add a new folder sub-level like 'package/nodejs/nodejs/<the current one>' & 'package/nodejs/nodejs-bin/<this new one>' and have a '
package/nodejs/nodejs.mk' which includes the mk files from the sub-dirs.
See the commit log for PATCH 3/4, which says:
"""
One possible alternate organization is to have package/nodejs/ contain all three packages: package/nodejs/nodejs/, package/nodejs/nodejs-src, package/nodejs/nodejs-bin, which would allow to more easily share a few common variables (version, license, license files, CPE ID, etc.). """
:-)
BTW, did you confirm that with the latest master you can now build NodeJS correctly for your scenario?
Best regards,
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH RFC 2/4] package/nodejs-bin: new package
Quoted 12 lines · Thomas Petazzoni
Quoted 5 lines · On Mon, 26 Sep 2022 10:56:10 +0300 Alexandru Ardelean <[email protected]>…
Silly question(s) from me.
This may go against some BR guidelines.But, what if you were to add a 'package/nodejs/version' file and include it here like
include ../package/nodejs/version?We've not been doing this like this for now.
Quoted 7 lines
Quoted 5 lines
Another idea would be to maybe add a new folder sub-level like 'package/nodejs/nodejs/<the current one>' & 'package/nodejs/nodejs-bin/<this new one>' and have a '
package/nodejs/nodejs.mk' which includes the mk files from the sub-dirs.See the commit log for PATCH 3/4, which says:
Ah, apologies.
I missed that.
Quoted 8 lines
"""
One possible alternate organization is to have package/nodejs/ contain all three packages: package/nodejs/nodejs/, package/nodejs/nodejs-src, package/nodejs/nodejs-bin, which would allow to more easily share a few common variables (version, license, license files, CPE ID, etc.). """
Quoted 4 lines
:-)
BTW, did you confirm that with the latest master you can now build NodeJS correctly for your scenario?
The message is in my draft folder to be sent.
I confirm nodejs for ARM64 with external toolchain.
Running nodejs ARM with external toolchain now.
I wanted to send that message after ARM finishes.
Will send it when ARM finishes.
Thanks
Alexandru
Quoted 8 lines
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
RFC PATCH 3/4 package/nodejs: make host package a virtual package
In reply to Thomas Petazzoni via buildroothost-nodejs is quite long to build (5 minutes on a very fast build machine), and will become a download dependency when we implement vendoring for NodeJS-based packages.
In order to mitigate this build time, an idea is to use a pre-compiled host NodeJS. One option would be to use a pre-installed NodeJS, but we're concerned by version compatibility issues of the host NodeJS/NPM does not have the same version as the target NodeJS/NPM. So another option is to use a pre-compiled NodeJS provided by the NodeJS project itself.
To achieve this, this commit turns the host-nodejs package into a virtual package, which has two providers:
- host-nodejs-src, which builds host-nodejs from source. Therefore the logic that used to be in package/nodejs/nodejs.mk to build host-nodejs from source is moved to package/nodejs-src/nodejs-src.mk. It should be noted that the patches in package/nodejs are not applied to package/nodejs-src as all patches are related to solving target-only issues. However, we could certainly think of applying the same patches if need be.
- host-nodejs-bin, which was introduced in the previous commit, and which simply installs a pre-compiled NodeJS.
One possible alternate organization is to have package/nodejs/ contain all three packages: package/nodejs/nodejs/, package/nodejs/nodejs-src, package/nodejs/nodejs-bin, which would allow to more easily share a few common variables (version, license, license files, CPE ID, etc.).
---
DEVELOPERS | 1 +
package/nodejs-bin/nodejs-bin.mk | 4 +-
package/{nodejs => nodejs-src}/Config.in.host | 4 +-
package/nodejs-src/nodejs-src.hash | 1 +
package/nodejs-src/nodejs-src.mk | 72 +++++++++++++++++++
package/nodejs/Config.in.host | 39 ++++++++--
package/nodejs/nodejs.mk | 57 +--------------
7 files changed, 115 insertions(+), 63 deletions(-)
copy package/{nodejs => nodejs-src}/Config.in.host (78%)
create mode 120000 package/nodejs-src/nodejs-src.hash
create mode 100644 package/nodejs-src/nodejs-src.mkDEVELOPERS +1 -0
@@ -2904,6 +2904,7 @@ F: package/musl-fts/ F: package/ne10/ F: package/nodejs/ F: package/nodejs-bin/ +F: package/nodejs-src/ F: package/pkg-python.mk F: package/pkg-autotools.mk F: package/pkg-generic.mk
package/nodejs-bin/nodejs-bin.mk +3 -1
@@ -4,7 +4,7 @@ # ################################################################################ -# keep in sync with package/nodejs/nodejs.mk +# keep in sync with package/nodejs and package/nodejs-src NODEJS_BIN_VERSION = 16.17.1 NODEJS_BIN_SITE = https://nodejs.org/dist/v$(NODEJS_BIN_VERSION)
@@ -26,6 +26,8 @@ NODEJS_BIN_LICENSE_FILES = LICENSE NODEJS_BIN_CPE_ID_VENDOR = nodejs NODEJS_BIN_CPE_ID_PRODUCT = node.js +HOST_NODEJS_BIN_PROVIDES = host-nodejs + define HOST_NODEJS_BIN_INSTALL_CMDS rsync -a --exclude=CHANGELOG.md --exclude=LICENSE --exclude=README.md \ $(@D)/* $(HOST_DIR)/
package/nodejs-src/Config.in.host renamed from package/nodejs/Config.in.host +2 -2
@@ -1,4 +1,4 @@ -config BR2_PACKAGE_HOST_NODEJS +config BR2_PACKAGE_HOST_NODEJS_SRC bool "host nodejs" depends on BR2_HOST_GCC_AT_LEAST_8 select BR2_PACKAGE_HOST_PYTHON3
@@ -10,5 +10,5 @@ config BR2_PACKAGE_HOST_NODEJS http://nodejs.org/ -comment "host nodejs needs a host gcc >= 8" +comment "host nodejs-src needs a host gcc >= 8" depends on !BR2_HOST_GCC_AT_LEAST_8
package/nodejs-src/nodejs-src.hash new file +1 -0
@@ -0,0 +1 @@ +../nodejs/nodejs.hash
package/nodejs-src/nodejs-src.mk new file +72 -0
72 lines not on this page · raw message
package/nodejs/Config.in.host +34 -5
@@ -1,14 +1,43 @@ +config BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS + bool + default y if BR2_HOSTARCH = "aarch64" + default y if BR2_HOSTARCH = "arm" + default y if BR2_HOSTARCH = "ppc64le" + default y if BR2_HOSTARCH = "x86_64" + config BR2_PACKAGE_HOST_NODEJS bool "host nodejs" - depends on BR2_HOST_GCC_AT_LEAST_8 - select BR2_PACKAGE_HOST_PYTHON3 - select BR2_PACKAGE_HOST_PYTHON3_BZIP2 - select BR2_PACKAGE_HOST_PYTHON3_SSL + depends on BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS || \ + BR2_HOST_GCC_AT_LEAST_8 help Event-driven I/O server-side JavaScript environment based on V8. http://nodejs.org/ -comment "host nodejs needs a host gcc >= 8" +if BR2_PACKAGE_HOST_NODEJS + +choice + +config BR2_PACKAGE_HOST_NODEJS_BIN + bool "pre-built version" + depends on BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS + +config BR2_PACKAGE_HOST_NODEJS_SRC + bool "compile from source" + depends on BR2_HOST_GCC_AT_LEAST_8 + select BR2_PACKAGE_HOST_PYTHON3 + select BR2_PACKAGE_HOST_PYTHON3_BZIP2 + select BR2_PACKAGE_HOST_PYTHON3_SSL + +comment "host nodejs from source needs a host gcc >= 8" depends on !BR2_HOST_GCC_AT_LEAST_8 + +endchoice + +endif + +config BR2_PACKAGE_PROVIDES_HOST_NODEJS + string + default "host-nodejs-bin" if BR2_PACKAGE_HOST_NODEJS_BIN + default "host-nodejs-src" if BR2_PACKAGE_HOST_NODEJS_SRC
package/nodejs/nodejs.mk +2 -55
96 lines not on this page · raw message
Signature · 6 lines
2.37.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH RFC 3/4] package/nodejs: make host package a virtual package
package/nodejs-src/Config.in.host
Quoted 7 lines · On Sun, 25 Sep 2022 22:40:28 +0200 Thomas Petazzoni…
package/nodejs-src/Config.in.host renamed from package/nodejs/Config.in.host +0
-0
Dammit, I was supposed to remove this file. I will fix this in v2. package/nodejs-src/Config.in.host should not exist.
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
RFC PATCH 4/4 support/testing/tests/package/test_nodejs: test both host-nodejs-bin and host-nodejs-src
In reply to Thomas Petazzoni via buildrootThe TestNodeJSModule test triggers the build of host-nodejs to be able to install third party modules. Now that host-nodejs has two providers, it makes sense to test both cases, so we duplicate TestNodeJSModule into TestNodeJsModuleHostBin (which tests the host-nodejs-bin) and TestNodeJSModuleHostSrc (which tests the host-nodejs-src).
--- support/testing/tests/package/test_nodejs.py | 29 +++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
support/testing/tests/package/test_nodejs.py +28 -1
@@ -27,7 +27,7 @@ class TestNodeJSBasic(infra.basetest.BRTest): self.assertRunOk("node sample_nodejs_basic.js") -class TestNodeJSModule(infra.basetest.BRTest): +class TestNodeJSModuleHostBin(infra.basetest.BRTest): config = \ """ BR2_arm=y
@@ -36,6 +36,33 @@ class TestNodeJSModule(infra.basetest.BRTest): BR2_TOOLCHAIN_EXTERNAL=y BR2_PACKAGE_NODEJS=y BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL="lodash" + BR2_PACKAGE_HOST_NODEJS_BIN=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + BR2_ROOTFS_POST_BUILD_SCRIPT="{}" + BR2_ROOTFS_POST_SCRIPT_ARGS="{}" + """.format(infra.filepath("tests/package/copy-sample-script-to-target.sh"), + infra.filepath("tests/package/sample_nodejs_module.js")) + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + self.assertRunOk("node sample_nodejs_module.js") + + +class TestNodeJSModuleHostSrc(infra.basetest.BRTest): + config = \ + """ + BR2_arm=y + BR2_cortex_a9=y + BR2_ARM_ENABLE_VFP=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_PACKAGE_NODEJS=y + BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL="lodash" + BR2_PACKAGE_HOST_NODEJS_SRC=y BR2_TARGET_ROOTFS_CPIO=y # BR2_TARGET_ROOTFS_TAR is not set BR2_ROOTFS_POST_BUILD_SCRIPT="{}"
Signature · 6 lines
2.37.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 1 line · Thomas Petazzoni
Better nodejs support will make it interesting to bridge upper-level JS devs with embedded for projects like smart-TVs.
So, thank you for the support on this :)
I'm still curious how a smart-TV would end-up looking like (with BR at the base + nodejs + webkit + cog).
It satisfies the embedded needs relatively well.
Thanks
Alexandru
Quoted 18 lines
Signed-off-by Thomas Petazzoni <[email protected]>--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)DEVELOPERS +1
-1@@ -2902,6 +2902,7 @@ F: package/msmtp/ F: package/musl/ F: package/musl-fts/ F: package/ne10/ +F: package/nodejs/ F: package/pkg-python.mk F: package/pkg-autotools.mk F: package/pkg-generic.mk --
Quoted 2 lines
2.37.3
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 1 line · Thomas Petazzoni via buildroot
Signed-off-by Thomas Petazzoni <[email protected]>
Series applied to master, after reworking similar to the just-posted go-bin
series [1].
Regards,
Arnout
[1] https://patchwork.ozlabs.org/project/buildroot/list/?series=375729
Quoted 9 lines
--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)DEVELOPERS +0
-0
DEVELOPERS F: package/msmtp/ · line 2908
Quoted 7 lines
DEVELOPERS +1
-0@@ -2902,6 +2902,7 @@ F: package/msmtp/ F: package/musl/ F: package/musl-fts/ F: package/ne10/ +F: package/nodejs/ F: package/pkg-python.mk F: package/pkg-autotools.mk F: package/pkg-generic.mk
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot