Skip to content

♻️ Decouple bun and uv from binary, resolve at runtime with auto-download#84

Merged
renardeinside merged 3 commits intomainfrom
feat/decouple-bun-and-uv
Feb 17, 2026
Merged

♻️ Decouple bun and uv from binary, resolve at runtime with auto-download#84
renardeinside merged 3 commits intomainfrom
feat/decouple-bun-and-uv

Conversation

@renardeinside
Copy link
Copy Markdown
Collaborator

Summary

  • Remove bun embedding from the binary (include_bytes!), reducing size from ~99MB to ~39MB
  • Add runtime resolution for both bun (v1.3.8) and uv (v0.10.3) with 4-tier fallback: env var override → system PATH → ~/.apx/bin/ cache → auto-download from GitHub releases
  • Simplify CI by removing bun binary download/cache steps from release workflow

Details

New module: crates/core/src/download.rs

Central binary resolution and auto-download logic. Uses tokio::sync::OnceCell for per-process caching. Provides both async (resolve_bun/uv) and sync (try_resolve_bun/uv) APIs.

Key changes

  • BunCommand::new(), UvCommand::new(), ApxCommand::new() are now async and return Result
  • All ~20 call sites updated to .await?
  • Removed ensure_bun_extracted(), bun_binary_path(), copy_bun_binary() build step
  • Deleted scripts/get_binaries.py (no longer needed)
  • Install scripts updated to inform users that uv will be auto-downloaded

User experience

  • Download progress printed to stderr (bun not found on PATH — downloading v1.3.8...)
  • Actionable error messages on failure (Failed to auto-install bun v1.3.8: ... Install bun manually or set APX_BUN_PATH)
  • No stdout noise (MCP-safe)

Test plan

  • cargo clippy --workspace -- -D warnings passes clean
  • cargo test -p apx-core -p apx-cli — 120 tests pass
  • Binary size ~39MB (down from ~99MB)
  • With system bun/uv on PATH: uses system binaries
  • Without bun on PATH: auto-downloads bun v1.3.8 to ~/.apx/bin/
  • Without uv on PATH: auto-downloads uv v0.10.3 to ~/.apx/bin/
  • Version markers written (~/.apx/bin/.bun-version, .uv-version)

🤖 Generated with Claude Code

@renardeinside renardeinside linked an issue Feb 17, 2026 that may be closed by this pull request
@renardeinside renardeinside merged commit ca72c1d into main Feb 17, 2026
3 checks passed
@renardeinside renardeinside deleted the feat/decouple-bun-and-uv branch February 17, 2026 12:59
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.

🏬 [FEAT] decouple bun and uv installation

1 participant