GeezerVison is showing github.com — build: do not pass vendored headers when building against shared libs · nodejs/node@9c0526e
File treeExpand file treeCollapse file tree Open diff view settings benchmark/napi/make_callback sqlite/test_sqlite_extensions
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/test-shared.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -199,7 +199,7 @@ jobs: | 199 | 199 | id: v8-drv | 200 | 200 | run: | | 201 | 201 | V8_DRV=$( | 202 | | - nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/tools/nix/ci-shell.nix {}).buildInputs" | | 202 | + nix-instantiate -E "(import $TAR_DIR/tools/nix/ci-shell.nix {}).v8Derivation" | 203 | 203 | ) | 204 | 204 | V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV") | 205 | 205 | echo "V8_DRV=$V8_DRV" >> "$GITHUB_OUTPUT" | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/napi/make_callback/binding.gyp +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | 'targets': [ | 3 | 3 | { | 4 | 4 | 'target_name': 'binding', | 5 | | - 'sources': [ 'binding.cc' ] | | 5 | + 'sources': [ 'binding.cc' ], | | 6 | + 'include_dirs': [ '<@(node_shared_libuv_include_dirs)' ], | 6 | 7 | } | 7 | 8 | ] | 8 | 9 | } |
Collapse file Copy file name to clipboardExpand all lines: common.gypi +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 26 | 26 | 'node_module_version%': '', | 27 | 27 | 'node_with_ltcg%': '', | 28 | 28 | 'node_shared_openssl%': 'false', | | 29 | + 'node_shared_openssl_include_dirs%': [], | 29 | 30 | 'openssl_is_boringssl%': 'false', | 30 | 31 |
| | 32 | + 'node_shared_libuv_include_dirs%': [], | | 33 | + 'node_shared_sqlite%': 'false', | | 34 | + 'node_shared_sqlite_include_dirs%': [], | | 35 | + 'node_shared_zlib_include_dirs%': [], | | 36 | + | 31 | 37 | 'node_tag%': '', | 32 | 38 | 'uv_library%': 'static_library', | 33 | 39 |
| |
Collapse file Copy file name to clipboardExpand all lines: configure.py +14-7Lines changed: 14 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2261,19 +2261,26 @@ def configure_napi(output): | 2261 | 2261 | version = getnapibuildversion.get_napi_version() | 2262 | 2262 | output['variables']['napi_build_version'] = version | 2263 | 2263 |
| 2264 | | -def configure_library(lib, output, pkgname=None, libraries_key='libraries'): | | 2264 | +def configure_library(lib, output, pkgname=None, libraries_key='libraries', with_separate_include_var=False): | 2265 | 2265 | shared_lib = 'shared_' + lib | 2266 | 2266 | output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib)) | | 2267 | + | 2267 | 2268 | libraries = output[libraries_key] if libraries_key in output else output['variables'][libraries_key] | 2268 | 2269 |
| | 2270 | + include_dirs = [] | | 2271 | + if with_separate_include_var: | | 2272 | + output['variables'][f'node_{shared_lib}_include_dirs'] = include_dirs | | 2273 | + | 2269 | 2274 | if getattr(options, shared_lib): | 2270 | 2275 | (pkg_libs, pkg_cflags, pkg_libpath, _) = pkg_config(pkgname or lib) | 2271 | 2276 |
| 2272 | 2277 | if options.__dict__[shared_lib + '_includes']: | 2273 | | - output['include_dirs'] += [options.__dict__[shared_lib + '_includes']] | | 2278 | + include_dirs += [options.__dict__[shared_lib + '_includes']] | 2274 | 2279 | elif pkg_cflags: | 2275 | 2280 | stripped_flags = [flag.strip() for flag in pkg_cflags.split('-I')] | 2276 | | - output['include_dirs'] += [flag for flag in stripped_flags if flag] | | 2281 | + include_dirs += [flag for flag in stripped_flags if flag] | | 2282 | + | | 2283 | + output['include_dirs'] += include_dirs | 2277 | 2284 |
| 2278 | 2285 | # libpath needs to be provided ahead libraries | 2279 | 2286 | if options.__dict__[shared_lib + '_libpath']: | @@ -2442,7 +2449,7 @@ def without_ssl_error(option): | 2442 | 2449 | if options.openssl_is_fips and not options.shared_openssl: | 2443 | 2450 | variables['node_fipsinstall'] = b(True) | 2444 | 2451 |
| 2445 | | - configure_library('openssl', o) | | 2452 | + configure_library('openssl', o, with_separate_include_var=True) | 2446 | 2453 |
| 2447 | 2454 | o['variables']['openssl_version'] = get_openssl_version(o) | 2448 | 2455 | o['variables']['openssl_is_boringssl'] = get_openssl_is_boringssl(o) | @@ -2473,7 +2480,7 @@ def without_sqlite_error(option): | 2473 | 2480 | without_sqlite_error('--shared-sqlite') | 2474 | 2481 | return | 2475 | 2482 |
| 2476 | | - configure_library('sqlite', o, pkgname='sqlite3') | | 2483 | + configure_library('sqlite', o, pkgname='sqlite3', with_separate_include_var=True) | 2477 | 2484 |
| 2478 | 2485 | def bundled_ffi_supported(os_name, target_arch): | 2479 | 2486 | if target_arch == 'x86': | @@ -2979,9 +2986,9 @@ def make_bin_override(): | 2979 | 2986 | configure_node_lib_files(output) | 2980 | 2987 | configure_node_cctest_sources(output) | 2981 | 2988 | configure_napi(output) | 2982 | | -configure_library('zlib', output) | | 2989 | +configure_library('zlib', output, with_separate_include_var=True) | 2983 | 2990 | configure_library('http_parser', output, pkgname='libllhttp') | 2984 | | -configure_library('libuv', output) | | 2991 | +configure_library('libuv', output, with_separate_include_var=True) | 2985 | 2992 | configure_library('abseil', output, pkgname=[ | 2986 | 2993 | 'absl_absl_check', | 2987 | 2994 | 'absl_absl_log', | |
Collapse file Copy file name to clipboardExpand all lines: shell.nix +19-14Lines changed: 19 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 88 | 88 | ] | 89 | 89 | ++ builtins.map (depName: "--shared-${depName}") sharedV8Deps | 90 | 90 | ++ pkgs.lib.optional withPerfetto "--with-perfetto"; | | 91 | + | | 92 | + v8Derivation = | | 93 | + if useSeparateDerivationForV8 == true then | | 94 | + let | | 95 | + sharedLibsToMock = pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { }; | | 96 | + in | | 97 | + pkgs.callPackage ./tools/nix/v8.nix { | | 98 | + inherit nativeBuildInputs icu; | | 99 | + | | 100 | + configureFlags = configureFlags ++ sharedLibsToMock.configureFlags ++ [ "--ninja" ]; | | 101 | + buildInputs = buildInputs ++ [ sharedLibsToMock ]; | | 102 | + } | | 103 | + else | | 104 | + useSeparateDerivationForV8; | 91 | 105 | in | 92 | 106 | pkgs.mkShell { | 93 | 107 | inherit nativeBuildInputs; | @@ -98,20 +112,7 @@ pkgs.mkShell { | 98 | 112 | buildInputs = | 99 | 113 | builtins.attrValues sharedLibDeps | 100 | 114 | ++ buildInputs | 101 | | - ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) ( | 102 | | - if useSeparateDerivationForV8 == true then | 103 | | - let | 104 | | - sharedLibsToMock = pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { }; | 105 | | - in | 106 | | - pkgs.callPackage ./tools/nix/v8.nix { | 107 | | - inherit nativeBuildInputs icu; | 108 | | - | 109 | | - configureFlags = configureFlags ++ sharedLibsToMock.configureFlags ++ [ "--ninja" ]; | 110 | | - buildInputs = buildInputs ++ [ sharedLibsToMock ]; | 111 | | - } | 112 | | - else | 113 | | - useSeparateDerivationForV8 | 114 | | - ); | | 115 | + ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) v8Derivation; | 115 | 116 |
| 116 | 117 | packages = devTools ++ benchmarkTools ++ pkgs.lib.optional (ccache != null) ccache; | 117 | 118 |
| @@ -120,6 +121,10 @@ pkgs.mkShell { | 120 | 121 | export CXX="${pkgs.lib.getExe ccache} $CXX" | 121 | 122 | ''; | 122 | 123 |
| | 124 | + passthru = { | | 125 | + inherit v8Derivation; | | 126 | + }; | | 127 | + | 123 | 128 | env = { | 124 | 129 | BUILD_WITH = if (ninja != null) then "ninja" else "make"; | 125 | 130 | NINJA = pkgs.lib.optionalString (ninja != null) "${pkgs.lib.getExe ninja}"; | |
Collapse file Copy file name to clipboardExpand all lines: test/addons/async-cleanup-hook/binding.gyp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | 'target_name': 'binding', | 5 | 5 | 'sources': [ 'binding.cc' ], | 6 | 6 | 'includes': ['../common.gypi'], | | 7 | + 'include_dirs': [ '<@(node_shared_libuv_include_dirs)' ], | 7 | 8 | } | 8 | 9 | ] | 9 | 10 | } |
Collapse file Copy file name to clipboardExpand all lines: test/addons/async-hello-world/binding.gyp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | 'target_name': 'binding', | 5 | 5 | 'sources': [ 'binding.cc' ], | 6 | 6 | 'includes': ['../common.gypi'], | | 7 | + 'include_dirs': [ '<@(node_shared_libuv_include_dirs)' ], | 7 | 8 | } | 8 | 9 | ] | 9 | 10 | } |
Collapse file Copy file name to clipboardExpand all lines: test/addons/callback-scope/binding.gyp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | 'target_name': 'binding', | 5 | 5 | 'sources': [ 'binding.cc' ], | 6 | 6 | 'includes': ['../common.gypi'], | | 7 | + 'include_dirs': ['<@(node_shared_libuv_include_dirs)'], | 7 | 8 | } | 8 | 9 | ] | 9 | 10 | } |
Collapse file Copy file name to clipboardExpand all lines: test/addons/esm-export-default/binding.gyp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | 'target_name': 'binding-export-default', | 5 | 5 | 'sources': [ 'binding-export-default.cc' ], | 6 | 6 | 'includes': ['../common.gypi'], | | 7 | + 'include_dirs': [ '<@(node_shared_libuv_include_dirs)' ], | 7 | 8 | }, | 8 | 9 | ] | 9 | 10 | } |
Collapse file Copy file name to clipboardExpand all lines: test/addons/esm-export-primitive/binding.gyp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | 'target_name': 'binding-export-primitive', | 5 | 5 | 'sources': [ 'binding-export-primitive.cc' ], | 6 | 6 | 'includes': ['../common.gypi'], | | 7 | + 'include_dirs': [ '<@(node_shared_libuv_include_dirs)' ], | 7 | 8 | }, | 8 | 9 | ] | 9 | 10 | } |
|