Skip to content

Commit 609fc75

Browse files
committed
build: do not build mksnapshot and mkcodecache for --shared
To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with src/node_snapshot_stub.cc and src/node_code_cache_stub.cc. Each of them write a C++ file to disk when being run. We then use the generated C++ files & libnode (with unresolved symbols) to build the final Node executable. However, if libnode itself is the final product, then we should not build it with unresolved symbols. nodejs#28897 added the two stubs for the libnode target when the --shared configure option is used, but it did not get rid of the actions to build and run mksnapshot and mkcodecache for --shared, so I think to get it working we also need a patch to make sure --shared imply --without-node-code-cache and --without-node-snapshot, until we actually fix the TODO so that mksnapshot and mkcodecache do not use the libnode that way.
1 parent f593a94 commit 609fc75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,13 +981,13 @@ def configure_node(o):
981981
o['variables']['want_separate_host_toolset'] = int(cross_compiling)
982982

983983
if not options.without_node_snapshot:
984-
o['variables']['node_use_node_snapshot'] = b(not cross_compiling)
984+
o['variables']['node_use_node_snapshot'] = b(not cross_compiling and not options.shared)
985985
else:
986986
o['variables']['node_use_node_snapshot'] = 'false'
987987

988988
if not options.without_node_code_cache:
989989
# TODO(refack): fix this when implementing embedded code-cache when cross-compiling.
990-
o['variables']['node_use_node_code_cache'] = b(not cross_compiling)
990+
o['variables']['node_use_node_code_cache'] = b(not cross_compiling and not options.shared)
991991
else:
992992
o['variables']['node_use_node_code_cache'] = 'false'
993993

0 commit comments

Comments
 (0)