mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
Give the sanitized bootstrap seed job swap (#1864)
This commit is contained in:
@@ -364,6 +364,20 @@ jobs:
|
||||
target: wasm32-wasi
|
||||
helper: "false"
|
||||
- run: pnpm build
|
||||
# The sanitized seed compiles the compiler's 700 MB module with one clang
|
||||
# process under AddressSanitizer. It peaks near 14 GB while the Node
|
||||
# process that emitted the module still holds about 6 GB. Together they
|
||||
# exceed the runner's 16 GB of memory, so back them with swap.
|
||||
- name: Enlarge swap for the sanitized seed
|
||||
if: matrix.flavor == 'san'
|
||||
run: |
|
||||
sudo swapoff -a
|
||||
sudo rm -f /mnt/swapfile
|
||||
sudo fallocate -l 24G /mnt/swapfile
|
||||
sudo chmod 600 /mnt/swapfile
|
||||
sudo mkswap /mnt/swapfile
|
||||
sudo swapon /mnt/swapfile
|
||||
free -h
|
||||
- name: Prepare bootstrap seed
|
||||
run: node scripts/bootstrap-seed.mjs
|
||||
env:
|
||||
|
||||
@@ -78,6 +78,10 @@ test("CI restores each seed only into its matching instrumented bootstrap lane",
|
||||
const execute = checks.steps.find((step) =>
|
||||
step.run?.split("\n").includes("node scripts/ci-native-bootstrap.mjs"),
|
||||
)!;
|
||||
// The sanitized seed's build needs more memory than the runner has: swap backs it.
|
||||
const swap = seed.steps.findIndex((step) => step.run?.includes("swapon /mnt/swapfile"));
|
||||
expect(seed.steps[swap]?.if).toBe("matrix.flavor == 'san'");
|
||||
expect(swap).toBeLessThan(seed.steps.indexOf(prepare));
|
||||
expect(prepare.env?.SCRIPTC_BOOTSTRAP_SEED_DIRECTORY).toBe("${{ runner.temp }}/native-bootstrap");
|
||||
expect(execute.env?.SCRIPTC_BOOTSTRAP_SEED_DIRECTORY).toBe(
|
||||
prepare.env?.SCRIPTC_BOOTSTRAP_SEED_DIRECTORY,
|
||||
|
||||
Reference in New Issue
Block a user