@@ -263,19 +263,6 @@ jobs:
263263 - name : Verify immutable CI inputs (post-checkout)
264264 run : bash scripts/ci/verify-ci-inputs.sh post-checkout
265265
266- # Fork-PR runners keep the workspace on the small root fs; bind the target
267- # dir to the larger /mnt disk (path stays workspace-relative for rust-cache).
268- - name : Back Cargo target with /mnt ephemeral disk (fork PRs)
269- if : github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
270- run : |
271- target="${{ github.workspace }}/target/build-linux-x86"
272- backing="/mnt/cargo-target/build-linux-x86"
273- sudo mkdir -p "$backing"
274- sudo chown "$(id -u):$(id -g)" "$backing"
275- mkdir -p "$target"
276- sudo mount --bind "$backing" "$target"
277- df -h / /mnt
278-
279266 - name : Common setup
280267 uses : ./.github/actions/common-setup
281268 with :
@@ -309,6 +296,26 @@ jobs:
309296 - name : Cached test data
310297 uses : ./.github/actions/common-test-data
311298
299+ # Fork-PR runners vary in disk size; fail early with a clear message
300+ # rather than a cryptic linker Bus error when a small VM runs out.
301+ - name : Check available disk space
302+ if : >-
303+ needs.plan.outputs.run-rust-tests == 'true'
304+ && github.event_name == 'pull_request'
305+ && github.event.pull_request.head.repo.fork
306+ run : |
307+ echo "::group::Disk space before Rust tests"
308+ df -h /
309+ echo "::endgroup::"
310+ avail_gb=$(($(df -Pk / | awk 'NR==2 {print $4}') / 1024 / 1024))
311+ echo "Available on / : ${avail_gb}G"
312+ if [ "${avail_gb}" -lt 25 ]; then
313+ echo "::error::Only ${avail_gb}G free, runner too small for the Rust build. Re-run for a larger VM."
314+ exit 1
315+ elif [ "${avail_gb}" -lt 40 ]; then
316+ echo "::warning::Only ${avail_gb}G free, the Rust build may run out of space, re-run if it fails."
317+ fi
318+
312319 - name : Run Rust tests (core)
313320 if : needs.plan.outputs.run-rust-tests == 'true'
314321 run : make cargo-test-core EXTRA_FEATURES="capnp,hypersync" NEXTEST_PROFILE=ci
0 commit comments