File: builtins_module_paths_not_shareable.patch

package info (click to toggle)
nodejs 22.21.1%2Bdfsg%2B~cs22.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 251,924 kB
  • sloc: cpp: 1,542,927; javascript: 597,777; ansic: 114,330; python: 60,784; sh: 4,155; makefile: 2,914; asm: 1,750; pascal: 1,565; perl: 248; lisp: 222; xml: 42
file content (24 lines) | stat: -rw-r--r-- 854 bytes parent folder | download | duplicates (2)
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
@@ -35,6 +35,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",
@@ -76,6 +77,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
 }
 
 bool BuiltinLoader::Exists(const char* id) {