mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 00:25:34 +08:00
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.
This commit is contained in:
@@ -48,6 +48,10 @@ const invariantCaseShardedFiles = ["tests/harness/coverage.test.ts"];
|
|||||||
// independent cases can spread across the once lane's Sandboxes without
|
// independent cases can spread across the once lane's Sandboxes without
|
||||||
// colliding with corpus case selection.
|
// colliding with corpus case selection.
|
||||||
const cacheCaseShardedFiles = ["packages/compiler/src/backend/native-toolchain.test.ts"];
|
const cacheCaseShardedFiles = ["packages/compiler/src/backend/native-toolchain.test.ts"];
|
||||||
|
const nativeBuildFiles = [
|
||||||
|
"tests/harness/self-hosting-native-driver.test.ts",
|
||||||
|
"packages/runtime/test/glibc-random.test.ts",
|
||||||
|
];
|
||||||
const caseShardedFiles = [
|
const caseShardedFiles = [
|
||||||
...laneCaseShardedFiles,
|
...laneCaseShardedFiles,
|
||||||
...invariantCaseShardedFiles,
|
...invariantCaseShardedFiles,
|
||||||
@@ -745,14 +749,17 @@ try {
|
|||||||
"/workspace",
|
"/workspace",
|
||||||
3 * 60_000,
|
3 * 60_000,
|
||||||
);
|
);
|
||||||
// Zig is a build-only dependency in this lane. Cross-target suites own
|
// Keep Zig available to the portable compiler bootstrap and entropy
|
||||||
// the conditional Zig tests; exposing it here would silently expand the
|
// contract, without expanding the conditional cross-target cache tests.
|
||||||
// native-cache shard while that shard deliberately disables stable
|
|
||||||
// toolchain caching.
|
|
||||||
await execIn(
|
await execIn(
|
||||||
worker,
|
worker,
|
||||||
"sudo",
|
"sh",
|
||||||
["rm", "-f", "/usr/local/bin/zig"],
|
["-c", [
|
||||||
|
"set -eu",
|
||||||
|
"mkdir -p /tmp/scriptc-native-build-tools",
|
||||||
|
'ln -sf "$(readlink -f "$(command -v zig)")" /tmp/scriptc-native-build-tools/zig',
|
||||||
|
"sudo rm -f /usr/local/bin/zig",
|
||||||
|
].join("\n")],
|
||||||
{},
|
{},
|
||||||
"runtime toolchain cleanup",
|
"runtime toolchain cleanup",
|
||||||
60_000,
|
60_000,
|
||||||
@@ -805,6 +812,7 @@ try {
|
|||||||
"--passWithNoTests",
|
"--passWithNoTests",
|
||||||
`--shard=${worker.shard}/${shardCount}`,
|
`--shard=${worker.shard}/${shardCount}`,
|
||||||
...caseShardedFiles.map((file) => `--exclude=${file}`),
|
...caseShardedFiles.map((file) => `--exclude=${file}`),
|
||||||
|
...nativeBuildFiles.map((file) => `--exclude=${file}`),
|
||||||
...nativeHostInvariantFiles.map((file) => `--exclude=${file}`),
|
...nativeHostInvariantFiles.map((file) => `--exclude=${file}`),
|
||||||
...localLaneFiles.map((file) => `--exclude=${file}`),
|
...localLaneFiles.map((file) => `--exclude=${file}`),
|
||||||
...localCaseShardedFiles.map((file) => `--exclude=${file}`),
|
...localCaseShardedFiles.map((file) => `--exclude=${file}`),
|
||||||
@@ -837,9 +845,17 @@ try {
|
|||||||
},
|
},
|
||||||
"cache",
|
"cache",
|
||||||
);
|
);
|
||||||
|
const nativeBuild = () => execIn(
|
||||||
|
worker,
|
||||||
|
"sh",
|
||||||
|
["-c", 'export PATH="/tmp/scriptc-native-build-tools:$PATH"; exec "$@"', "sh",
|
||||||
|
"pnpm", "test", "--reporter=dot", ...nativeBuildFiles],
|
||||||
|
{ ...sharedTestEnv, SCRIPTC_TEST_WORKERS: "1" },
|
||||||
|
"native bootstrap",
|
||||||
|
);
|
||||||
// The corpus owns the remaining pool while file/cache processes share
|
// The corpus owns the remaining pool while file/cache processes share
|
||||||
// the reserved side slots (serially when only one slot is available).
|
// the reserved side slots (serially when only one slot is available).
|
||||||
const sideTasks = [files, ...(runCacheCases ? [cacheCases] : [])];
|
const sideTasks = [...(worker.shard === 1 ? [nativeBuild] : []), files, ...(runCacheCases ? [cacheCases] : [])];
|
||||||
if (sideConcurrency === 0) {
|
if (sideConcurrency === 0) {
|
||||||
await cases();
|
await cases();
|
||||||
await runTaskQueue(sideTasks, 1);
|
await runTaskQueue(sideTasks, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user