Skip to content

Commit 8255cde

Browse files
committed
build: add --shared-nbytes configure flag
PR-URL: #61341 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent c75ad3d commit 8255cde

File tree

5 files changed

+62
-5
lines changed

5 files changed

+62
-5
lines changed

.github/workflows/test-shared.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- deps/icu-small/**
2424
- deps/icu-tmp/**
2525
- deps/llhttp/**
26+
- deps/nbytes/**
2627
- deps/nghttp2/**
2728
- deps/ngtcp2/**
2829
- deps/openssl/*/**
@@ -71,6 +72,7 @@ on:
7172
- deps/icu-small/**
7273
- deps/icu-tmp/**
7374
- deps/llhttp/**
75+
- deps/nbytes/**
7476
- deps/nghttp2/**
7577
- deps/ngtcp2/**
7678
- deps/openssl/*/**

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12401240
$(RM) -r $(TARNAME)/deps/icu-small
12411241
$(RM) -r $(TARNAME)/deps/icu-tmp
12421242
$(RM) -r $(TARNAME)/deps/llhttp
1243+
$(RM) -r $(TARNAME)/deps/nbytes
12431244
$(RM) -r $(TARNAME)/deps/nghttp2
12441245
$(RM) -r $(TARNAME)/deps/ngtcp2
12451246
find $(TARNAME)/deps/openssl -maxdepth 1 -type f ! -name 'nodejs-openssl.cnf' -exec $(RM) {} +

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,28 @@
357357
dest='shared_libuv_libpath',
358358
help='a directory to search for the shared libuv DLL')
359359

