Friday, February 02, 2018

[update] lang/node 6.12.3 -> 8.9.4

Hola!

Here is a fairly big jump for the node port that brings us to the current
LTS.

I would like to get as much testing on this one as possible before
getting it in.

"make test" should result in 100% success:
[----------] Global test environment tear-down
[==========] 62 tests from 7 test cases ran. (200 ms total)
[ PASSED ] 62 tests.
/usr/local/bin/python2.7 tools/test.py --mode=release -J \
async-hooks \
default \
addons addons-napi \
doctool \
known_issues
[04:53|% 100|+ 2047|- 0]: Done
qbit@slip[0]:nodeλ

I also plan on adding a port for 9.x, but I haven't worked out the
details on that yet.

https://deftly.net/patches/node-v8.9.4.diff

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/node/Makefile,v
retrieving revision 1.67
diff -u -p -r1.67 Makefile
--- Makefile 9 Jan 2018 02:11:11 -0000 1.67
+++ Makefile 2 Feb 2018 03:11:17 -0000
@@ -10,14 +10,13 @@ USE_WXNEEDED = Yes

COMMENT = V8 JavaScript for clients and servers

-NODE_VERSION = v6.12.3
+NODE_VERSION = v8.9.4

PLEDGE_VER = 1.1.0
DISTFILES = node-pledge-{}${PLEDGE_VER}.tar.gz:0 ${DISTNAME}.tar.gz

