Skip to contentSkip to conversation

Update nodejs to 10.x LTS branch

PATCH New Martin Bark 2 participants 7 messages Mar 14, 2019 – Mar 15, 2019

lore
Share & tools
lore
#0 lore raw

cover Update nodejs to 10.x LTS branch

Hi,

Now that buildroot supports openssl 1.1 we can update nodejs to the 10.x LTS branch. The 10.x branch is the current active LTS branch and will be supported until April 2021. The 8.x branch buildroot currently uses is now in maintenance only and this will stop at the end of 2019.

Nodejs 10.x needs to compile a host tool called torque when building V8. Currently the nodejs build system fails to compile this correctly for the host so i have included a work around in the patch. Hopefully in the future this will get fixed. See [1] for some info.

I have also update nodejs to use nghttp2 to remove one more static dependency.

Thanks

Martin

[1] https://github.com/nodejs/node/issues/23420

Martin Bark (3):
package/nodejs: bump version to 10.15.3
package/nghttp2: bump version to 1.37.0
package/nodejs: use shared nghttp2 library

 package/nghttp2/nghttp2.hash |  2 +-
 package/nghttp2/nghttp2.mk   |  2 +-
 package/nodejs/Config.in     |  1 +
 package/nodejs/nodejs.hash   |  4 ++--
 package/nodejs/nodejs.mk     | 15 ++++++++++++---
 5 files changed, 17 insertions(+), 7 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/3 package/nodejs: bump version to 10.15.3

See https://nodejs.org/en/blog/release/v10.15.3/

---
 package/nodejs/nodejs.hash |  4 ++--
 package/nodejs/nodejs.mk   | 12 ++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)
package/nodejs/nodejs.hash +2 -2
index 5a06e5328c..e9c174e662 100644
@@ -1,5 +1,5 @@
-# From https://nodejs.org/dist/v8.15.0/SHASUMS256.txt
-sha256 968523333947cc3f769d73dedc6c9c60580826d8714bc0e62ca4589de6a7c633  node-v8.15.0.tar.xz
+# From https://nodejs.org/dist/v10.15.3/SHASUMS256.txt
+sha256 4e22d926f054150002055474e452ed6cbb85860aa7dc5422213a2002ed9791d5  node-v10.15.3.tar.xz
 
 # Hash for license file
 sha256 b87be6c1479ed977481115869c2dd8b6d59e5ea55aa09939d6c898242121b2f5  LICENSE
package/nodejs/nodejs.mk +10 -2
index 446cb77dbf..833b1989e6 100644
@@ -4,13 +4,13 @@
 #
 ################################################################################
 
-NODEJS_VERSION = 8.15.0
+NODEJS_VERSION = 10.15.3
 NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
 NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
 NODEJS_DEPENDENCIES = host-python host-nodejs c-ares \
 	libhttpparser libuv zlib \
 	$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
-HOST_NODEJS_DEPENDENCIES = host-libopenssl host-python host-zlib
+HOST_NODEJS_DEPENDENCIES = host-libopenssl host-python host-zlib host-patchelf
 NODEJS_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components)
 NODEJS_LICENSE_FILES = LICENSE
 
@@ -73,6 +73,8 @@ define HOST_NODEJS_BUILD_CMDS
 		$(HOST_CONFIGURE_OPTS) \
 		NO_LOAD=cctest.target.mk \
 		PATH=$(@D)/bin:$(BR_PATH)
+
+	$(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib $(@D)/out/Release/torque
 endef
 
 define HOST_NODEJS_INSTALL_CMDS
@@ -81,6 +83,8 @@ define HOST_NODEJS_INSTALL_CMDS
 		$(HOST_CONFIGURE_OPTS) \
 		NO_LOAD=cctest.target.mk \
 		PATH=$(@D)/bin:$(BR_PATH)
+
+	$(INSTALL) -m755 -D $(@D)/out/Release/torque $(HOST_DIR)/usr/bin/torque
 endef
 
 ifeq ($(BR2_i386),y)
@@ -128,6 +132,10 @@ define NODEJS_CONFIGURE_CMDS
 		$(if $(NODEJS_MIPS_FPU_MODE),--with-mips-fpu-mode=$(NODEJS_MIPS_FPU_MODE)) \
 		$(NODEJS_CONF_OPTS) \
 	)
+
+	# use host version of torque
+	sed "s#<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)#$(HOST_DIR)/usr/bin/torque#" \
+		-i $(@D)/deps/v8/gypfiles/v8.gyp
 endef
 
 define NODEJS_BUILD_CMDS
Signature · 1 line
2.21.0
#2 lore raw

