build: add --without-amaro
build flag
PR-URL: https://github.com/nodejs/node/pull/54136 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
parent
2f7a354f14
commit
1e3a3470a5
@ -765,6 +765,12 @@ http2_optgroup.add_argument('--debug-nghttp2',
|
|||||||
default=None,
|
default=None,
|
||||||
help='build nghttp2 with DEBUGBUILD (default is false)')
|
help='build nghttp2 with DEBUGBUILD (default is false)')
|
||||||
|
|
||||||
|
parser.add_argument('--without-amaro',
|
||||||
|
action='store_true',
|
||||||
|
dest='without_amaro',
|
||||||
|
default=None,
|
||||||
|
help='do not install the bundled Amaro (TypeScript utils)')
|
||||||
|
|
||||||
parser.add_argument('--without-npm',
|
parser.add_argument('--without-npm',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='without_npm',
|
dest='without_npm',
|
||||||
@ -1380,6 +1386,7 @@ def configure_node(o):
|
|||||||
o['variables']['node_prefix'] = options.prefix
|
o['variables']['node_prefix'] = options.prefix
|
||||||
o['variables']['node_install_npm'] = b(not options.without_npm)
|
o['variables']['node_install_npm'] = b(not options.without_npm)
|
||||||
o['variables']['node_install_corepack'] = b(not options.without_corepack)
|
o['variables']['node_install_corepack'] = b(not options.without_corepack)
|
||||||
|
o['variables']['node_use_amaro'] = b(not options.without_amaro)
|
||||||
o['variables']['debug_node'] = b(options.debug_node)
|
o['variables']['debug_node'] = b(options.debug_node)
|
||||||
o['default_configuration'] = 'Debug' if options.debug else 'Release'
|
o['default_configuration'] = 'Debug' if options.debug else 'Release'
|
||||||
o['variables']['error_on_warn'] = b(options.error_on_warn)
|
o['variables']['error_on_warn'] = b(options.error_on_warn)
|
||||||
|
7
node.gyp
7
node.gyp
@ -14,6 +14,7 @@
|
|||||||
'force_dynamic_crt%': 0,
|
'force_dynamic_crt%': 0,
|
||||||
'ossfuzz' : 'false',
|
'ossfuzz' : 'false',
|
||||||
'node_module_version%': '',
|
'node_module_version%': '',
|
||||||
|
'node_use_amaro%': 'true',
|
||||||
'node_shared_brotli%': 'false',
|
'node_shared_brotli%': 'false',
|
||||||
'node_shared_zlib%': 'false',
|
'node_shared_zlib%': 'false',
|
||||||
'node_shared_http_parser%': 'false',
|
'node_shared_http_parser%': 'false',
|
||||||
@ -56,7 +57,6 @@
|
|||||||
'deps/acorn/acorn/dist/acorn.js',
|
'deps/acorn/acorn/dist/acorn.js',
|
||||||
'deps/acorn/acorn-walk/dist/walk.js',
|
'deps/acorn/acorn-walk/dist/walk.js',
|
||||||
'deps/minimatch/index.js',
|
'deps/minimatch/index.js',
|
||||||
'deps/amaro/dist/index.js',
|
|
||||||
'<@(node_builtin_shareable_builtins)',
|
'<@(node_builtin_shareable_builtins)',
|
||||||
],
|
],
|
||||||
'node_sources': [
|
'node_sources': [
|
||||||
@ -461,6 +461,11 @@
|
|||||||
}, {
|
}, {
|
||||||
'use_openssl_def%': 0,
|
'use_openssl_def%': 0,
|
||||||
}],
|
}],
|
||||||
|
[ 'node_use_amaro=="true"', {
|
||||||
|
'deps_files': [
|
||||||
|
'deps/amaro/dist/index.js',
|
||||||
|
]
|
||||||
|
} ]
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -412,5 +412,10 @@
|
|||||||
}, {
|
}, {
|
||||||
'defines': [ 'HAVE_OPENSSL=0' ]
|
'defines': [ 'HAVE_OPENSSL=0' ]
|
||||||
}],
|
}],
|
||||||
|
[ 'node_use_amaro=="true"', {
|
||||||
|
'defines': [ 'HAVE_AMARO=1' ],
|
||||||
|
}, {
|
||||||
|
'defines': [ 'HAVE_AMARO=0' ]
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,10 @@ Metadata::Versions::Versions() {
|
|||||||
acorn = ACORN_VERSION;
|
acorn = ACORN_VERSION;
|
||||||
cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
|
cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
|
||||||
uvwasi = UVWASI_VERSION_STRING;
|
uvwasi = UVWASI_VERSION_STRING;
|
||||||
|
|
||||||
|
#if HAVE_AMARO
|
||||||
amaro = AMARO_VERSION;
|
amaro = AMARO_VERSION;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_OPENSSL
|
#if HAVE_OPENSSL
|
||||||
openssl = GetOpenSSLVersion();
|
openssl = GetOpenSSLVersion();
|
||||||
|
@ -27,6 +27,12 @@ namespace node {
|
|||||||
#define NODE_HAS_RELEASE_URLS
|
#define NODE_HAS_RELEASE_URLS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_AMARO
|
||||||
|
#define NODE_VERSIONS_KEY_AMARO(V) V(amaro)
|
||||||
|
#else
|
||||||
|
#define NODE_VERSIONS_KEY_AMARO(V)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH
|
#ifndef NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH
|
||||||
#define NODE_VERSIONS_KEY_UNDICI(V) V(undici)
|
#define NODE_VERSIONS_KEY_UNDICI(V) V(undici)
|
||||||
#else
|
#else
|
||||||
@ -51,7 +57,7 @@ namespace node {
|
|||||||
V(sqlite) \
|
V(sqlite) \
|
||||||
V(ada) \
|
V(ada) \
|
||||||
V(nbytes) \
|
V(nbytes) \
|
||||||
V(amaro) \
|
NODE_VERSIONS_KEY_AMARO(V) \
|
||||||
NODE_VERSIONS_KEY_UNDICI(V) \
|
NODE_VERSIONS_KEY_UNDICI(V) \
|
||||||
V(cjs_module_lexer)
|
V(cjs_module_lexer)
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { spawnPromisified } from '../common/index.mjs';
|
import { skip, spawnPromisified } from '../common/index.mjs';
|
||||||
import * as fixtures from '../common/fixtures.mjs';
|
import * as fixtures from '../common/fixtures.mjs';
|
||||||
import { match, strictEqual } from 'node:assert';
|
import { match, strictEqual } from 'node:assert';
|
||||||
import { test } from 'node:test';
|
import { test } from 'node:test';
|
||||||
|
|
||||||
|
if (!process.config.variables.node_use_amaro) skip('Requires Amaro');
|
||||||
|
|
||||||
test('require a .ts file with explicit extension succeeds', async () => {
|
test('require a .ts file with explicit extension succeeds', async () => {
|
||||||
const result = await spawnPromisified(process.execPath, [
|
const result = await spawnPromisified(process.execPath, [
|
||||||
'--experimental-strip-types',
|
'--experimental-strip-types',
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { spawnPromisified } from '../common/index.mjs';
|
import { skip, spawnPromisified } from '../common/index.mjs';
|
||||||
import { match, strictEqual } from 'node:assert';
|
import { match, strictEqual } from 'node:assert';
|
||||||
import { test } from 'node:test';
|
import { test } from 'node:test';
|
||||||
|
|
||||||
|
if (!process.config.variables.node_use_amaro) skip('Requires Amaro');
|
||||||
|
|
||||||
test('eval TypeScript ESM syntax', async () => {
|
test('eval TypeScript ESM syntax', async () => {
|
||||||
const result = await spawnPromisified(process.execPath, [
|
const result = await spawnPromisified(process.execPath, [
|
||||||
'--input-type=module',
|
'--input-type=module',
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { spawnPromisified } from '../common/index.mjs';
|
import { skip, spawnPromisified } from '../common/index.mjs';
|
||||||
import * as fixtures from '../common/fixtures.mjs';
|
import * as fixtures from '../common/fixtures.mjs';
|
||||||
import { match, strictEqual } from 'node:assert';
|
import { match, strictEqual } from 'node:assert';
|
||||||
import { test } from 'node:test';
|
import { test } from 'node:test';
|
||||||
|
|
||||||
|
if (!process.config.variables.node_use_amaro) skip('Requires Amaro');
|
||||||
|
|
||||||
test('expect failure of a .mts file with CommonJS syntax', async () => {
|
test('expect failure of a .mts file with CommonJS syntax', async () => {
|
||||||
const result = await spawnPromisified(process.execPath, [
|
const result = await spawnPromisified(process.execPath, [
|
||||||
'--experimental-strip-types',
|
'--experimental-strip-types',
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { spawnPromisified } from '../common/index.mjs';
|
import { skip, spawnPromisified } from '../common/index.mjs';
|
||||||
import * as fixtures from '../common/fixtures.mjs';
|
import * as fixtures from '../common/fixtures.mjs';
|
||||||
import { match, strictEqual } from 'node:assert';
|
import { match, strictEqual } from 'node:assert';
|
||||||
import { test } from 'node:test';
|
import { test } from 'node:test';
|
||||||
|
|
||||||
|
if (!process.config.variables.node_use_amaro) skip('Requires Amaro');
|
||||||
|
|
||||||
test('execute a TypeScript file', async () => {
|
test('execute a TypeScript file', async () => {
|
||||||
const result = await spawnPromisified(process.execPath, [
|
const result = await spawnPromisified(process.execPath, [
|
||||||
'--experimental-strip-types',
|
'--experimental-strip-types',
|
||||||
|
@ -24,11 +24,13 @@ const expected_keys = [
|
|||||||
'ada',
|
'ada',
|
||||||
'cjs_module_lexer',
|
'cjs_module_lexer',
|
||||||
'nbytes',
|
'nbytes',
|
||||||
'amaro',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasUndici = process.config.variables.node_builtin_shareable_builtins.includes('deps/undici/undici.js');
|
const hasUndici = process.config.variables.node_builtin_shareable_builtins.includes('deps/undici/undici.js');
|
||||||
|
|
||||||
|
if (process.config.variables.node_use_amaro) {
|
||||||
|
expected_keys.push('amaro');
|
||||||
|
}
|
||||||
if (hasUndici) {
|
if (hasUndici) {
|
||||||
expected_keys.push('undici');
|
expected_keys.push('undici');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user