Skip to content

fix: back up stow conflicts before make install#126

Merged
fullstackjam merged 1 commit into
mainfrom
fix/make-install-backup-conflicts
Jun 3, 2026
Merged

fix: back up stow conflicts before make install#126
fullstackjam merged 1 commit into
mainfrom
fix/make-install-backup-conflicts

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

What does this PR do?

Pre-backs-up existing regular files that would conflict with stow before running make install, mirroring the logic already in linkWithStow.

Why?

The v0.61.0 release workflow failed at the vm-e2e stage:

stow -v --target="/Users/runner" git ssh zsh
WARNING! stowing git would cause conflicts:
  * cannot stow .dotfiles/git/.gitconfig over existing target .gitconfig since neither a link nor a directory
WARNING! stowing zsh would cause conflicts:
  * cannot stow .dotfiles/zsh/.zshrc over existing target .zshrc since neither a link nor a directory
All operations aborted.
make: *** [install] Error 1
✗ Dotfiles setup failed: link dotfiles: make install: exit status 2

PR #123 added linkWithMake to prefer a Makefile's install target over calling stow directly, but didn't carry over the backupConflicts step that linkWithStow has always run. The default dotfiles repo's Makefile delegates to stow, which aborts on pre-existing files it can't replace. On the vm-e2e runner, .gitconfig and .zshrc exist from earlier installer steps.

Testing

  • go vet ./... passes
  • Relevant tests added or updated — two new unit tests: TestLinkWithMake_BacksUpConflictsBeforeRunning and TestLinkWithMake_RestoresConflictsOnMakeFailure
  • Tested locally (./openboot install --dry-run or similar)

Cross-repo checklist

  • Does this need a docs/content update in openboot.dev? — No
  • Does this change the CLI ↔ server API contract? — No

Notes for reviewer

linkWithMake now:

  1. Scans each non-hidden subdirectory (stow package) for regular-file conflicts
  2. Backs them up to .openboot.bak before running make install
  3. Restores them if make fails
  4. Cleans up backups on success

This is the same pattern linkWithStow has used since the feature landed.

…ailures

linkWithMake ran make install without pre-backing-up files that stow
(called by the Makefile) would conflict with. The default dotfiles repo's
Makefile calls stow directly, so pre-existing .gitconfig/.zshrc on the
runner caused make to exit 2, failing all three vm-e2e dotfiles tests.

Apply the same backupConflicts loop that linkWithStow already uses:
scan each package directory, back up regular-file conflicts, restore on
make failure, clean up on success. Also updates the archtest baseline
whose line numbers shifted with the added code.
@github-actions github-actions Bot added the tests Tests only label Jun 3, 2026
@fullstackjam fullstackjam merged commit a46a9bd into main Jun 3, 2026
10 of 11 checks passed
@fullstackjam fullstackjam deleted the fix/make-install-backup-conflicts branch June 3, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant