Files
scriptc/packages/runtime-pack-common/test/glibc-toolchain.test.ts
Chris Tate 0845c7ff56 Make native installs portable and smaller (#599)
* Make native installs portable and smaller

- Support glibc 2.34 with portable compiler binaries and static LLVM helpers.
- Bundle the host runtime and discover optional cross-target packs from project dependencies.
- Add application build benchmarks covering latency, executable size, and memory.

* Keep bootstrap tools available in Sandbox validation

- Isolate Zig for native compiler bootstrap and glibc entropy contracts.
- Preserve the existing toolchain scope for cache and corpus tests.

* Fix portable compiler bootstrap linking

- Keep native support objects compatible with the destination host linker.
- Resolve installed targets using the host declared by the toolchain manifest.
2026-10-01 10:46:16 -05:00

25 lines
786 B
TypeScript

import { expect, test } from "vitest";
import { glibcRuntimeToolchain } from "../scripts/glibc-toolchain.mjs";
test.each([
["x64", "x86_64-linux-gnu.2.34"],
["arm64", "aarch64-linux-gnu.2.34"],
])("pins the %s GNU runtime to its glibc floor", (architecture, target) => {
expect(glibcRuntimeToolchain(architecture)).toEqual({
minimumOs: "glibc 2.34",
compiler: "zig",
compilerArgs: ["cc"],
archiver: "zig",
archiverArgs: ["ar"],
targetArgs: ["-target", target],
compilerFlags: ["-fno-sanitize=undefined"],
forbiddenArtifactStrings: ["__isoc23_", "__ubsan_"],
});
});
test("rejects unknown GNU runtime architectures", () => {
expect(() => glibcRuntimeToolchain("riscv64")).toThrow(
"unsupported GNU runtime architecture: riscv64",
);
});