@@ -1256,10 +1256,10 @@ index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1
12561256+ }
12571257diff --git a/filenames.json b/filenames.json
12581258new file mode 100644
1259- index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e112101ec
1259+ index 0000000000000000000000000000000000000000..fd42e2a5e6163ff70db0f716d2f9a32f13cdf668
12601260--- /dev/null
12611261+++ b/filenames.json
1262- @@ -0,0 +1,739 @@
1262+ @@ -0,0 +1,734 @@
12631263+ // This file is automatically generated by generate_gn_filenames_json.py
12641264+ // DO NOT EDIT
12651265+ {
@@ -1292,7 +1292,7 @@ index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e
12921292+ ]
12931293+ },
12941294+ {
1295- + "dest_dir": "include/node//",
1295+ + "dest_dir": "include/node/. /",
12961296+ "files": [
12971297+ "//v8/include/v8-array-buffer.h",
12981298+ "//v8/include/v8-callbacks.h",
@@ -1346,19 +1346,20 @@ index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e
13461346+ "//v8/include/v8-wasm.h",
13471347+ "//v8/include/v8-weak-callback-info.h",
13481348+ "//v8/include/v8.h",
1349- + "//v8/include/v8config.h"
1349+ + "//v8/include/v8config.h",
1350+ + "deps/uv/include/uv.h"
13501351+ ]
13511352+ },
13521353+ {
1353- + "dest_dir": "include/node// libplatform/",
1354+ + "dest_dir": "include/node/libplatform/",
13541355+ "files": [
13551356+ "//v8/include/libplatform/libplatform-export.h",
13561357+ "//v8/include/libplatform/libplatform.h",
13571358+ "//v8/include/libplatform/v8-tracing.h"
13581359+ ]
13591360+ },
13601361+ {
1361- + "dest_dir": "include/node// cppgc/",
1362+ + "dest_dir": "include/node/cppgc/",
13621363+ "files": [
13631364+ "//v8/include/cppgc/allocation.h",
13641365+ "//v8/include/cppgc/common.h",
@@ -1391,7 +1392,7 @@ index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e
13911392+ ]
13921393+ },
13931394+ {
1394- + "dest_dir": "include/node// cppgc/internal/",
1395+ + "dest_dir": "include/node/cppgc/internal/",
13951396+ "files": [
13961397+ "//v8/include/cppgc/internal/api-constants.h",
13971398+ "//v8/include/cppgc/internal/atomic-entry-flag.h",
@@ -1410,13 +1411,7 @@ index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e
14101411+ ]
14111412+ },
14121413+ {
1413- + "dest_dir": "include/node//",
1414- + "files": [
1415- + "deps/uv/include/uv.h"
1416- + ]
1417- + },
1418- + {
1419- + "dest_dir": "include/node//uv/",
1414+ + "dest_dir": "include/node/uv/",
14201415+ "files": [
14211416+ "deps/uv/include/uv/aix.h",
14221417+ "deps/uv/include/uv/bsd.h",
@@ -1891,7 +1886,7 @@ index 0000000000000000000000000000000000000000..1a9cba024f1762b0dfe31da92213b51e
18911886+ "src/dataqueue/queue.h",
18921887+ "src/debug_utils.h",
18931888+ "src/debug_utils-inl.h",
1894- + "src/embeded_data .h",
1889+ + "src/embedded_data .h",
18951890+ "src/encoding_binding.h",
18961891+ "src/env_properties.h",
18971892+ "src/env.h",
@@ -2243,10 +2238,10 @@ index 75a7f3dd89e096d13ad7d70ed29d301cd56315b5..9a20a275fbe5df9f384b7b1d1d26806e
22432238 // bootstrap scripts, whose source are bundled into the binary as static data.
22442239diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py
22452240new file mode 100755
2246- index 0000000000000000000000000000000000000000..7848ddb1841b6d4f36e9376c73564eb4ff6d7c08
2241+ index 0000000000000000000000000000000000000000..37c16859003e61636fe2f1a4040b1e904c472d0b
22472242--- /dev/null
22482243+++ b/tools/generate_gn_filenames_json.py
2249- @@ -0,0 +1,90 @@
2244+ @@ -0,0 +1,117 @@
22502245+ #!/usr/bin/env python3
22512246+ import json
22522247+ import os
@@ -2276,6 +2271,14 @@ index 0000000000000000000000000000000000000000..7848ddb1841b6d4f36e9376c73564eb4
22762271+ // DO NOT EDIT
22772272+ '''.lstrip()
22782273+
2274+ + SRC_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', '..'))
2275+ +
2276+ + def get_out_dir():
2277+ + out_dir = 'Testing'
2278+ + override = os.environ.get('ELECTRON_OUT_DIR')
2279+ + if override is not None:
2280+ + out_dir = override
2281+ + return os.path.join(SRC_DIR, 'out', out_dir)
22792282+
22802283+ if __name__ == '__main__':
22812284+ node_root_dir = os.path.dirname(os.path.dirname(__file__))
@@ -2294,18 +2297,25 @@ index 0000000000000000000000000000000000000000..7848ddb1841b6d4f36e9376c73564eb4
22942297+ }
22952298+
22962299+ def filter_v8_files(files):
2297- + if any(f.startswith('deps/v8/') for f in files):
2298- + files = [f.replace('deps/v8/', '../../v8/', 1) if f.endswith('js') else f.replace('deps/v8/', '//v8/') for f in files]
2299- +
2300- + if any(f == '<@(node_builtin_shareable_builtins)' for f in files):
2301- + files.remove('<@(node_builtin_shareable_builtins)')
2300+ + v8_files = [f for f in files if f.startswith('deps/v8/')]
2301+ + other_files = [f for f in files if not f.startswith('deps/v8/')]
2302+ +
2303+ + for i, f in enumerate(v8_files):
2304+ + if not f.startswith('deps/v8/tools'):
2305+ + if f.endswith('js'):
2306+ + v8_files[i] = f.replace('deps/v8/', '../../v8/', 1)
2307+ + else:
2308+ + v8_files[i] = f.replace('deps/v8/', '//v8/')
2309+ +
2310+ + if any(f == '<@(node_builtin_shareable_builtins)' for f in other_files):
2311+ + other_files.remove('<@(node_builtin_shareable_builtins)')
23022312+ shared_builtins = ['deps/cjs-module-lexer/lexer.js', 'deps/cjs-module-lexer/dist/lexer.js', 'deps/undici/undici.js']
2303- + files .extend(shared_builtins)
2313+ + other_files .extend(shared_builtins)
23042314+
2305- + return files
2315+ + return v8_files + other_files
23062316+
23072317+ def filter_fs_files(files):
2308- + return [f for f in files if f.startswith('lib/internal/fs/')] + ['lib/fs.js']
2318+ + return [f for f in files if f.startswith('lib/internal/fs/')] + ['lib/fs.js'] + ['lib/fs/promises.js']
23092319+
23102320+ lib_files = SearchFiles('lib', 'js')
23112321+ out['library_files'] = filter_v8_files(lib_files)
@@ -2322,17 +2332,29 @@ index 0000000000000000000000000000000000000000..7848ddb1841b6d4f36e9376c73564eb4
23222332+ out['node_sources'] += filter_v8_files(blocklisted_sources)
23232333+
23242334+ out['headers'] = []
2325- + def add_headers(files, dest_dir):
2335+ + def add_headers(options, files, dest_dir):
23262336+ if 'src/node.h' in files:
23272337+ files = [f for f in files if f.endswith('.h') and f != 'src/node_version.h']
23282338+ elif any(f.startswith('../../v8/') for f in files):
23292339+ files = [f.replace('../../v8/', '//v8/', 1) for f in files]
23302340+ if files:
2331- + hs = {'files': sorted(files), 'dest_dir': dest_dir}
2332- + out['headers'].append(hs)
2333- +
2334- + install.variables = {'node_shared_libuv': 'false'}
2335- + install.headers(add_headers)
2341+ + dir_index = next((i for i, d in enumerate(out['headers']) if d['dest_dir'] == dest_dir), -1)
2342+ + if (dir_index != -1):
2343+ + out['headers'][dir_index]['files'] += sorted(files)
2344+ + else:
2345+ + hs = {'files': sorted(files), 'dest_dir': dest_dir}
2346+ + out['headers'].append(hs)
2347+ +
2348+ + config_gypi_path = os.path.join(get_out_dir(), 'gen', 'config.gypi')
2349+ + root_gen_dir = os.path.join(node_root_dir, 'out', 'Release', 'gen')
2350+ +
2351+ + options = install.parse_options(['install', '--v8-dir', '../../v8', '--config-gypi-path', config_gypi_path, '--headers-only'])
2352+ + options.variables['node_use_openssl'] = 'false'
2353+ + options.variables['node_shared_libuv'] = 'false'
2354+ + # We generate zlib headers in Electron's BUILD.gn.
2355+ + options.variables['node_shared_zlib'] = ''
2356+ +
2357+ + install.headers(options, add_headers)
23362358+ with open(os.path.join(node_root_dir, 'filenames.json'), 'w') as f:
23372359+ f.write(FILENAMES_JSON_HEADER)
23382360+ f.write(json.dumps(out, sort_keys=True, indent=2, separators=(',', ': ')))
@@ -2363,18 +2385,27 @@ index 0000000000000000000000000000000000000000..9be3ac447f9a4dde23fefc26e0b922b4
23632385+ transformed_f.write(transformed_contents)
23642386+
23652387diff --git a/tools/install.py b/tools/install.py
2366- index b132c7bf26c02886a7ab341a1973bf449744ba0f..171b383a4b6c2528d11dd5f89a6837fd071bcf4b 100755
2388+ index b132c7bf26c02886a7ab341a1973bf449744ba0f..757e3e60a7be01fac55c5fbb010dbbae00b1bfca 100755
23672389--- a/tools/install.py
23682390+++ b/tools/install.py
2369- @@ -284,6 +284,7 @@ def headers(options, action):
2391+ @@ -264,6 +264,7 @@ def headers(options, action):
2392+ 'include/v8-forward.h',
2393+ 'include/v8-function-callback.h',
2394+ 'include/v8-function.h',
2395+ + 'include/v8-handle-base.h',
2396+ 'include/v8-initialization.h',
2397+ 'include/v8-internal.h',
2398+ 'include/v8-isolate.h',
2399+ @@ -284,6 +285,8 @@ def headers(options, action):
23702400 'include/v8-promise.h',
23712401 'include/v8-proxy.h',
23722402 'include/v8-regexp.h',
23732403+ "include/v8-sandbox.h",
2404+ + "include/v8-source-location.h",
23742405 'include/v8-script.h',
23752406 'include/v8-snapshot.h',
23762407 'include/v8-statistics.h',
2377- @@ -390,7 +391 ,7 @@ def parse_options(args):
2408+ @@ -390,7 +393 ,7 @@ def parse_options(args):
23782409 parser.add_argument('--build-dir', help='the location of built binaries',
23792410 default='out/Release')
23802411 parser.add_argument('--v8-dir', help='the location of V8',
0 commit comments