Files
scriptc/packages/libnode-linux-x64-gnu/scripts/build.mjs
T
Malte UblandClaude Opus 5.5 75aa8509f6 Assemble libnode packs with NI-1's build-pack.mjs and run island tests in CI
Stack the libnode packs on the in-process loader (#1685) and use its
pack assembler and manifest format instead of a second one:
build-pack.mjs keeps its CLI and fields (schema, nodeVersion,
moduleVersion, bridgeAbi, platform, arch, files), adds the libnode and
bridge names, strips and (on macOS) re-signs the bridge and links it with
-z defs, and exports buildPack(), which the platform packs call with their
package, target and build inputs as extra manifest fields.

libnodeRecord falls back to the installed @scriptc/libnode-<platform>
pack, found from the entry's directory and then next to the compiler,
when neither --libnode nor SCRIPTC_LIBNODE names one.

The Linux test lanes restore the libnode build that the libnode-packs
workflow cached, assemble the linux-x64 pack from it in seconds
(build.mjs --from-cache never builds Node) and export SCRIPTC_LIBNODE, so
the Node island corpus and harness tests run instead of skipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00

23 lines
1.0 KiB
JavaScript

#!/usr/bin/env node
// Builds @scriptc/libnode-linux-x64-gnu: libnode for the pinned Node.js release
// and the bridge (packages/libnode-common/scripts/build.mjs). The Node
// build takes about half an hour on 8 cores and is cached by Node version,
// configure flags and toolchain; only the libnode-packs workflow and an
// explicit `pnpm --filter @scriptc/libnode-linux-x64-gnu build:native` run it.
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { buildLibnodePack } from "../../libnode-common/scripts/build.mjs";
if (process.platform !== "linux" || process.arch !== "x64") {
process.stdout.write("@scriptc/libnode-linux-x64-gnu: skipped on this host\n");
process.exit(0);
}
await buildLibnodePack({
platform: "linux-x64-gnu",
packageRoot: dirname(dirname(fileURLToPath(import.meta.url))),
compress: process.argv.includes("--compress"),
// Assemble from a restored libnode build only (CI test lanes); never
// start a Node build.
skipLibnode: process.argv.includes("--from-cache"),
});