Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: allow amaro to be externalizable #54646

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
icu_versions = json.loads((tools_path / 'icu' / 'icu_versions.json').read_text(encoding='utf-8'))
maglev_enabled_architectures = ('x64', 'arm', 'arm64')

# builtins may be removed later if they have been disabled by options
shareable_builtins = {'cjs_module_lexer/lexer': 'deps/cjs-module-lexer/lexer.js',
'cjs_module_lexer/dist/lexer': 'deps/cjs-module-lexer/dist/lexer.js',
'undici/undici': 'deps/undici/undici.js'
'undici/undici': 'deps/undici/undici.js',
'amaro/dist/index': 'deps/amaro/dist/index.js'
}

# create option groups
Expand Down Expand Up @@ -2202,6 +2204,10 @@ def make_bin_override():
configure_inspector(output)
configure_section_file(output)

# remove builtins that have been disabled
if options.without_amaro:
del shareable_builtins['amaro/dist/index']

# configure shareable builtins
output['variables']['node_builtin_shareable_builtins'] = []
for builtin, value in shareable_builtins.items():
Expand Down
1 change: 1 addition & 0 deletions node.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ declare_args() {
"deps/cjs-module-lexer/lexer.js",
"deps/cjs-module-lexer/dist/lexer.js",
"deps/undici/undici.js",
"deps/amaro/dist/index.js",
]
}

Expand Down
5 changes: 0 additions & 5 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,6 @@
}, {
'use_openssl_def%': 0,
}],
[ 'node_use_amaro=="true"', {
'deps_files': [
'deps/amaro/dist/index.js',
]
} ]
],
},

Expand Down
7 changes: 7 additions & 0 deletions src/node_builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ BuiltinLoader::BuiltinLoader()
AddExternalizedBuiltin("internal/deps/undici/undici",
STRINGIFY(NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH));
#endif // NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH

#if HAVE_AMARO
#ifdef NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH
AddExternalizedBuiltin("internal/deps/amaro/dist/index",
STRINGIFY(NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH));
#endif // NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH
#endif // NODE_USE_ARARO
mhdawson marked this conversation as resolved.
Show resolved Hide resolved
}

bool BuiltinLoader::Exists(const char* id) {
Expand Down
Loading