File tree Expand file tree Collapse file tree 7 files changed +22
-8
lines changed Expand file tree Collapse file tree 7 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 5858icu_versions = json .loads ((tools_path / 'icu' / 'icu_versions.json' ).read_text (encoding = 'utf-8' ))
5959maglev_enabled_architectures = ('x64' , 'arm' , 'arm64' )
6060
61+ # builtins may be removed later if they have been disabled by options
6162shareable_builtins = {'cjs_module_lexer/lexer' : 'deps/cjs-module-lexer/lexer.js' ,
6263 'cjs_module_lexer/dist/lexer' : 'deps/cjs-module-lexer/dist/lexer.js' ,
63- 'undici/undici' : 'deps/undici/undici.js'
64+ 'undici/undici' : 'deps/undici/undici.js' ,
65+ 'amaro/dist/index' : 'deps/amaro/dist/index.js'
6466}
6567
6668# create option groups
@@ -2202,6 +2204,10 @@ def make_bin_override():
22022204configure_inspector (output )
22032205configure_section_file (output )
22042206
2207+ # remove builtins that have been disabled
2208+ if options .without_amaro :
2209+ del shareable_builtins ['amaro/dist/index' ]
2210+
22052211# configure shareable builtins
22062212output ['variables' ]['node_builtin_shareable_builtins' ] = []
22072213for builtin , value in shareable_builtins .items ():
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ declare_args() {
2020 " deps/cjs-module-lexer/lexer.js" ,
2121 " deps/cjs-module-lexer/dist/lexer.js" ,
2222 " deps/undici/undici.js" ,
23+ " deps/amaro/dist/index.js" ,
2324 ]
2425}
2526
Original file line number Diff line number Diff line change 466466 }, {
467467 'use_openssl_def%' : 0 ,
468468 }],
469- [ 'node_use_amaro=="true"' , {
470- 'deps_files' : [
471- 'deps/amaro/dist/index.js' ,
472- ]
473- } ]
474469 ],
475470 },
476471
Original file line number Diff line number Diff line change @@ -50,6 +50,13 @@ BuiltinLoader::BuiltinLoader()
5050 AddExternalizedBuiltin (" internal/deps/undici/undici" ,
5151 STRINGIFY (NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH));
5252#endif // NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH
53+
54+ #if HAVE_AMARO
55+ #ifdef NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH
56+ AddExternalizedBuiltin (" internal/deps/amaro/dist/index" ,
57+ STRINGIFY (NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH));
58+ #endif // NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH
59+ #endif // HAVE_AMARO
5360}
5461
5562bool BuiltinLoader::Exists (const char * id) {
Original file line number Diff line number Diff line change @@ -127,9 +127,11 @@ Metadata::Versions::Versions() {
127127 cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
128128 uvwasi = UVWASI_VERSION_STRING;
129129
130+ #ifndef NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH
130131#if HAVE_AMARO
131132 amaro = AMARO_VERSION;
132133#endif
134+ #endif
133135
134136#if HAVE_OPENSSL
135137 openssl = GetOpenSSLVersion ();
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ namespace node {
2727#define NODE_HAS_RELEASE_URLS
2828#endif
2929
30- #if HAVE_AMARO
30+ #if HAVE_AMARO && !defined(NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH)
3131#define NODE_VERSIONS_KEY_AMARO (V ) V(amaro)
3232#else
3333#define NODE_VERSIONS_KEY_AMARO (V )
Original file line number Diff line number Diff line change @@ -27,9 +27,12 @@ const expected_keys = [
2727] ;
2828
2929const hasUndici = process . config . variables . node_builtin_shareable_builtins . includes ( 'deps/undici/undici.js' ) ;
30+ const hasAmaro = process . config . variables . node_builtin_shareable_builtins . includes ( 'deps/amaro/dist/index.js' ) ;
3031
3132if ( process . config . variables . node_use_amaro ) {
32- expected_keys . push ( 'amaro' ) ;
33+ if ( hasAmaro ) {
34+ expected_keys . push ( 'amaro' ) ;
35+ }
3336}
3437if ( hasUndici ) {
3538 expected_keys . push ( 'undici' ) ;
You can’t perform that action at this time.
0 commit comments