GeezerVison is showing github.com — deps: allow amaro to be externalizable · nodejs/node@0659516
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: configure.py +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 57 | 57 | valid_intl_modes = ('none', 'small-icu', 'full-icu', 'system-icu') | 58 | 58 | icu_versions = json.loads((tools_path / 'icu' / 'icu_versions.json').read_text(encoding='utf-8')) | 59 | 59 |
| | 60 | +# builtins may be removed later if they have been disabled by options | 60 | 61 | shareable_builtins = {'cjs_module_lexer/lexer': 'deps/cjs-module-lexer/lexer.js', | 61 | 62 | 'cjs_module_lexer/dist/lexer': 'deps/cjs-module-lexer/dist/lexer.js', | 62 | | - 'undici/undici': 'deps/undici/undici.js' | | 63 | + 'undici/undici': 'deps/undici/undici.js', | | 64 | + 'amaro/dist/index': 'deps/amaro/dist/index.js' | 63 | 65 | } | 64 | 66 |
| 65 | 67 | # create option groups | @@ -2199,6 +2201,10 @@ def make_bin_override(): | 2199 | 2201 | configure_inspector(output) | 2200 | 2202 | configure_section_file(output) | 2201 | 2203 |
| | 2204 | +# remove builtins that have been disabled | | 2205 | +if options.without_amaro: | | 2206 | + del shareable_builtins['amaro/dist/index'] | | 2207 | + | 2202 | 2208 | # configure shareable builtins | 2203 | 2209 | output['variables']['node_builtin_shareable_builtins'] = [] | 2204 | 2210 | for builtin, value in shareable_builtins.items(): | |
Collapse file Copy file name to clipboardExpand all lines: node.gni +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,6 +20,7 @@ declare_args() { | 20 | 20 | "deps/cjs-module-lexer/lexer.js", | 21 | 21 | "deps/cjs-module-lexer/dist/lexer.js", | 22 | 22 | "deps/undici/undici.js", | | 23 | + "deps/amaro/dist/index.js", | 23 | 24 | ] | 24 | 25 | } | 25 | 26 |
| |
Collapse file Copy file name to clipboardExpand all lines: node.gyp -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 465 | 465 | }, { | 466 | 466 | 'use_openssl_def%': 0, | 467 | 467 | }], | 468 | | - [ 'node_use_amaro=="true"', { | 469 | | - 'deps_files': [ | 470 | | - 'deps/amaro/dist/index.js', | 471 | | - ] | 472 | | - } ] | 473 | 468 | ], | 474 | 469 | }, | 475 | 470 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/node_builtins.cc +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -50,6 +50,13 @@ BuiltinLoader::BuiltinLoader() | 50 | 50 | AddExternalizedBuiltin("internal/deps/undici/undici", | 51 | 51 | STRINGIFY(NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH)); | 52 | 52 | #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 | 53 | 60 | } | 54 | 61 |
| 55 | 62 | bool BuiltinLoader::Exists(const char* id) { | |
Collapse file Copy file name to clipboardExpand all lines: src/node_metadata.cc +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -127,9 +127,11 @@ Metadata::Versions::Versions() { | 127 | 127 | cjs_module_lexer = CJS_MODULE_LEXER_VERSION; | 128 | 128 | uvwasi = UVWASI_VERSION_STRING; | 129 | 129 |
| | 130 | +#ifndef NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH | 130 | 131 | #if HAVE_AMARO | 131 | 132 | amaro = AMARO_VERSION; | 132 | 133 | #endif | | 134 | +#endif | 133 | 135 |
| 134 | 136 | #if HAVE_OPENSSL | 135 | 137 | openssl = GetOpenSSLVersion(); | |
Collapse file Copy file name to clipboardExpand all lines: src/node_metadata.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ namespace node { | 27 | 27 | #define NODE_HAS_RELEASE_URLS | 28 | 28 | #endif | 29 | 29 |
| 30 | | -#if HAVE_AMARO | | 30 | +#if HAVE_AMARO && !defined(NODE_SHARED_BUILTIN_AMARO_DIST_INDEX_PATH) | 31 | 31 | #define NODE_VERSIONS_KEY_AMARO(V) V(amaro) | 32 | 32 | #else | 33 | 33 | #define NODE_VERSIONS_KEY_AMARO(V) | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-process-versions.js +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,9 +27,12 @@ const expected_keys = [ | 27 | 27 | ]; | 28 | 28 |
| 29 | 29 | const 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'); | 30 | 31 |
| 31 | 32 | if (process.config.variables.node_use_amaro) { | 32 | | - expected_keys.push('amaro'); | | 33 | + if (hasAmaro) { | | 34 | + expected_keys.push('amaro'); | | 35 | + } | 33 | 36 | } | 34 | 37 | if (hasUndici) { | 35 | 38 | expected_keys.push('undici'); | |
|