Skip to content

fix: use copyFileSync+unlinkSync to avoid EXDEV on GitHub Actions runners (ENG-599)#287

Merged
kcberg merged 1 commit into
mainfrom
kcberg/eng-599-fix-exdev-rename-binary-install
Jun 27, 2026
Merged

fix: use copyFileSync+unlinkSync to avoid EXDEV on GitHub Actions runners (ENG-599)#287
kcberg merged 1 commit into
mainfrom
kcberg/eng-599-fix-exdev-rename-binary-install

Conversation

@kcberg

@kcberg kcberg commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description of the change

fs.renameSync fails with EXDEV: cross-device link not permitted when the source temp file (downloaded by @actions/tool-cache to /home/runner/_work/_temp/) and the destination (/tmp/hawk-bin-<ver>/hawk) are on different filesystems — which is the default on GitHub Actions Linux runners. This only affects the 6.0.0+ binary install path added in ENG-599; the legacy ZIP path was unaffected.

Fix: replace renameSync with copyFileSync + unlinkSync, which works across filesystem boundaries. The chmodSync('755') that follows is unchanged and still runs on the destination file.

works on my machine... and yours

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Related issues

ENG-599

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

…n GitHub Actions

fs.renameSync fails with EXDEV when the source temp file (downloaded by
@actions/tool-cache to /home/runner/_work/_temp/) and destination
(/tmp/hawk-bin-<ver>/hawk) are on different filesystems — which is the
case on GitHub Actions Linux runners. Replace with copyFileSync+unlinkSync,
which works across filesystem boundaries.

This only affects the 6.0.0+ binary install path (new in ENG-599); the
legacy ZIP path was unaffected.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@kcberg
kcberg requested a review from a team as a code owner June 27, 2026 13:19
@linear-code

linear-code Bot commented Jun 27, 2026

Copy link
Copy Markdown

ENG-599

@kcberg
kcberg merged commit c350570 into main Jun 27, 2026
13 checks passed
@kcberg
kcberg deleted the kcberg/eng-599-fix-exdev-rename-binary-install branch June 27, 2026 13:58
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.

2 participants