From 43fb6ffef7a14b47d1b0ba8134102795f5017a59 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sat, 11 Jan 2020 14:03:59 -0800 Subject: build: enable loading internal modules from disk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/31321 Reviewed-By: Anna Henningsen Reviewed-By: Tobias Nießen Reviewed-By: Joyee Cheung Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina --- configure.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'configure.py') 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 -- cgit v1.2.1