Skip to content

fix: tolerate macOS purge spawn failures - #400

Closed
npmccallum wants to merge 1 commit into
Swatinem:masterfrom
pichi-vm:fix/macos-purge-spawn-failure
Closed

npmccallum wants to merge 1 commit into
Swatinem:masterfrom
pichi-vm:fix/macos-purge-spawn-failure

Conversation

@npmccallum

Copy link
Copy Markdown

On a sandboxed self-hosted macOS runner, launching sudo /usr/sbin/purge fails with spawn EPERM. The optional workaround's existing try/catch does not recover: the bundled @actions/exec uses an async Promise executor, so a synchronous spawn failure leaves its outer promise pending. The action's uncaughtException handler logs the error and Node exits zero without reaching cache cleanup or upload.

Use promisified Node execFile for this best-effort command. Launch errors and nonzero exits reach the existing catch, while successful executions still run the workaround. Output remains captured. No new dependencies, shell, inputs, or runner permission changes. Includes regenerated dist/.

Validation:

  • npm ci and npm run prepare pass; a second rebuild leaves dist/ unchanged.
  • Exercised the workaround extracted from the built dist/save.js: successful command, nonzero exit, and missing executable all reach the continuation with exit zero.
  • On the affected Hermes host with the installed Seatbelt policy and runner Node 24.22.1, the original bundled helper reproduces uncaught spawn EPERM, no continuation, and exit zero. The patched built workaround reaches its continuation with no uncaught error under that same policy. The probe ran as the unprivileged SSH account, not the runner account; no sandbox permissions were changed.

Downstream report and real job logs: pichi-vm/pichi#188. Full cache upload and subsequent restore validation remain separate from the targeted reproduction above.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant