Compare commits

...

1 Commits

Author SHA1 Message Date
Shelley Vohr
e9717b89f3 fix: pass root_gen_dir from GN to generate_node_headers.py
PR #50828 replaced a local get_out_dir() (defaulting to 'Testing') with
the shared one from script/lib/util.py (defaulting to 'Default').
Neither default is correct because the actual output directory depends
on the active build config. Pass $root_gen_dir from the GN action so
the script always uses the correct path.
2026-04-09 16:17:27 +02:00
2 changed files with 2 additions and 3 deletions

View File

@@ -1644,6 +1644,7 @@ action("node_version_header") {
action("generate_node_headers") {
deps = [ ":generate_config_gypi" ]
script = "script/node/generate_node_headers.py"
args = [ rebase_path("$root_gen_dir") ]
outputs = [ "$root_gen_dir/node_headers.json" ]
}

View File

@@ -8,9 +8,7 @@ from pathlib import Path
SRC_DIR = Path(__file__).resolve().parents[3]
sys.path.append(os.path.join(SRC_DIR, 'third_party/electron_node/tools'))
sys.path.append(str(Path(__file__).resolve().parents[1])) # electron/script/
from lib.util import get_out_dir
import install
class LoadPythonDictionaryError(Exception):
@@ -56,7 +54,7 @@ if __name__ == '__main__':
hs = {'files': sorted(files), 'dest_dir': dest_dir}
out['headers'].append(hs)
root_gen_dir = os.path.join(get_out_dir(), 'gen')
root_gen_dir = os.path.abspath(sys.argv[1])
config_gypi_path = os.path.join(root_gen_dir, 'config.gypi')
node_headers_dir = os.path.join(root_gen_dir, 'node_headers')