Skip to content

feat: cargo dev-install to symlink dev build into PATH#94

Merged
delianides merged 8 commits into
mainfrom
drew/cargo-dev-install
May 30, 2026
Merged

feat: cargo dev-install to symlink dev build into PATH#94
delianides merged 8 commits into
mainfrom
drew/cargo-dev-install

Conversation

@delianides
Copy link
Copy Markdown
Collaborator

@delianides delianides commented May 30, 2026

Summary

  • Adds cargo dev-install: builds the debug perch and symlinks target/debug/perch into ~/.local/bin/perch, so every later cargo build is instantly live — no reinstall. cargo run -p xtask -- uninstall removes the symlink (only if it's a symlink; never deletes a real file).
  • Implemented via a new xtask workspace crate (dev tooling only — publish = false, dist = false, never shipped). Converts the repo to a Cargo workspace; the root perch package and cargo-dist release flow are unchanged.
  • Symlink logic has clobber protection (refuses to overwrite a real file) and is idempotent. The install command warns if ~/.local/bin isn't on PATH or if an earlier PATH entry shadows the dev build. Hardened against relative CARGO_TARGET_DIR and missing build output.
  • Dev build version string: a new build.rs captures the git short SHA at compile time, so debug builds report perch 1.6.0-dev.<sha> (and …-dev.<sha>.dirty with uncommitted changes). Gated on cfg!(debug_assertions), so --release builds (incl. Homebrew/cargo-dist) stay clean 1.6.0. Makes it obvious at a glance you're running the dev build.
  • Unix-only by design; manages perch only (not git-perch).
  • Docs updated in README.md and CLAUDE.md.

Test Plan

  • cargo test --workspace — passes (6 xtask helper tests: fresh link, idempotent relink, clobber refusal, unlink, missing-noop, real-file refusal; plus a VERSION-format test)
  • cargo clippy --workspace clean
  • Manual: cargo dev-install → symlink created, perch --version shows 1.6.0-dev.<sha>; second run idempotent; uninstall removes it; PATH shadow warning fires when another perch is earlier on PATH
  • cargo build --releaseperch --version reports clean 1.6.0 (release/Homebrew output unaffected)
  • Confirm dist plan still ships only perch (xtask excluded) — optional, needs cargo-dist installed

🤖 Generated with Claude Code

delianides and others added 8 commits May 29, 2026 20:53
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… build output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a "Dev install" subsection to README.md under Development explaining
the cargo dev-install / uninstall workflow. Note the xtask workspace member
and the dev-install command in CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@delianides delianides merged commit ae846d6 into main May 30, 2026
9 checks passed
@delianides delianides deleted the drew/cargo-dev-install branch May 30, 2026 01:52
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