|
1169 | 1169 | default=False, |
1170 | 1170 | help='node will load builtin modules from disk instead of from binary') |
1171 | 1171 |
|
| 1172 | +parser.add_argument('--output-transpiled-ts', |
| 1173 | + action='store', |
| 1174 | + dest='output_transpiled_ts', |
| 1175 | + default='', |
| 1176 | + help='write transpiled TypeScript output to the given directory for debugging') |
| 1177 | + |
1172 | 1178 | parser.add_argument('--node-snapshot-main', |
1173 | 1179 | action='store', |
1174 | 1180 | dest='node_snapshot_main', |
@@ -1535,23 +1541,24 @@ def check_compiler(o): |
1535 | 1541 |
|
1536 | 1542 | o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0' |
1537 | 1543 |
|
1538 | | - # cargo and rustc are needed for Temporal. |
1539 | | - if options.v8_enable_temporal_support and not options.shared_temporal_capi: |
1540 | | - # Minimum cargo and rustc versions should match values in BUILDING.md. |
1541 | | - min_cargo_ver_tuple = (1, 82) |
1542 | | - min_rustc_ver_tuple = (1, 82) |
1543 | | - cargo_ver = get_cargo_version('cargo') |
1544 | | - print_verbose(f'Detected cargo: {cargo_ver}') |
1545 | | - cargo_ver_tuple = tuple(map(int, cargo_ver.split('.'))) |
1546 | | - if cargo_ver_tuple < min_cargo_ver_tuple: |
1547 | | - warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}') |
1548 | | - # cargo supports RUSTC environment variable to override "rustc". |
1549 | | - rustc = os.environ.get('RUSTC', 'rustc') |
1550 | | - rustc_ver = get_rustc_version(rustc) |
1551 | | - print_verbose(f'Detected rustc (RUSTC={rustc}): {rustc_ver}') |
1552 | | - rust_ver_tuple = tuple(map(int, rustc_ver.split('.'))) |
1553 | | - if rust_ver_tuple < min_rustc_ver_tuple: |
1554 | | - warn(f'rustc {rustc_ver} too old, need rustc {".".join(map(str, min_rustc_ver_tuple))}') |
| 1544 | + # cargo and rustc are always required: |
| 1545 | + # - SWC (deps/crates) is used by js2c to transpile TypeScript builtins. |
| 1546 | + # - Temporal (when enabled) also builds from deps/crates. |
| 1547 | + # Minimum cargo and rustc versions should match values in BUILDING.md. |
| 1548 | + min_cargo_ver_tuple = (1, 85) |
| 1549 | + min_rustc_ver_tuple = (1, 85) |
| 1550 | + cargo_ver = get_cargo_version('cargo') |
| 1551 | + print_verbose(f'Detected cargo: {cargo_ver}') |
| 1552 | + cargo_ver_tuple = tuple(map(int, cargo_ver.split('.'))) |
| 1553 | + if cargo_ver_tuple < min_cargo_ver_tuple: |
| 1554 | + warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}') |
| 1555 | + # cargo supports RUSTC environment variable to override "rustc". |
| 1556 | + rustc = os.environ.get('RUSTC', 'rustc') |
| 1557 | + rustc_ver = get_rustc_version(rustc) |
| 1558 | + print_verbose(f'Detected rustc (RUSTC={rustc}): {rustc_ver}') |
| 1559 | + rust_ver_tuple = tuple(map(int, rustc_ver.split('.'))) |
| 1560 | + if rust_ver_tuple < min_rustc_ver_tuple: |
| 1561 | + warn(f'rustc {rustc_ver} too old, need rustc {".".join(map(str, min_rustc_ver_tuple))}') |
1555 | 1562 |
|
1556 | 1563 | # Need xcode_version or gas_version when openssl asm files are compiled. |
1557 | 1564 | if options.without_ssl or options.openssl_no_asm or options.shared_openssl: |
@@ -1737,7 +1744,7 @@ def gcc_version_ge(version_checked): |
1737 | 1744 | return True |
1738 | 1745 |
|
1739 | 1746 | def configure_node_lib_files(o): |
1740 | | - o['variables']['node_library_files'] = SearchFiles('lib', 'js') |
| 1747 | + o['variables']['node_library_files'] = SearchFiles('lib', 'js') + SearchFiles('lib', 'ts') |
1741 | 1748 |
|
1742 | 1749 | def configure_node_cctest_sources(o): |
1743 | 1750 | o['variables']['node_cctest_sources'] = [ 'src/node_snapshot_stub.cc' ] + \ |
@@ -1976,6 +1983,11 @@ def configure_node(o): |
1976 | 1983 | print('Warning! Loading builtin modules from disk is for development') |
1977 | 1984 | o['variables']['node_builtin_modules_path'] = options.node_builtin_modules_path |
1978 | 1985 |
|
| 1986 | + if options.output_transpiled_ts: |
| 1987 | + o['variables']['output_transpiled_ts'] = os.path.abspath(options.output_transpiled_ts) |
| 1988 | + else: |
| 1989 | + o['variables']['output_transpiled_ts'] = '' |
| 1990 | + |
1979 | 1991 | def configure_napi(output): |
1980 | 1992 | version = getnapibuildversion.get_napi_version() |
1981 | 1993 | output['variables']['napi_build_version'] = version |
|
0 commit comments