Skip to content

fix(install): make install must replace a leftover symlink, not write through it - #71

Merged
AndreJorgeLopes merged 1 commit into
mainfrom
fix/install-replace-symlink
Jul 28, 2026
Merged

fix(install): make install must replace a leftover symlink, not write through it#71
AndreJorgeLopes merged 1 commit into
mainfrom
fix/install-replace-symlink

Conversation

@AndreJorgeLopes

Copy link
Copy Markdown
Owner

TL;DR

Root cause of the recurring "dirty checkout / bin/devflow reverted to a stub / stuck in link mode" saga.

make install did printf ... > $(BINDIR)/devflow with no rm -f first. When BINDIR/devflow was a leftover make link symlink into the source checkout's bin/devflow, the redirect followed the symlink and overwrote its target — gutting the source bin/devflow to the 3-line launcher stub while leaving the symlink in place. So every make install run from link mode silently corrupted the checkout and never actually switched to a copy install.

Fix

rm -f $(BINDIR)/devflow (and $(LIBDIR)/devflow-bin) before writing, so install replaces a pre-existing symlink with a real launcher — idempotent and symlink-safe. Also makes the auto-reinstall export path safe when transitioning from a link install.

Verification

  • Regression test (init.bats): a symlink at BINDIR/devflow → sentinel; after make install the sentinel is untouched and BINDIR/devflow is a real file. Confirmed the test catches the bug (old behavior overwrites the sentinel).
  • full make test-unit 119/0; make test green.

Builds on v0.17.2.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 8, 2026 05:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

… through it

make install did 'printf ... > $(BINDIR)/devflow' with no rm -f first. If BINDIR/devflow
was a leftover 'make link' SYMLINK (into the source checkout's bin/devflow), the redirect
followed the symlink and overwrote its TARGET - gutting the source bin/devflow to the
3-line launcher stub while leaving the symlink in place. That is the root cause of the
recurring 'dirty checkout / bin/devflow reverted to a stub / stuck in link mode' saga:
every make install run from link mode silently corrupted the checkout and never actually
switched to a real copy install.

Fix: rm -f $(BINDIR)/devflow (and $(LIBDIR)/devflow-bin) before writing, so install
REPLACES a pre-existing symlink with a real launcher (idempotent, symlink-safe). This also
makes the auto-reinstall export path safe when transitioning from a link install.

Regression test (init.bats): a leftover symlink at BINDIR/devflow pointing to a sentinel;
after make install the sentinel is untouched and BINDIR/devflow is a real file (not a
symlink). Verified the test catches the bug (old behavior overwrites the sentinel).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AndreJorgeLopes
AndreJorgeLopes force-pushed the fix/install-replace-symlink branch from fbeebf0 to c5caaaf Compare July 28, 2026 18:24
@AndreJorgeLopes
AndreJorgeLopes merged commit 71d8234 into main Jul 28, 2026
1 check passed
@AndreJorgeLopes
AndreJorgeLopes deleted the fix/install-replace-symlink branch July 28, 2026 18:28
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