From 3bf0d0b9a59d9215a965c1a00e9a5d67dbedd7bb Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Sun, 11 Oct 2026 16:45:12 -0500 Subject: [PATCH] Give the sanitized emitter job swap and a larger stack The sanitized native emitter peaks near 13 GB while it emits the compiler and then compiles the 348 MB module with clang under AddressSanitizer, which together exceed the 16 GB runner. Back the rebuild-emit job with a 24 GiB swap file and lift its stack limit, since the instrumented emitter's recursion can exceed 8 MiB. --- .github/workflows/ci.yml | 18 +++++++++++++++++- tests/harness/bootstrap-seed.test.ts | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89c8da310..cdfe1f11c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -314,8 +314,24 @@ jobs: path: ${{ runner.temp }} - name: Restore bootstrap seed run: tar -C "$RUNNER_TEMP" -xf "$RUNNER_TEMP/bootstrap-seed.tar" + # The sanitized emitter peaks near 13 GB while it emits the compiler, + # then clang compiles the 348 MB module under AddressSanitizer. Together + # they exceed the runner's 16 GB of memory, so back them with swap. + - name: Enlarge swap for the sanitized emitter + if: matrix.phase == 'rebuild-emit' + 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: Native bootstrap and package installation checks - run: node scripts/ci-native-bootstrap.mjs + # The instrumented emitter's recursion can exceed the default 8 MiB stack. + run: | + if [ "$SCRIPTC_BOOTSTRAP_PHASE" = rebuild-emit ]; then ulimit -s unlimited; fi + node scripts/ci-native-bootstrap.mjs env: SCRIPTC_BOOTSTRAP_SEED_DIRECTORY: ${{ runner.temp }}/native-bootstrap SCRIPTC_BOOTSTRAP_PACKAGE_DIR: ${{ runner.temp }}/native-cli-package diff --git a/tests/harness/bootstrap-seed.test.ts b/tests/harness/bootstrap-seed.test.ts index 08d03203e..2e8b3bad9 100644 --- a/tests/harness/bootstrap-seed.test.ts +++ b/tests/harness/bootstrap-seed.test.ts @@ -75,7 +75,9 @@ test("CI restores each seed only into its matching instrumented bootstrap lane", expect([...checkFlavors].toSorted()).toEqual(seed.strategy.matrix.flavor); expect(seed.env.SCRIPTC_SAN).toBe(checks.env.SCRIPTC_SAN); const prepare = seed.steps.find((step) => step.run === "node scripts/bootstrap-seed.mjs")!; - const execute = checks.steps.find((step) => step.run === "node scripts/ci-native-bootstrap.mjs")!; + const execute = checks.steps.find((step) => + step.run?.split("\n").includes("node scripts/ci-native-bootstrap.mjs"), + )!; 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,