mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-04 09:28:24 +08:00
* Expand LLVM native output targets - Add owned helper and runtime-pack contracts for macOS x64, Linux glibc/musl, Windows x64, and WASI. - Generalize LLVM target selection, package validation, linker plans, and release/CI matrices. - Document linker boundaries and add focused native-output and runtime-pack coverage. * Pin Windows LLVM helper CI to VS 2022 The official LLVM archive needs the Visual Studio 2022 CMake generator, which is not guaranteed by windows-latest. * Align bootstrap cache with LLVM runtime-pack builds Use the same target-specific helper and linker identity before and after compiler loading so routed executable cache hits remain lightweight. * Install Windows LLVM CI tools with Chocolatey windows-2022 includes Visual Studio but not winget; use its available Chocolatey bootstrap for CMake and Ninja. * Prevent Zig version probes from leaving runtime-pack objects Run runtime-pack compiler version probes in a private temporary directory and remove the accidental tracked WASI a.o file. * Use 7-Zip for Windows LLVM setup Extract the official LLVM development archive with two-stage 7-Zip instead of Windows tar.exe, which timed out while materializing the toolchain tree. * Define ssize_t for the MSVC runtime pack Clang's MSVC target does not expose POSIX ssize_t through sys/types.h; define the pointer-sized runtime type without affecting MinGW. * Build the Windows runtime pack with Zig Use the MinGW-compatible Windows sysroot required by the runtime while retaining COFF helper output and installing Zig in the Windows native CI lane. * Give macOS LLVM differential shard time to finish Shard 1 passed its setup and focused contracts but was cancelled during its cold LLVM differential slice at the 20-minute job limit.
18 lines
1.3 KiB
JavaScript
18 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
import { createHash } from "node:crypto";
|
|
import { access, readFile } from "node:fs/promises";
|
|
import { join } from "node:path";
|
|
|
|
const root = process.env.SCRIPTC_RUNTIME_PACK_ROOT;
|
|
if (!root) throw new Error("runtime-pack verification requires package wrapper configuration");
|
|
const manifest = JSON.parse(await readFile(join(root, "runtime-pack.json"), "utf8"));
|
|
const packageManifest = JSON.parse(await readFile(join(root, "package.json"), "utf8"));
|
|
if (manifest.schema !== "scriptc.runtime-pack.v1" || manifest.format !== 1 || manifest.package !== packageManifest.name || manifest.version !== packageManifest.version) throw new Error("runtime pack identity does not match package.json");
|
|
const artifacts = [...Object.values(manifest.flavors).flatMap((flavor) => flavor.runtime_units.flatMap((unit) => unit.variants)), ...manifest.archives];
|
|
for (const artifact of artifacts) {
|
|
const bytes = await readFile(join(root, artifact.path));
|
|
if (bytes.length !== artifact.size || createHash("sha256").update(bytes).digest("hex") !== artifact.sha256) throw new Error(`runtime pack hash mismatch: ${artifact.path}`);
|
|
}
|
|
for (const license of manifest.licenses) await access(join(root, license.path));
|
|
process.stdout.write(`verified ${manifest.package}@${manifest.version}: ${artifacts.length} artifacts\n`);
|