Skip to content

fix(pnpm-install): skip swap setup on ARM64 runners#276

Merged
B4nan merged 1 commit into
mainfrom
fix/pnpm-install-arm64-swap
May 5, 2026
Merged

fix(pnpm-install): skip swap setup on ARM64 runners#276
B4nan merged 1 commit into
mainfrom
fix/pnpm-install-arm64-swap

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented May 5, 2026

Summary

pnpm-install/action.yaml calls pierotofy/set-swap-space@v1.0 unconditionally on Linux. That action runs:

SWAP_FILE=$(swapon --show=NAME | tail -n 1)
sudo swapoff $SWAP_FILE

On ARM64 GitHub runners (ubuntu-22.04-arm64, ubuntu-22.04-N-core-arm64, etc.) there's no pre-allocated swap, so swapon --show is empty, SWAP_FILE is empty, and swapoff exits with bad usage (exit code 16). Every job that uses this composite action then fails before pnpm install runs.

Repro

Pretty much any workflow on an ARM64 runner that does uses: apify/workflows/pnpm-install@main. Hit this while migrating apify/apify-core to pnpm — its entire CI suite uses ARM64 boxes, so every job in the migration PR was red on the same swap step.

Failure log on ARM64:

swapoff: bad usage
Try 'swapoff --help' for more information.
##[error]Process completed with exit code 16.

Change

Skip the swap step when runner.arch == 'ARM64'. x86_64 runners ship with an existing swap file so the action keeps working there. ARM64 runners typically have plenty of memory (apify-core CI uses 30 GB ARM64 boxes); not adding 10 GB of swap is fine.

`pierotofy/set-swap-space@v1.0` runs:

    SWAP_FILE=$(swapon --show=NAME | tail -n 1)
    sudo swapoff $SWAP_FILE

On ARM64 GitHub runners (`ubuntu-22.04-arm64`, `ubuntu-22.04-N-core-arm64`,
etc.) there is no pre-allocated swap, so `swapon --show` returns empty,
`SWAP_FILE` is empty, and `swapoff` exits with `bad usage` (exit 16).
Every job using this composite action then fails before pnpm install
even runs.

x86_64 runners ship with an existing swap file, so the action works there.

Skip the swap step on ARM64; install runs fine with the runner's default
memory (apify-core's monorepo uses ~30 GB RAM ARM64 boxes). x86_64
behaviour is unchanged.

Discovered while migrating apify/apify-core to pnpm. The full CI suite
runs on ARM64 there, so every job in apify-core PRs that uses this action
fails on the swap step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added this to the 140th sprint - Tooling team milestone May 5, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label May 5, 2026
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label May 5, 2026
@B4nan B4nan requested a review from vladfrangu May 5, 2026 08:43
@B4nan B4nan merged commit 7de7795 into main May 5, 2026
3 of 5 checks passed
@B4nan B4nan deleted the fix/pnpm-install-arm64-swap branch May 5, 2026 08:49
@vladfrangu
Copy link
Copy Markdown
Member

If only Claude didn't drop such a massive comment block to say "arm64 runners don't have swap but they have plenty of ram" xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants