Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 78c46c5

Browse files
joyeecheungtargos
authored andcommittedJan 14, 2020
build: add --without-node-code-cache configure option
So that it's possible to build without code cache (in particular, without building mkcodecache) for testing. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b6ce736 commit 78c46c5

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed
 

‎configure.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,11 @@
453453
dest='without_node_snapshot',
454454
help='Turn off V8 snapshot integration. Currently experimental.')
455455

456+
parser.add_option('--without-node-code-cache',
457+
action='store_true',
458+
dest='without_node_code_cache',
459+
help='Turn off V8 Code cache integration.')
460+
456461
intl_optgroup.add_option('--download',
457462
action='store',
458463
dest='download_list',
@@ -978,6 +983,12 @@ def configure_node(o):
978983
else:
979984
o['variables']['node_use_node_snapshot'] = 'false'
980985

986+
if not options.without_node_code_cache:
987+
# TODO(refack): fix this when implementing embedded code-cache when cross-compiling.
988+
o['variables']['node_use_node_code_cache'] = b(not cross_compiling)
989+
else:
990+
o['variables']['node_use_node_code_cache'] = 'false'
991+
981992
if target_arch == 'arm':
982993
configure_arm(o)
983994
elif target_arch in ('mips', 'mipsel', 'mips64el'):
@@ -1083,9 +1094,7 @@ def configure_node(o):
10831094
o['variables']['debug_nghttp2'] = 'false'
10841095

10851096
o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
1086-
# TODO(refack): fix this when implementing embedded code-cache when cross-compiling.
1087-
if o['variables']['want_separate_host_toolset'] == 0:
1088-
o['variables']['node_code_cache'] = 'yes' # For testing
1097+
10891098
o['variables']['node_shared'] = b(options.shared)
10901099
node_module_version = getmoduleversion.get_version()
10911100

‎node.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
},
437437
},
438438
}],
439-
['want_separate_host_toolset==0', {
439+
['node_use_node_code_cache=="true"', {
440440
'dependencies': [
441441
'mkcodecache',
442442
],

‎test/parallel/test-code-cache.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const loadedModules = process.moduleLoadList
3333
// are all compiled without cache and we are doing the bookkeeping right.
3434
if (!process.features.cached_builtins) {
3535
console.log('The binary is not configured with code cache');
36+
assert(!process.config.variables.node_use_node_code_cache);
37+
3638
if (isMainThread) {
3739
assert.deepStrictEqual(compiledWithCache, new Set());
3840
for (const key of loadedModules) {
@@ -46,10 +48,7 @@ if (!process.features.cached_builtins) {
4648
assert.notDeepStrictEqual(compiledWithCache, new Set());
4749
}
4850
} else { // Native compiled
49-
assert.strictEqual(
50-
process.config.variables.node_code_cache,
51-
'yes'
52-
);
51+
assert(process.config.variables.node_use_node_code_cache);
5352

5453
if (!isMainThread) {
5554
for (const key of [ 'internal/bootstrap/pre_execution' ]) {

0 commit comments

Comments
 (0)
Please sign in to comment.