fix(install): make install must replace a leftover symlink, not write through it - #71
Merged
Merged
Conversation
… 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
force-pushed
the
fix/install-replace-symlink
branch
from
July 28, 2026 18:24
fbeebf0 to
c5caaaf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Root cause of the recurring "dirty checkout /
bin/devflowreverted to a stub / stuck in link mode" saga.make installdidprintf ... > $(BINDIR)/devflowwith norm -ffirst. WhenBINDIR/devflowwas a leftovermake linksymlink into the source checkout'sbin/devflow, the redirect followed the symlink and overwrote its target — gutting the sourcebin/devflowto the 3-line launcher stub while leaving the symlink in place. So everymake installrun 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
BINDIR/devflow→ sentinel; aftermake installthe sentinel is untouched andBINDIR/devflowis a real file. Confirmed the test catches the bug (old behavior overwrites the sentinel).make test-unit119/0;make testgreen.Builds on v0.17.2.
🤖 Generated with Claude Code