diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2022-03-24 16:37:08 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2022-03-31 14:29:12 +0300 |
commit | 37aee80643822c8c9ff35c906d034ecc8fc448d5 (patch) | |
tree | 65a9107f2ed3b7e4cdaf38936a1df65ccd25a587 /configure.py | |
parent | 8a297ba3a0aa39afb7c84fceee4accff609b7cfe (diff) |
build: add --node-snapshot-main configure option
This adds a --build-snapshot runtime option which is currently only
supported by the node_mksnapshot binary, and a --node-snapshot-main
configure option that makes use it to run a custom script when
building the embedded snapshot. The idea is to have this experimental
feature in core as a configure-time feature for now, and investigate
the renaming V8 bugs before we make it available to more users via
making it a runtime option.
PR-URL: https://github.com/nodejs/node/pull/42466
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.py b/configure.py index 8f74784cc0c..8bae2df6405 100755 --- a/configure.py +++ b/configure.py @@ -788,6 +788,13 @@ parser.add_argument('--node-builtin-modules-path', default=False, help='node will load builtin modules from disk instead of from binary') +parser.add_argument('--node-snapshot-main', + action='store', + dest='node_snapshot_main', + default=None, + help='Run a file when building the embedded snapshot. Currently ' + + 'experimental.') + # Create compile_commands.json in out/Debug and out/Release. parser.add_argument('-C', action='store_true', @@ -1216,6 +1223,18 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) + if options.node_snapshot_main is not None: + if options.shared: + # This should be possible to fix, but we will need to refactor the + # libnode target to avoid building it twice. + error('--node-snapshot-main is incompatible with --shared') + if options.without_node_snapshot: + error('--node-snapshot-main is incompatible with ' + + '--without-node-snapshot') + if cross_compiling: + error('--node-snapshot-main is incompatible with cross compilation') + o['variables']['node_snapshot_main'] = options.node_snapshot_main + if options.without_node_snapshot or options.node_builtin_modules_path: o['variables']['node_use_node_snapshot'] = 'false' else: |