From 61cfe1adb336df89f81526152c13395536e23dc0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 4 Jan 2026 18:35:29 +0100 Subject: [PATCH] build: add `--shared-nbytes` configure flag --- .github/workflows/test-shared.yml | 2 ++ Makefile | 1 + configure.py | 23 +++++++++++++++++++++++ node.gyp | 31 ++++++++++++++++++++++++++----- tools/nix/pkgs.nix | 4 ++-- tools/nix/sharedLibDeps.nix | 1 + 6 files changed, 55 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml index 9ac028af6e6fa2..310640538414ab 100644 --- a/.github/workflows/test-shared.yml +++ b/.github/workflows/test-shared.yml @@ -23,6 +23,7 @@ on: - deps/icu-small/** - deps/icu-tmp/** - deps/llhttp/** + - deps/nbytes/** - deps/nghttp2/** - deps/ngtcp2/** - deps/openssl/*/** @@ -71,6 +72,7 @@ on: - deps/icu-small/** - deps/icu-tmp/** - deps/llhttp/** + - deps/nbytes/** - deps/nghttp2/** - deps/ngtcp2/** - deps/openssl/*/** diff --git a/Makefile b/Makefile index 5afee2318c9bca..4dfced1c8de07d 100644 --- a/Makefile +++ b/Makefile @@ -1242,6 +1242,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1) $(RM) -r $(TARNAME)/deps/icu-small $(RM) -r $(TARNAME)/deps/icu-tmp $(RM) -r $(TARNAME)/deps/llhttp + $(RM) -r $(TARNAME)/deps/nbytes $(RM) -r $(TARNAME)/deps/nghttp2 $(RM) -r $(TARNAME)/deps/ngtcp2 find $(TARNAME)/deps/openssl -maxdepth 1 -type f ! -name 'nodejs-openssl.cnf' -exec $(RM) {} + diff --git a/configure.py b/configure.py index c83a7ec8c18207..d24bc8103223de 100755 --- a/configure.py +++ b/configure.py @@ -357,6 +357,28 @@ dest='shared_libuv_libpath', help='a directory to search for the shared libuv DLL') +shared_optgroup.add_argument('--shared-nbytes', + action='store_true', + dest='shared_nbytes', + default=None, + help='link to a shared nbytes DLL instead of static linking') + +shared_optgroup.add_argument('--shared-nbytes-includes', + action='store', + dest='shared_nbytes_includes', + help='directory containing nbytes header files') + +shared_optgroup.add_argument('--shared-nbytes-libname', + action='store', + dest='shared_nbytes_libname', + default='nbytes', + help='alternative lib name to link to [default: %(default)s]') + +shared_optgroup.add_argument('--shared-nbytes-libpath', + action='store', + dest='shared_nbytes_libpath', + help='a directory to search for the shared nbytes DLL') + shared_optgroup.add_argument('--shared-nghttp2', action='store_true', dest='shared_nghttp2', @@ -2455,6 +2477,7 @@ def make_bin_override(): configure_library('cares', output, pkgname='libcares') configure_library('gtest', output) configure_library('hdr_histogram', output) +configure_library('nbytes', output) configure_library('nghttp2', output, pkgname='libnghttp2') configure_library('nghttp3', output, pkgname='libnghttp3') configure_library('ngtcp2', output, pkgname='libngtcp2') diff --git a/node.gyp b/node.gyp index df8d67d39db212..6dfe2257b80e54 100644 --- a/node.gyp +++ b/node.gyp @@ -18,6 +18,7 @@ 'node_shared_hdr_histogram%': 'false', 'node_shared_http_parser%': 'false', 'node_shared_libuv%': 'false', + 'node_shared_nbytes%': 'false', 'node_shared_nghttp2%': 'false', 'node_shared_openssl%': 'false', 'node_shared_sqlite%': 'false', @@ -868,7 +869,6 @@ '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h ], 'dependencies': [ - 'deps/nbytes/nbytes.gyp:nbytes', 'tools/v8_gypfiles/abseil.gyp:abseil', 'node_js2c#host', ], @@ -940,6 +940,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_use_sqlite=="true"', { 'sources': [ '<@(node_sqlite_sources)', @@ -1173,7 +1178,6 @@ 'type': 'executable', 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', ], 'includes': [ 'node.gypi' @@ -1206,6 +1210,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_shared_uvwasi=="false"', { 'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ], 'include_dirs': [ 'deps/uvwasi/include' ], @@ -1229,7 +1238,6 @@ 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', 'tools/v8_gypfiles/abseil.gyp:abseil', ], @@ -1269,6 +1277,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_use_openssl=="true"', { 'defines': [ 'HAVE_OPENSSL=1', @@ -1329,7 +1342,6 @@ 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', ], 'includes': [ @@ -1369,6 +1381,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], ['OS=="win"', { 'libraries': [ 'Dbghelp.lib', @@ -1455,7 +1472,6 @@ 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', ], 'includes': [ @@ -1492,6 +1508,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_use_openssl=="true"', { 'dependencies': [ 'deps/ncrypto/ncrypto.gyp:ncrypto', diff --git a/tools/nix/pkgs.nix b/tools/nix/pkgs.nix index 358a3abbfc77ec..2fb6b50f724769 100644 --- a/tools/nix/pkgs.nix +++ b/tools/nix/pkgs.nix @@ -1,10 +1,10 @@ arg: let repo = "https://github.com/NixOS/nixpkgs"; - rev = "16c7794d0a28b5a37904d55bcca36003b9109aaa"; + rev = "3146c6aa9995e7351a398e17470e15305e6e18ff"; nixpkgs = import (builtins.fetchTarball { url = "${repo}/archive/${rev}.tar.gz"; - sha256 = "1931vmgdclk332ikh7psxha1bskvrjwqrqm8a3xwcsr5hc8jfmbw"; + sha256 = "165ql727hrcjz3zwsah18zclf5znfry7dc042qxc2zixsqqzah7a"; }) arg; in nixpkgs diff --git a/tools/nix/sharedLibDeps.nix b/tools/nix/sharedLibDeps.nix index 3e0b25f25250df..d6b6a907178522 100644 --- a/tools/nix/sharedLibDeps.nix +++ b/tools/nix/sharedLibDeps.nix @@ -11,6 +11,7 @@ c-ares gtest libuv + nbytes nghttp3 ngtcp2 simdjson