fix(lab): unlink lab binary before reinstall to avoid ETXTBSY #324

Closed
mahmoud wants to merge 0 commits from development_fix_lab_self_overwrite into development
Owner

lab build lab rebuilds and reinstalls the running lab binary. The install step cp-ed over ~/.local/bin/lab without unlinking it first, so overwriting the in-use executable failed with ETXTBSY ("Text file busy").

Fix: rm -f the destination before cp in lab_build.sh — unlink succeeds while the open inode keeps the running process alive, so the new binary installs cleanly.

Verified: a plain lab build lab --restart --install now builds and installs end-to-end.

`lab build lab` rebuilds and reinstalls the *running* `lab` binary. The install step `cp`-ed over `~/.local/bin/lab` without unlinking it first, so overwriting the in-use executable failed with `ETXTBSY` ("Text file busy"). Fix: `rm -f` the destination before `cp` in `lab_build.sh` — unlink succeeds while the open inode keeps the running process alive, so the new binary installs cleanly. Verified: a plain `lab build lab --restart --install` now builds and installs end-to-end.
- rm -f dest before cp in lab_build.sh install step
- self-rebuild via 'lab build lab' overwrote the running
  binary and failed with ETXTBSY (Text file busy)
mahmoud closed this pull request 2026-06-15 09:03:27 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills!324
No description provided.