DISTNAME = node-${NODE_VERSION}
PKGNAME = ${DISTNAME:S/v//g}
-REVISION = 0

MASTER_SITES0 = https://github.com/qbit/node-pledge/archive/

@@ -71,6 +70,13 @@ do-extract:
mv ${WRKSRC}/deps/npm/node_modules/node-pledge-${PLEDGE_VER} \
${WRKSRC}/deps/npm/node_modules/node-pledge

+post-extract:
+ # Currently tarbals exclude tools/eslint, while the tests that require it
+ # are still in tree
+ cd ${WRKSRC} && for x in $$(grep -r "tools/eslint" test/* | awk -F: '{print $$1}' | sort | uniq); do \
+ rm $$x; \
+ done
+
pre-configure:
@# Bad practice, but prevents a whole stack of patches.
ln -sf ${LOCALBASE}/bin/python${MODPY_VERSION} ${WRKDIR}/bin/python
@@ -94,5 +100,12 @@ post-install:
mv $$x ../..; \
ln -s ../../$$x $$x; \
done
+
+do-test:
+ cd ${WRKSRC} && \
+ ulimit -n $$(ulimit -Hn) && \
+ ulimit -d $$(ulimit -Hd) && \
+ gmake test
+

.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/node/distinfo,v
retrieving revision 1.44
diff -u -p -r1.44 distinfo
--- distinfo 9 Jan 2018 02:11:11 -0000 1.44
+++ distinfo 2 Feb 2018 03:11:17 -0000
@@ -1,4 +1,4 @@
SHA256 (node-pledge-1.1.0.tar.gz) = BuKnrXSkqpTb5Tfap1AHk+l7ucTJLEWbMFNbgQkNBsw=
-SHA256 (node-v6.12.3.tar.gz) = CIeI0ciHMJ+GUHMJCNv28JFAB3qKr1ggIa9L7ypta4Q=
+SHA256 (node-v8.9.4.tar.gz) = cptEsysvguzVvvrE91GN4MTjrdNOj+h490V0CmbLvAE=
SIZE (node-pledge-1.1.0.tar.gz) = 2560
-SIZE (node-v6.12.3.tar.gz) = 27417906
+SIZE (node-v8.9.4.tar.gz) = 31274938
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 patch-Makefile
--- patches/patch-Makefile 10 Oct 2017 13:32:07 -0000 1.4
+++ patches/patch-Makefile 2 Feb 2018 03:11:17 -0000
@@ -2,27 +2,27 @@ $OpenBSD: patch-Makefile,v 1.4 2017/10/1
Index: Makefile
--- Makefile.orig
+++ Makefile
-@@ -83,7 +83,7 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_par
+@@ -100,7 +100,7 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_par
config.gypi: configure
$(error Missing or stale $@, please run ./$<)

--install: all
-+install: all build-pledge
+-install: all ## Installs node into $PREFIX (default=/usr/local).
++install: all build-pledge ## Installs node into $PREFIX (default=/usr/local).
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'

- uninstall:
-@@ -123,7 +123,6 @@ test: all
- $(MAKE) cctest
+ uninstall: ## Uninstalls node from $PREFIX (default=/usr/local).
+@@ -247,7 +247,6 @@ test-cov: all
$(PYTHON) tools/test.py --mode=release -J \
- doctool inspector known_issues message pseudo-tty parallel sequential addons
+ $(CI_JS_SUITES) \
+ $(CI_NATIVE_SUITES)
- $(MAKE) lint

test-parallel: all
$(PYTHON) tools/test.py --mode=release parallel -J
-@@ -185,6 +184,12 @@ test/addons/.buildstamp: config.gypi \
+@@ -326,6 +325,12 @@ test/addons/.buildstamp: config.gypi \
# Just goes to show that recursive make really is harmful...
# TODO(bnoordhuis) Force rebuild after gyp update.
- build-addons: $(NODE_EXE) test/addons/.buildstamp
+ build-addons: | $(NODE_EXE) test/addons/.buildstamp
+
+build-pledge: $(NODE_EXE)
+ $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
@@ -30,5 +30,5 @@ Index: Makefile
+ --nodedir="$(shell pwd)" && \
+ $(RM) -rf deps/npm/node_modules/node-pledge/build/Release/{.deps,../Makefile,obj.target}

- clear-stalled:
- # Clean up any leftover processes but don't error if found.
+ ADDONS_NAPI_BINDING_GYPS := \
+ $(filter-out test/addons-napi/??_*/binding.gyp, \
Index: patches/patch-common_gypi
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-common_gypi,v
retrieving revision 1.8
diff -u -p -r1.8 patch-common_gypi
--- patches/patch-common_gypi 6 Aug 2017 15:01:45 -0000 1.8
+++ patches/patch-common_gypi 2 Feb 2018 03:11:17 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-common_gypi,v 1.8 2017/0
Index: common.gypi
--- common.gypi.orig
+++ common.gypi
-@@ -409,6 +409,10 @@
+@@ -425,6 +425,10 @@
'ldflags': [
'-Wl,--export-dynamic',
],
Index: patches/patch-deps_npm_lib_build_js
===================================================================
RCS file: patches/patch-deps_npm_lib_build_js
diff -N patches/patch-deps_npm_lib_build_js
--- patches/patch-deps_npm_lib_build_js 23 Jan 2017 16:47:04 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,37 +0,0 @@
-$OpenBSD: patch-deps_npm_lib_build_js,v 1.3 2017/01/23 16:47:04 abieber Exp $
---- deps/npm/lib/build.js.orig Thu Nov 3 08:07:29 2016
-+++ deps/npm/lib/build.js Thu Nov 3 08:11:47 2016
-@@ -203,17 +203,23 @@ function linkBins (pkg, folder, parent, gtop, cb) {
- // bins should always be executable.
- // XXX skip chmod on windows?
- var src = path.resolve(folder, pkg.bin[b])
-- fs.chmod(src, npm.modes.exec, function (er) {
-- if (er && er.code === 'ENOENT' && npm.config.get('ignore-scripts')) {
-- return cb()
-+ fs.lstat(folder, function (er,stat) {
-+ if (!stat.isSymbolicLink) {
-+ fs.chmod(src, npm.modes.exec, function (er) {
-+ if (er && er.code === "ENOENT" && npm.config.get("ignore-scripts")) {
-+ return cb()
-+ }
-+ if (er || !gtop) return cb(er)
-+ var dest = path.resolve(binRoot, b)
-+ , out = npm.config.get("parseable")
-+ ? dest + "::" + src + ":BINFILE"
-+ : dest + " -> " + src
-+ console.log(out)
-+ cb()
-+ })
-+ } else {
-+ cb()
- }
-- if (er || !gtop) return cb(er)
-- var dest = path.resolve(binRoot, b)
-- var out = npm.config.get('parseable')
-- ? dest + '::' + src + ':BINFILE'
-- : dest + ' -> ' + src
-- output(out)
-- cb()
- })
- }
- )
Index: patches/patch-deps_npm_lib_npm_js
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-deps_npm_lib_npm_js,v
retrieving revision 1.4
diff -u -p -r1.4 patch-deps_npm_lib_npm_js
--- patches/patch-deps_npm_lib_npm_js 23 Jan 2017 16:47:04 -0000 1.4
+++ patches/patch-deps_npm_lib_npm_js 2 Feb 2018 03:11:17 -0000
@@ -1,9 +1,10 @@
$OpenBSD: patch-deps_npm_lib_npm_js,v 1.4 2017/01/23 16:47:04 abieber Exp $
---- deps/npm/lib/npm.js.orig Mon Dec 12 11:29:06 2016
-+++ deps/npm/lib/npm.js Mon Dec 12 11:29:39 2016
-@@ -288,7 +288,7 @@
- // go ahead and spin up the registry client.
- npm.registry = new CachingRegClient(npm.config)
+Index: deps/npm/lib/npm.js
+--- deps/npm/lib/npm.js.orig
++++ deps/npm/lib/npm.js
+@@ -332,7 +332,7 @@
+
+ log.resume()

- var umask = npm.config.get('umask')
+ var umask = npm.config.get('umask') || 0022
Index: patches/patch-deps_npm_node_modules_node-gyp_lib_build_js
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-deps_npm_node_modules_node-gyp_lib_build_js,v
retrieving revision 1.5
diff -u -p -r1.5 patch-deps_npm_node_modules_node-gyp_lib_build_js
--- patches/patch-deps_npm_node_modules_node-gyp_lib_build_js 27 Jun 2017 12:04:08 -0000 1.5
+++ patches/patch-deps_npm_node_modules_node-gyp_lib_build_js 2 Feb 2018 03:11:17 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-deps_npm_node_modules_no
Index: deps/npm/node_modules/node-gyp/lib/build.js
--- deps/npm/node_modules/node-gyp/lib/build.js.orig
+++ deps/npm/node_modules/node-gyp/lib/build.js
-@@ -238,6 +238,8 @@ function build (gyp, argv, callback) {
+@@ -220,6 +220,8 @@ function build (gyp, argv, callback) {
}
} else {
argv.push('BUILDTYPE=' + buildType)
Index: patches/patch-deps_npm_node_modules_node-gyp_lib_configure_js
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-deps_npm_node_modules_node-gyp_lib_configure_js,v
retrieving revision 1.5
diff -u -p -r1.5 patch-deps_npm_node_modules_node-gyp_lib_configure_js
--- patches/patch-deps_npm_node_modules_node-gyp_lib_configure_js 27 Jun 2017 12:04:08 -0000 1.5
+++ patches/patch-deps_npm_node_modules_node-gyp_lib_configure_js 2 Feb 2018 03:11:17 -0000
@@ -5,7 +5,7 @@ Make sure node-gyp is able to find a pyt
Index: deps/npm/node_modules/node-gyp/lib/configure.js
--- deps/npm/node_modules/node-gyp/lib/configure.js.orig
+++ deps/npm/node_modules/node-gyp/lib/configure.js
-@@ -27,7 +27,7 @@ exports.usage = 'Generates ' + (win ? 'MSVC project fi
+@@ -29,7 +29,7 @@ exports.usage = 'Generates ' + (win ? 'MSVC project fi

function configure (gyp, argv, callback) {

Index: patches/patch-deps_uv_src_unix_openbsd_c
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-deps_uv_src_unix_openbsd_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-deps_uv_src_unix_openbsd_c
--- patches/patch-deps_uv_src_unix_openbsd_c 21 Dec 2015 19:27:05 -0000 1.3
+++ patches/patch-deps_uv_src_unix_openbsd_c 2 Feb 2018 03:11:17 -0000
@@ -3,25 +3,24 @@ $OpenBSD: patch-deps_uv_src_unix_openbsd
Fix from Fabian Raetz <fabian.raetz@gmail.com>, currently set for
the next release of 1.x: https://github.com/libuv/libuv/pull/652

---- deps/uv/src/unix/openbsd.c.orig Thu Dec 3 15:16:58 2015
-+++ deps/uv/src/unix/openbsd.c Fri Dec 18 08:16:31 2015
-@@ -26,6 +26,7 @@
+Index: deps/uv/src/unix/openbsd.c
+--- deps/uv/src/unix/openbsd.c.orig
++++ deps/uv/src/unix/openbsd.c
+@@ -26,11 +26,13 @@
#include <sys/resource.h>
#include <sys/sched.h>
#include <sys/time.h>
+#include <sys/stat.h>
#include <sys/sysctl.h>

- #include <ifaddrs.h>
-@@ -36,6 +37,7 @@
+ #include <errno.h>
#include <fcntl.h>
- #include <kvm.h>
#include <paths.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-@@ -76,12 +78,53 @@ void uv_loadavg(double avg[3]) {
+@@ -61,12 +63,53 @@ void uv_loadavg(double avg[3]) {
}


@@ -76,7 +75,7 @@ the next release of 1.x: https://github.
pid_t mypid;
int err;

-@@ -109,18 +152,11 @@ int uv_exepath(char* buffer, size_t* size) {
+@@ -94,18 +137,11 @@ int uv_exepath(char* buffer, size_t* size) {
argsbuf_size *= 2U;
}

Index: patches/patch-deps_v8_Makefile
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-deps_v8_Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 patch-deps_v8_Makefile
--- patches/patch-deps_v8_Makefile 27 Jun 2017 12:04:08 -0000 1.3
+++ patches/patch-deps_v8_Makefile 2 Feb 2018 03:11:17 -0000
@@ -2,21 +2,21 @@ $OpenBSD: patch-deps_v8_Makefile,v 1.3 2
Index: deps/v8/Makefile
--- deps/v8/Makefile.orig
+++ deps/v8/Makefile
-@@ -444,7 +444,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
+@@ -432,7 +432,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
- PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
+ PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
GYP_GENERATORS=make \
-- build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-+ gyp --generator-output="$(OUTDIR)" build/all.gyp \
- -Ibuild/standalone.gypi --depth=. \
+- tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
++ gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
+ -Igypfiles/standalone.gypi --depth=. \
-Dv8_target_arch=$(V8_TARGET_ARCH) \
$(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
-@@ -455,7 +455,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
+@@ -445,7 +445,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
- PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
+ PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
GYP_GENERATORS=make \
-- build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-+ gyp --generator-output="$(OUTDIR)" build/all.gyp \
- -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
+- tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
++ gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
+ -Igypfiles/standalone.gypi --depth=. -S.native $(GYPFLAGS)

- # Note that NACL_SDK_ROOT must be set to point to an appropriate
+ # Replaces the old with the new environment file if they're different, which
Index: patches/patch-deps_v8_src_globals_h
===================================================================
RCS file: /cvs/ports/lang/node/patches/patch-deps_v8_src_globals_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-deps_v8_src_globals_h
--- patches/patch-deps_v8_src_globals_h 27 Jun 2017 12:04:08 -0000 1.2
+++ patches/patch-deps_v8_src_globals_h 2 Feb 2018 03:11:17 -0000
@@ -5,15 +5,15 @@ Slightly modified version of robert@'s p
Index: deps/v8/src/globals.h
--- deps/v8/src/globals.h.orig
+++ deps/v8/src/globals.h
-@@ -156,7 +156,11 @@ const bool kRequiresCodeRange = true;
- // region. Used only for large object space.
- const size_t kMaximalCodeRangeSize = 256 * MB;
+@@ -190,7 +190,11 @@ const size_t kCodeRangeAreaAlignment = 256 * MB;
+ const size_t kMaximalCodeRangeSize = 512 * MB;
+ const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
#else
+#if V8_OS_OPENBSD // OpenBSD
+const size_t kMaximalCodeRangeSize = 256 * MB;
+#else
const size_t kMaximalCodeRangeSize = 512 * MB;
+

No comments:

Post a Comment