Skip to content

Commit 19e2a9c

Browse files
panvaaduh95
authored andcommitted
build: fix --node-builtin-modules-path
PR-URL: #62115 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent e476d9d commit 19e2a9c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

node.gyp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,13 @@
926926
},
927927
}],
928928
[ 'node_builtin_modules_path!=""', {
929-
'defines': [ 'NODE_BUILTIN_MODULES_PATH="<(node_builtin_modules_path)"' ]
929+
'defines': [ 'NODE_BUILTIN_MODULES_PATH="<(node_builtin_modules_path)"' ],
930+
# When loading builtins from disk, JS source files do not need to
931+
# trigger rebuilds since the binary reads them at runtime.
932+
'sources!': [
933+
'<@(library_files)',
934+
'<@(deps_files)',
935+
],
930936
}],
931937
[ 'node_shared=="true"', {
932938
'sources': [
@@ -1071,6 +1077,16 @@
10711077
'<@(deps_files)',
10721078
'config.gypi'
10731079
],
1080+
'conditions': [
1081+
[ 'node_builtin_modules_path!=""', {
1082+
# When loading builtins from disk, JS source files do not need
1083+
# to trigger rebuilds since the binary reads them at runtime.
1084+
'inputs!': [
1085+
'<@(library_files)',
1086+
'<@(deps_files)',
1087+
],
1088+
}],
1089+
],
10741090
'outputs': [
10751091
'<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
10761092
],

src/node_builtins.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const BuiltinSource* BuiltinLoader::AddFromDisk(const char* id,
7373
const std::string& filename,
7474
const UnionBytes& source) {
7575
BuiltinSourceType type = GetBuiltinSourceType(id, filename);
76-
auto result = source_.write()->emplace(id, BuiltinSource{id, source, type});
76+
auto result = source_.write()->insert_or_assign(id, BuiltinSource{id, source, type});
7777
return &(result.first->second);
7878
}
7979

0 commit comments

Comments
 (0)