mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
- Pin GNU runtime packs to glibc 2.36 Zig targets and reject incompatible imports. - Provision verified Zig builds and exercise published artifacts on Debian Bookworm. Fixes #349 Co-authored-by: Cruel <383999+Cruel@users.noreply.github.com>
25 lines
786 B
TypeScript
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.36"],
|
|
["arm64", "aarch64-linux-gnu.2.36"],
|
|
])("pins the %s GNU runtime to its glibc floor", (architecture, target) => {
|
|
expect(glibcRuntimeToolchain(architecture)).toEqual({
|
|
minimumOs: "glibc 2.36",
|
|
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",
|
|
);
|
|
});
|