360+
shared_optgroup.add_argument('--shared-nbytes',
361+
action='store_true',
362+
dest='shared_nbytes',
363+
default=None,
364+
help='link to a shared nbytes DLL instead of static linking')
365+
366+
shared_optgroup.add_argument('--shared-nbytes-includes',
367+
action='store',
368+
dest='shared_nbytes_includes',
369+
help='directory containing nbytes header files')
370+
371+
shared_optgroup.add_argument('--shared-nbytes-libname',
372+
action='store',
373+
dest='shared_nbytes_libname',
374+
default='nbytes',
375+
help='alternative lib name to link to [default: %(default)s]')
376+
377+
shared_optgroup.add_argument('--shared-nbytes-libpath',
378+
action='store',
379+
dest='shared_nbytes_libpath',
380+
help='a directory to search for the shared nbytes DLL')
381+
360382
shared_optgroup.add_argument('--shared-nghttp2',
361383
action='store_true',
362384
dest='shared_nghttp2',
@@ -2459,6 +2481,7 @@ def make_bin_override():
24592481
configure_library('cares', output, pkgname='libcares')
24602482
configure_library('gtest', output)
24612483
configure_library('hdr_histogram', output)
2484+
configure_library('nbytes', output)
24622485
configure_library('nghttp2', output, pkgname='libnghttp2')
24632486
configure_library('nghttp3', output, pkgname='libnghttp3')
24642487
configure_library('ngtcp2', output, pkgname='libngtcp2')

node.gyp

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
'node_shared_hdr_histogram%': 'false',
1919
'node_shared_http_parser%': 'false',
2020
'node_shared_libuv%': 'false',
21+
'node_shared_nbytes%': 'false',
2122
'node_shared_nghttp2%': 'false',
2223
'node_shared_openssl%': 'false',
2324
'node_shared_sqlite%': 'false',
@@ -873,7 +874,6 @@
873874
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
874875
],
875876
'dependencies': [
876-
'deps/nbytes/nbytes.gyp:nbytes',
877877
'tools/v8_gypfiles/abseil.gyp:abseil',
878878
'node_js2c#host',
879879
],
@@ -945,6 +945,11 @@
945945
'deps/histogram/histogram.gyp:histogram',
946946
],
947947
}],
948+
[ 'node_shared_nbytes=="false"', {
949+
'dependencies': [
950+
'deps/nbytes/nbytes.gyp:nbytes',
951+
],
952+
}],
948953
[ 'node_use_sqlite=="true"', {
949954
'sources': [
950955
'<@(node_sqlite_sources)',
@@ -1183,7 +1188,6 @@
11831188
'type': 'executable',
11841189
'dependencies': [
11851190
'<(node_lib_target_name)',
1186-
'deps/nbytes/nbytes.gyp:nbytes',
11871191
],
11881192
'includes': [
11891193
'node.gypi'
@@ -1216,6 +1220,11 @@
12161220
'deps/histogram/histogram.gyp:histogram',
12171221
],
12181222
}],
1223+
[ 'node_shared_nbytes=="false"', {
1224+
'dependencies': [
1225+
'deps/nbytes/nbytes.gyp:nbytes',
1226+
],
1227+
}],
12191228
[ 'node_shared_uvwasi=="false"', {
12201229
'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ],
12211230
'include_dirs': [ 'deps/uvwasi/include' ],
@@ -1239,7 +1248,6 @@
12391248

12401249
'dependencies': [
12411250
'<(node_lib_target_name)',
1242-
'deps/nbytes/nbytes.gyp:nbytes',
12431251
'tools/v8_gypfiles/abseil.gyp:abseil',
12441252
],
12451253

@@ -1279,6 +1287,11 @@
12791287
'deps/histogram/histogram.gyp:histogram',
12801288
],
12811289
}],
1290+
[ 'node_shared_nbytes=="false"', {
1291+
'dependencies': [
1292+
'deps/nbytes/nbytes.gyp:nbytes',
1293+
],
1294+
}],
12821295
[ 'node_use_openssl=="true"', {
12831296
'defines': [
12841297
'HAVE_OPENSSL=1',
@@ -1346,7 +1359,6 @@
13461359

13471360
'dependencies': [
13481361
'<(node_lib_target_name)',
1349-
'deps/nbytes/nbytes.gyp:nbytes',
13501362
],
13511363

13521364
'includes': [
@@ -1386,6 +1398,11 @@
13861398
'deps/histogram/histogram.gyp:histogram',
13871399
],
13881400
}],
1401+
[ 'node_shared_nbytes=="false"', {
1402+
'dependencies': [
1403+
'deps/nbytes/nbytes.gyp:nbytes',
1404+
],
1405+
}],
13891406
['OS=="win"', {
13901407
'libraries': [
13911408
'Dbghelp.lib',
@@ -1472,7 +1489,6 @@
14721489

14731490
'dependencies': [
14741491
'<(node_lib_target_name)',
1475-
'deps/nbytes/nbytes.gyp:nbytes',
14761492
],
14771493

14781494
'includes': [
@@ -1509,6 +1525,11 @@
15091525
'deps/histogram/histogram.gyp:histogram',
15101526
],
15111527
}],
1528+
[ 'node_shared_nbytes=="false"', {
1529+
'dependencies': [
1530+
'deps/nbytes/nbytes.gyp:nbytes',
1531+
],
1532+
}],
15121533
[ 'node_use_openssl=="true"', {
15131534
'dependencies': [
15141535
'deps/ncrypto/ncrypto.gyp:ncrypto',

tools/nix/sharedLibDeps.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
cares = pkgs.c-ares;
2323
hdr-histogram = pkgs.hdrhistogram_c;
2424
http-parser = pkgs.llhttp;
25+
nbytes = pkgs.callPackage "${
26+
pkgs.fetchgit {
27+
url = "https://github.com/NixOS/nixpkgs.git";
28+
rev = "3146c6aa9995e7351a398e17470e15305e6e18ff";
29+
sparseCheckout = [
30+
"/pkgs/by-name/nb/nbytes/"
31+
];
32+
hash = "sha256-8cbu4ftn5ke7vd4cniwxuyKl6FRxwdToBj77oyYmsfk=";
33+
}
34+
}/pkgs/by-name/nb/nbytes/package.nix" { };
2535
}
2636
// (pkgs.lib.optionalAttrs withSQLite {
2737
inherit (pkgs) sqlite;

0 commit comments

Comments
 (0)