Skip to content

Commit a8902ab

Browse files
committed
build: add --shared-hdr-histogram configure flag
PR-URL: #61280 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent 7f9b339 commit a8902ab

File tree

5 files changed

+68
-11
lines changed

5 files changed

+68
-11
lines changed

.github/workflows/test-shared.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- deps/crates/**
2020
- deps/corepack/**
2121
- deps/googletest/**
22+
- deps/histogram/**
2223
- deps/icu-small/**
2324
- deps/icu-tmp/**
2425
- deps/llhttp/**
@@ -66,6 +67,7 @@ on:
6667
- deps/crates/**
6768
- deps/corepack/**
6869
- deps/googletest/**
70+
- deps/histogram/**
6971
- deps/icu-small/**
7072
- deps/icu-tmp/**
7173
- deps/llhttp/**

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12381238
$(RM) -r $(TARNAME)/deps/cares
12391239
$(RM) -r $(TARNAME)/deps/crates
12401240
$(RM) -r $(TARNAME)/deps/googletest
1241+
$(RM) -r $(TARNAME)/deps/histogram
12411242
$(RM) -r $(TARNAME)/deps/icu-small
12421243
$(RM) -r $(TARNAME)/deps/icu-tmp
12431244
$(RM) -r $(TARNAME)/deps/llhttp

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,28 @@
285285
dest='shared_gtest_libpath',
286286
help='a directory to search for the shared googletest DLL')
287287

288+
shared_optgroup.add_argument('--shared-hdr-histogram',
289+
action='store_true',
290+
dest='shared_hdr_histogram',
291+
default=None,
292+
help='link to a shared HdrHistogram DLL instead of static linking')
293+
294+
shared_optgroup.add_argument('--shared-hdr-histogram-includes',
295+
action='store',
296+
dest='shared_hdr_histogram_includes',
297+
help='directory containing HdrHistogram header files')
298+
299+
shared_optgroup.add_argument('--shared-hdr-histogram-libname',
300+
action='store',
301+
dest='shared_hdr_histogram_libname',
302+
default='hdr_histogram',
303+
help='alternative lib name to link to [default: %(default)s]')
304+
305+
shared_optgroup.add_argument('--shared-hdr-histogram-libpath',
306+
action='store',
307+
dest='shared_hdr_histogram_libpath',
308+
help='a directory to search for the shared HdrHistogram DLL')
309+
288310
parser.add_argument('--experimental-http-parser',
289311
action='store_true',
290312
dest='experimental_http_parser',
@@ -2431,6 +2453,7 @@ def make_bin_override():
24312453
configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
24322454
configure_library('cares', output, pkgname='libcares')
24332455
configure_library('gtest', output)
2456+
configure_library('hdr_histogram', output)
24342457
configure_library('nghttp2', output, pkgname='libnghttp2')
24352458
configure_library('nghttp3', output, pkgname='libnghttp3')
24362459
configure_library('ngtcp2', output, pkgname='libngtcp2')

node.gyp

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'node_shared_brotli%': 'false',
1616
'node_shared_cares%': 'false',
1717
'node_shared_gtest%': 'false',
18+
'node_shared_hdr_histogram%': 'false',
1819
'node_shared_http_parser%': 'false',
1920
'node_shared_libuv%': 'false',
2021
'node_shared_nghttp2%': 'false',
@@ -572,10 +573,6 @@
572573
'src/node_main.cc'
573574
],
574575

575-
'dependencies': [
576-
'deps/histogram/histogram.gyp:histogram',
577-
],
578-
579576
'msvs_settings': {
580577
'VCLinkerTool': {
581578
'GenerateMapFile': 'true', # /MAP
@@ -597,6 +594,11 @@
597594
'msvs_disabled_warnings!': [4244],
598595

599596
'conditions': [
597+
[ 'node_shared_hdr_histogram=="false"', {
598+
'dependencies': [
599+
'deps/histogram/histogram.gyp:histogram',
600+
],
601+
}],
600602
[ 'error_on_warn=="true"', {
601603
'cflags': ['-Werror'],
602604
'xcode_settings': {
@@ -866,7 +868,6 @@
866868
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
867869
],
868870
'dependencies': [
869-
'deps/histogram/histogram.gyp:histogram',
870871
'deps/nbytes/nbytes.gyp:nbytes',
871872
'tools/v8_gypfiles/abseil.gyp:abseil',
872873
'node_js2c#host',
@@ -934,6 +935,11 @@
934935
'deps/googletest/googletest.gyp:gtest_prod',
935936
],
936937
}],
938+
[ 'node_shared_hdr_histogram=="false"', {
939+
'dependencies': [
940+
'deps/histogram/histogram.gyp:histogram',
941+
],
942+
}],
937943
[ 'node_use_sqlite=="true"', {
938944
'sources': [
939945
'<@(node_sqlite_sources)',
@@ -1071,7 +1077,6 @@
10711077
'type': 'executable',
10721078
'dependencies': [
10731079
'<(node_lib_target_name)',
1074-
'deps/histogram/histogram.gyp:histogram',
10751080
],
10761081

10771082
'includes': [
@@ -1096,6 +1101,11 @@
10961101
'test/fuzzers/fuzz_env.cc',
10971102
],
10981103
'conditions': [
1104+
[ 'node_shared_hdr_histogram=="false"', {
1105+
'dependencies': [
1106+
'deps/histogram/histogram.gyp:histogram',
1107+
],
1108+
}],
10991109
['OS=="linux" or OS=="openharmony"', {
11001110
'ldflags': [ '-fsanitize=fuzzer' ]
11011111
}],
@@ -1114,7 +1124,6 @@
11141124
'type': 'executable',
11151125
'dependencies': [
11161126
'<(node_lib_target_name)',
1117-
'deps/histogram/histogram.gyp:histogram',
11181127
],
11191128
'includes': [
11201129
'node.gypi'
@@ -1137,6 +1146,11 @@
11371146
'test/fuzzers/fuzz_ClientHelloParser.cc',
11381147
],
11391148
'conditions': [
1149+
[ 'node_shared_hdr_histogram=="false"', {
1150+
'dependencies': [
1151+
'deps/histogram/histogram.gyp:histogram',
1152+
],
1153+
}],
11401154
[ 'node_shared_uvwasi=="false"', {
11411155
'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ],
11421156
'include_dirs': [ 'deps/uvwasi/include' ],
@@ -1159,7 +1173,6 @@
11591173
'type': 'executable',
11601174
'dependencies': [
11611175
'<(node_lib_target_name)',
1162-
'deps/histogram/histogram.gyp:histogram',
11631176
'deps/nbytes/nbytes.gyp:nbytes',
11641177
],
11651178
'includes': [
@@ -1188,6 +1201,11 @@
11881201
'deps/googletest/googletest.gyp:gtest_prod',
11891202
],
11901203
}],
1204+
[ 'node_shared_hdr_histogram=="false"', {
1205+
'dependencies': [
1206+
'deps/histogram/histogram.gyp:histogram',
1207+
],
1208+
}],
11911209
[ 'node_shared_uvwasi=="false"', {
11921210
'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ],
11931211
'include_dirs': [ 'deps/uvwasi/include' ],
@@ -1211,7 +1229,6 @@
12111229

12121230
'dependencies': [
12131231
'<(node_lib_target_name)',
1214-
'deps/histogram/histogram.gyp:histogram',
12151232
'deps/nbytes/nbytes.gyp:nbytes',
12161233
'tools/v8_gypfiles/abseil.gyp:abseil',
12171234
],
@@ -1247,6 +1264,11 @@
12471264
[ 'node_shared_gtest=="true"', {
12481265
'libraries': [ '-lgtest_main' ],
12491266
}],
1267+
[ 'node_shared_hdr_histogram=="false"', {
1268+
'dependencies': [
1269+
'deps/histogram/histogram.gyp:histogram',
1270+
],
1271+
}],
12501272
[ 'node_use_openssl=="true"', {
12511273
'defines': [
12521274
'HAVE_OPENSSL=1',
@@ -1307,7 +1329,6 @@
13071329

13081330
'dependencies': [
13091331
'<(node_lib_target_name)',
1310-
'deps/histogram/histogram.gyp:histogram',
13111332
'deps/nbytes/nbytes.gyp:nbytes',
13121333
],
13131334

@@ -1343,6 +1364,11 @@
13431364
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
13441365
},
13451366
}],
1367+
[ 'node_shared_hdr_histogram=="false"', {
1368+
'dependencies': [
1369+
'deps/histogram/histogram.gyp:histogram',
1370+
],
1371+
}],
13461372
['OS=="win"', {
13471373
'libraries': [
13481374
'Dbghelp.lib',
@@ -1429,7 +1455,6 @@
14291455

14301456
'dependencies': [
14311457
'<(node_lib_target_name)',
1432-
'deps/histogram/histogram.gyp:histogram',
14331458
'deps/nbytes/nbytes.gyp:nbytes',
14341459
],
14351460

@@ -1462,6 +1487,11 @@
14621487
['node_write_snapshot_as_array_literals=="true"', {
14631488
'defines': [ 'NODE_MKSNAPSHOT_USE_ARRAY_LITERALS=1' ],
14641489
}],
1490+
[ 'node_shared_hdr_histogram=="false"', {
1491+
'dependencies': [
1492+
'deps/histogram/histogram.gyp:histogram',
1493+
],
1494+
}],
14651495
[ 'node_use_openssl=="true"', {
14661496
'dependencies': [
14671497
'deps/ncrypto/ncrypto.gyp:ncrypto',

tools/nix/sharedLibDeps.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
zlib
2121
zstd
2222
;
23+
hdr-histogram = pkgs.hdrhistogram_c;
2324
http-parser = pkgs.llhttp;
2425
}
2526
// (pkgs.lib.optionalAttrs withSQLite {

0 commit comments

Comments
 (0)