diff options
author | Gus Caplan <me@gus.host> | 2020-01-11 14:03:59 -0800 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2020-01-31 01:22:12 -0800 |
commit | 43fb6ffef7a14b47d1b0ba8134102795f5017a59 (patch) | |
tree | 97fdce82f51a763c2457dafb2bdbaee672a159da /configure.py | |
parent | a17131400360562f06fc4d1c217ee60f7c5928aa (diff) | |
download | node-new-43fb6ffef7a14b47d1b0ba8134102795f5017a59.tar.gz |
build: enable loading internal modules from disk
PR-URL: https://github.com/nodejs/node/pull/31321
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/configure.py b/configure.py index 682feb44e4..c5025c81eb 100755 --- a/configure.py +++ b/configure.py @@ -609,6 +609,12 @@ parser.add_option('--v8-non-optimized-debug', default=False, help='compile V8 with minimal optimizations and with runtime checks') +parser.add_option('--node-builtin-modules-path', + action='store', + dest='node_builtin_modules_path', + default=False, + help='node will load builtin modules from disk instead of from binary') + # Create compile_commands.json in out/Debug and out/Release. parser.add_option('-C', action='store_true', @@ -992,18 +998,18 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) - if not options.without_node_snapshot: + if options.without_node_snapshot or options.node_builtin_modules_path: + o['variables']['node_use_node_snapshot'] = 'false' + else: o['variables']['node_use_node_snapshot'] = b( not cross_compiling and not options.shared) - else: - o['variables']['node_use_node_snapshot'] = 'false' - if not options.without_node_code_cache: + if options.without_node_code_cache or options.node_builtin_modules_path: + o['variables']['node_use_node_code_cache'] = 'false' + else: # TODO(refack): fix this when implementing embedded code-cache when cross-compiling. o['variables']['node_use_node_code_cache'] = b( not cross_compiling and not options.shared) - else: - o['variables']['node_use_node_code_cache'] = 'false' if target_arch == 'arm': configure_arm(o) @@ -1145,6 +1151,10 @@ def configure_node(o): else: o['variables']['node_target_type'] = 'executable' + if options.node_builtin_modules_path: + print('Warning! Loading builtin modules from disk is for development') + o['variables']['node_builtin_modules_path'] = options.node_builtin_modules_path + def configure_napi(output): version = getnapibuildversion.get_napi_version() output['variables']['napi_build_version'] = version |