Leave SC6101 out of the native compiler's self-builds

The compiler's own source has 24 likely-hot functions that use untyped
values, so its self-builds now print SC6101. The native bootstrap
contracts compare stderr exactly; the rebuilds of the compiler entry pass
--no-dynamic-tier-warning, which changes no IR or LLVM output.
This commit is contained in:
Chris Tate
2026-10-21 20:35:09 -05:00
parent ec370196e0
commit 3b7f33c223
@@ -185,6 +185,10 @@ test(
return result.stdout;
};
const entry = join(root, "packages/compiler/src/native/cli.ts");
// The compiler's own source has untyped functions that SC6101 reports
// (diagnostics/dynamic-tier.ts). The contracts compare stderr exactly,
// so its self-builds leave that performance note out.
const quiet = "--no-dynamic-tier-warning";
const ffi = join(directory, ".scriptc/distribution-seed/compiler.ffi.json");
const rebuilt = executable("scriptc-rebuilt");
const checkProgram = async (compiler: string, source: string, extra: string[] = []) => {
@@ -541,7 +545,18 @@ test(
const self = await bootstrapStep("production CLI rebuilds itself", () =>
invoke(
seed,
["build", entry, "-o", rebuilt, "--strip", "--keep-llvm", "--emit-ir", "--ffi", ffi],
[
"build",
entry,
"-o",
rebuilt,
"--strip",
"--keep-llvm",
"--emit-ir",
"--ffi",
ffi,
quiet,
],
"scriptc: warning: --emit-ir is deprecated; use --emit=ir for IR as the primary output\n",
),
);
@@ -554,7 +569,16 @@ test(
const seedLlvm = join(directory, "cli.ll");
const rebuiltLlvm = join(directory, "rebuilt.ll");
await bootstrapStep("rebuilt compiler emits itself", () =>
invoke(rebuilt, ["build", entry, "--emit=llvm", "-o", rebuiltLlvm, "--ffi", ffi]),
invoke(rebuilt, [
"build",
entry,
"--emit=llvm",
"-o",
rebuiltLlvm,
"--ffi",
ffi,
quiet,
]),
);
// Executable output adds a runtime ABI check; textual LLVM emission
// omits it. Compare all other output without changing either mode.
@@ -585,7 +609,7 @@ test(
const rebuildFrontend = async () => {
const lowered = join(directory, "cli.ir.json");
const output = await bootstrapStep("sanitized native frontend lowers the compiler", () =>
invoke(seed, ["build", entry, "--emit=ir", "-o", lowered, "--ffi", ffi]),
invoke(seed, ["build", entry, "--emit=ir", "-o", lowered, "--ffi", ffi, quiet]),
);
expect(output.trim()).toBe(lowered);
await compareArtifacts({ ir: true, llvm: false });
@@ -605,6 +629,7 @@ test(
ffi,
"--sanitize",
"--optimization=dev",
quiet,
],
"",
{ SCRIPTC_BOOTSTRAP_IR_INPUT: seedIr },