Link the exported bootstrap package's helper and runtime pack dependencies

The native bootstrap's package checks copy the seed's distribution into a
package directory outside the workspace and, since the CLI packages depend
on their LLVM helper and runtime pack, drop the bundled copies. Nothing in
that directory resolved @scriptc/llvm-linux-x64-gnu, so
verify-native-cli.mjs failed with 'Cannot find module'. The test now links
both packages into the directory's node_modules, as pnpm links a workspace
package's dependencies.
This commit is contained in:
Chris Tate
2026-10-26 10:56:27 -05:00
parent d1a0bea84e
commit 6e4fdf95d0
@@ -106,12 +106,21 @@ test(
join(packageDirectory, "package.json"),
);
cpSync(distribution, join(packageDirectory, "dist"), { recursive: true });
// The npm package depends on its LLVM helper and runtime pack.
// The npm package depends on its LLVM helper and runtime pack. Link
// them into its node_modules, as pnpm links a workspace package's
// dependencies, so the package checks resolve them.
unbundlePlatformPackages(
join(packageDirectory, "dist"),
join(packageDirectory, "dist/bin/scriptc.json"),
"@scriptc/llvm-linux-x64-gnu",
);
mkdirSync(join(packageDirectory, "node_modules/@scriptc"), { recursive: true });
for (const name of ["llvm-linux-x64-gnu", "runtime-linux-x64-gnu"])
symlinkSync(
join(root, "packages", name),
join(packageDirectory, "node_modules/@scriptc", name),
"dir",
);
writeFileSync(packageDirectory + ".ready", "ready\n");
}
// All compiler assets must survive moving the complete distribution.