File: builtins_module_paths_not_shareable.patch

package info (click to toggle)
nodejs 24.11.1%2Bdfsg%2B~cs24.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 252,928 kB
  • sloc: cpp: 1,728,964; javascript: 473,397; ansic: 113,512; python: 60,329; sh: 4,344; makefile: 3,026; asm: 1,728; pascal: 1,562; perl: 494; lisp: 222; xml: 39
file content (24 lines) | stat: -rw-r--r-- 879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: disable shared builtins when loading deps on demand
 This is to avoid preloading potentially missing files.
Author: Jérémy Lal <kapouer@melix.org>
Last-Update: 2023-12-10
Forwarded: no, todo
--- a/src/node_builtins.cc
+++ b/src/node_builtins.cc
@@ -39,6 +39,7 @@
 BuiltinLoader::BuiltinLoader()
     : config_(GetConfig()), code_cache_(std::make_shared<BuiltinCodeCache>()) {
   LoadJavaScriptSource();
+#ifndef NODE_BUILTIN_MODULES_PATH
 #ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH
   AddExternalizedBuiltin(
       "internal/deps/cjs-module-lexer/lexer",
@@ -80,6 +81,8 @@
                          STRINGIFY(NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH));
 #endif  // NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH
 #endif  // HAVE_AMARO
+
+#endif  // NOT NODE_BUILTIN_MODULES_PATH
 }
 
 std::ranges::keys_view<std::ranges::ref_view<const BuiltinSourceMap>>