Skip to content

fix(install): keep dev on the PATH and pin on every Mac (26.11.11) - #14

Merged
ancongui merged 3 commits into
mainfrom
fix/dev-link-after-update
Nov 10, 2026
Merged

ancongui merged 3 commits into
mainfrom
fix/dev-link-after-update

Conversation

@ancongui

Copy link
Copy Markdown
Collaborator

What and why

Two install bugs. dev update could leave dev off the PATH: after an update retired an older copy, the link
~/.local/bin/dev kept naming that copy, and the cleanup of old copies deleted it three releases later, so the link
pointed at nothing. And a teammate's fresh dev install stopped with "Permission denied" before anything was
installed: the new pinned copy was made read-only before it was renamed into place, and their Mac refuses to rename a
folder its owner cannot write.

Changes

  • install_cli points ~/.local/bin/dev at the copy it installs whenever the link names anything else, swapped in
    one rename, so no moment exists without dev.
  • pins_in_use keeps the copy the link names, not only the copy it ends up at, and the copy ~/.zshrc sources,
    which is what puts ~/.local/bin on the PATH.
  • _build renames the new copy (and a copy it replaces) while its folder is writable, and makes it read-only right
    after.
  • CHANGELOG section 26.11.11; VERSION and the three manifests at 26.11.11.

How to verify

  • Local CI: dev ci --run passed 7 of 7 steps (compile, unit tests, gitleaks, semgrep, osv-scanner, trivy, zizmor)
    on tree 531ab96.
  • tests.test_pinned_install on Python 3.15 and the system Python 3.9: OK. dev test prove: the four new tests fail
    without the change (the link kept naming the old copy, then pointed at nothing; the teammate's PermissionError) and
    pass 5 of 5 runs with it.
  • The developer's own audit trail matches the cause: the link had named 26.11.5 since 2026-11-07, and the update of
    2026-11-10 pruned 26.11.5.

Risk and rollback

Low: two functions in the install, each covered by tests that copy the failure. The copy ends read-only as before.
Roll back with dev install --version 26.11.10.

Links

  • Release notes: CHANGELOG.md, section 26.11.11

After an update, ~/.local/bin/dev could point at nothing, so dev was gone from every terminal. Every install now points the link at the copy it installs, in one rename, and the cleanup of old copies keeps the copy the link names and the copy ~/.zshrc sources.

Root cause: install_cli compared the link's resolved path, which reached the new copy through a retired copy's bin/dev, so the link kept naming the old copy; pins_in_use also resolved the link to its end, so prune_pins deleted the copy it named three releases later (setup.py install_cli, pins_in_use)

Verified: python3 -m unittest tests.test_pinned_install: OK; dev test prove: the 3 new DevLinkTests fail without the change and pass with it
A teammate's fresh dev install stopped with Permission denied before anything was installed. The new copy now moves into place while its folder is writable and is read-only again once it is there.

Root cause: _build made the copy read-only before os.rename moved it, and some Macs refuse to rename a folder its owner cannot write even within one parent (setup.py _build)

Verified: python3 and /usr/bin/python3 -m unittest tests.test_pinned_install: OK; dev test prove: StrictRenameTests fails without the change with the teammate's PermissionError and passes with it
Version 26.11.11 in VERSION and the three manifests, and its CHANGELOG section: dev stays on the PATH across updates, and a fresh install moves its pinned copy into place on every Mac.

Verified: dev docs check CHANGELOG.md: 0 issues, links resolve
@ancongui
ancongui merged commit dae822a into main Nov 10, 2026
3 checks passed
@ancongui
ancongui deleted the fix/dev-link-after-update branch November 10, 2026 20:55
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.

1 participant