Skip to content

fix(cli): link and unlink docker CLI tools in brew hooks#148

Merged
AprilNEA merged 1 commit intomasterfrom
fix/brew-docker-cli-links
Apr 6, 2026
Merged

fix(cli): link and unlink docker CLI tools in brew hooks#148
AprilNEA merged 1 commit intomasterfrom
fix/brew-docker-cli-links

Conversation

@SeanJA239
Copy link
Copy Markdown
Contributor

Brew-postflight now creates /usr/local/bin symlinks for docker, docker-buildx, docker-compose, and docker-credential-osxkeychain pointing to the bundled xbin/ directory. brew-uninstall removes them, but only if they are ArcBox-owned — symlinks belonging to Docker Desktop or other tools are left untouched.

Copilot AI review requested due to automatic review settings March 31, 2026 09:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Homebrew hook support to expose bundled Docker CLI tools immediately after brew install, and to clean up those links on uninstall without touching non-ArcBox-owned symlinks.

Changes:

  • Link Docker CLI tool symlinks from the app bundle’s Contents/MacOS/xbin/ into /usr/local/bin during brew-postflight.
  • Remove ArcBox-owned Docker CLI tool symlinks from /usr/local/bin during brew-uninstall.
  • Introduce app-bundle xbin/ discovery plus link/unlink helper functions.

Comment thread app/arcbox-cli/src/commands/internal.rs Outdated
Comment thread app/arcbox-cli/src/commands/internal.rs Outdated
Comment thread app/arcbox-cli/src/commands/internal.rs Outdated
@AprilNEA AprilNEA force-pushed the fix/brew-docker-cli-links branch from 66144bb to 951e91e Compare April 5, 2026 15:39
Copilot AI review requested due to automatic review settings April 5, 2026 15:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread app/arcbox-cli/src/commands/internal.rs
Comment thread app/arcbox-cli/src/commands/internal.rs Outdated
Comment thread app/arcbox-cli/src/commands/internal.rs Outdated
Comment thread app/arcbox-cli/src/commands/internal.rs Outdated
brew-postflight creates /usr/local/bin symlinks for docker, docker-buildx,
docker-compose, and docker-credential-osxkeychain pointing to the bundled
xbin/ directory (path 3). brew-uninstall removes them, but only if
ArcBox-owned.

Consolidate duplicated symlink logic into commands/symlink.rs:
- is_arcbox_owned() moved to arcbox-constants (single source of truth)
- detect_bundle_xbin(), decide_link(), safe_link/unlink(),
  link_all/unlink_all_docker_tools() shared across all three paths
- internal.rs, setup.rs, docker.rs, helper/cli.rs all delegate to shared code
- 8 unit tests covering link/unlink/idempotency/ownership

Documents all three Docker CLI discovery paths in module docs:
  Path 1: daemon → helper → /usr/local/bin (root, system-wide)
  Path 2: setup install → ~/.arcbox/bin (user-space, no root)
  Path 3: brew hooks → /usr/local/bin (no root on Homebrew systems)
@AprilNEA AprilNEA force-pushed the fix/brew-docker-cli-links branch from 951e91e to 8ab548b Compare April 5, 2026 15:55
@AprilNEA AprilNEA merged commit c6c0266 into master Apr 6, 2026
8 checks passed
@AprilNEA AprilNEA deleted the fix/brew-docker-cli-links branch April 6, 2026 03:54
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.

3 participants