PATCH 1/3 package/nodejs: bump version to 10.15.3

Hello Martin,

Quoted 3 lines · On Thu, 14 Mar 2019 13:38:11 +0000 Martin Bark <[email protected]> wrote:

See https://nodejs.org/en/blog/release/v10.15.3/

This commit log was really too terse, so I have extended it with some explanation about the torque issue (hopefully I got it right).

Generally speaking, you have put too much information in the cover letter, and too little in the commit log. The opposite is preferred, because the commit logs stay forever in the Git history, and are much more easily associated to a given change in a package, compared to a cover letter than becomes buried deep down in the mailing list archives.

package/nodejs/nodejs.mk define HOST_NODEJS_INSTALL_CMDS · line 87

Quoted 1 line
package/nodejs/nodejs.mk +1 -0
+	$(INSTALL) -m755 -D $(@D)/out/Release/torque $(HOST_DIR)/usr/bin/torque

I changed to install to $(HOST_DIR)/bin/torque. We no longer have $(HOST_DIR)/usr, it's a symlink to $(HOST_DIR).

package/nodejs/nodejs.mk define NODEJS_CONFIGURE_CMDS · line 137

Quoted 2 lines
package/nodejs/nodejs.mk +2 -0
+	# use host version of torque
+	sed "s#<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)#$(HOST_DIR)/usr/bin/torque#" \

And I changed it here as well.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/3 package/nghttp2: bump version to 1.37.0

In reply to Martin Bark
---
 package/nghttp2/nghttp2.hash | 2 +-
 package/nghttp2/nghttp2.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/nghttp2/nghttp2.hash +1 -1
index d000fd56c5..a56f56f222 100644
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 f75e8f228217f23aa5eabfbab140e061cda00b7c21e34c891ecfb248d663303f  nghttp2-1.32.0.tar.gz
+sha256 760981ab5703d3ed185eccb322321d379453974357a3263971a928c2879a43bf  nghttp2-1.37.0.tar.gz
 sha256 6b94f3abc1aabd0c72a7c7d92a77f79dda7c8a0cb3df839a97890b4116a2de2a  COPYING
package/nghttp2/nghttp2.mk +1 -1
index 20bfee75a3..7ce28b41fc 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-NGHTTP2_VERSION = 1.32.0
+NGHTTP2_VERSION = 1.37.0
 NGHTTP2_SITE = https://github.com/nghttp2/nghttp2/releases/download/v$(NGHTTP2_VERSION)
 NGHTTP2_LICENSE = MIT
 NGHTTP2_LICENSE_FILES = COPYING
Signature · 1 line
2.21.0
#4 lore raw

PATCH 2/3 package/nghttp2: bump version to 1.37.0

Quoted 5 lines · On Thu, 14 Mar 2019 13:38:12 +0000 Martin Bark <[email protected]> wrote:
---
 package/nghttp2/nghttp2.hash | 2 +-
 package/nghttp2/nghttp2.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 3/3 package/nodejs: use shared nghttp2 library

In reply to Martin Bark
---
 package/nodejs/Config.in | 1 +
 package/nodejs/nodejs.mk | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
package/nodejs/Config.in +1 -0
index d2846f8d57..e995441304 100644
@@ -30,6 +30,7 @@ config BR2_PACKAGE_NODEJS
 	select BR2_PACKAGE_LIBHTTPPARSER
 	select BR2_PACKAGE_LIBUV
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_NGHTTP2
 	help
 	  Event-driven I/O server-side JavaScript environment based on
 	  V8.
package/nodejs/nodejs.mk +2 -1
index 833b1989e6..42b92d66a2 100644
@@ -8,7 +8,7 @@ NODEJS_VERSION = 10.15.3
 NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
 NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
 NODEJS_DEPENDENCIES = host-python host-nodejs c-ares \
-	libhttpparser libuv zlib \
+	libhttpparser libuv zlib nghttp2 \
 	$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
 HOST_NODEJS_DEPENDENCIES = host-libopenssl host-python host-zlib host-patchelf
 NODEJS_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components)
@@ -20,6 +20,7 @@ NODEJS_CONF_OPTS = \
 	--shared-cares \
 	--shared-http-parser \
 	--shared-libuv \
+	--shared-nghttp2 \
 	--without-dtrace \
 	--without-etw \
 	--dest-os=linux
Signature · 1 line
2.21.0
#6 lore raw

PATCH 3/3 package/nodejs: use shared nghttp2 library

Quoted 5 lines · On Thu, 14 Mar 2019 13:38:13 +0000 Martin Bark <[email protected]> wrote:
---
 package/nodejs/Config.in | 1 +
 package/nodejs/nodejs.mk | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com