Homebrew support#98
Conversation
Reviewer's GuideAdds a new Homebrew profile to the image configuration system, including package selection, profile metadata, expansion behavior, Docker build steps, and export wiring so images can be built with Homebrew preinstalled. Class diagram for Homebrew profile integration in config systemclassDiagram
class ConfigSystem {
+get_profile_packages(profile_name)
+get_profile_description(profile_name)
+get_all_profile_names()
+profile_exists(profile_name)
+expand_profile(profile_name)
+get_profile_ml()
+get_profile_homebrew()
}
class ProfilePackages {
+core
+build_tools
+ml
+homebrew
}
class ProfileDescriptions {
+core
+build_tools
+ml
+homebrew
}
class ProfileExpansion {
+core
+build_tools
+ml
+homebrew
}
ConfigSystem --> ProfilePackages : uses
ConfigSystem --> ProfileDescriptions : uses
ConfigSystem --> ProfileExpansion : uses
class HomebrewProfile {
+packages : build-essential curl file procps locales
+description : Homebrew Package Manager
+expanded_profiles : core homebrew
+docker_steps()
}
HomebrewProfile ..> ConfigSystem : configured_through
HomebrewProfile ..> ProfilePackages : defines_packages
HomebrewProfile ..> ProfileDescriptions : defines_description
HomebrewProfile ..> ProfileExpansion : defines_expansion
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…, extra blank line Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ensures unattended installation without relying on TTY detection, per Homebrew's documented recommendation for CI/Docker builds. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Matches the convention used by other profiles (rust, javascript, flutter) and avoids noisy progress meter output during Docker builds. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 103a7fe.
PR Review: Homebrew Support (#98)SummaryAdds Homebrew profile to ClaudeBox. Clean implementation following existing patterns. Strengths
Notes
RecommendationApprove - Solid work, ready to merge. Files: lib/config.sh (+23, -2) Review by Claude Code (claude-sonnet-4-5) |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The
expand_profilecase forhomebrewreturnscore homebrew, which reintroduces the same profile name and risks confusing or recursive expansion logic; consider expanding only tocore(or another concrete set of profiles) instead. - The
get_profile_homebrewsnippet assumes aclaudeuser exists in the base image; if that user is not guaranteed, consider parameterizing the username or deriving it from existing configuration to avoid build-time failures. - The Homebrew install currently downloads and executes the latest
HEADinstall script directly viacurl; consider pinning to a specific commit or adding a checksum/validation step to improve reproducibility and safety.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `expand_profile` case for `homebrew` returns `core homebrew`, which reintroduces the same profile name and risks confusing or recursive expansion logic; consider expanding only to `core` (or another concrete set of profiles) instead.
- The `get_profile_homebrew` snippet assumes a `claude` user exists in the base image; if that user is not guaranteed, consider parameterizing the username or deriving it from existing configuration to avoid build-time failures.
- The Homebrew install currently downloads and executes the latest `HEAD` install script directly via `curl`; consider pinning to a specific commit or adding a checksum/validation step to improve reproducibility and safety.
## Individual Comments
### Comment 1
<location> `lib/config.sh:380` </location>
<code_context>
+USER claude
+
+# Homebrew does not publish versioned releases of its install script
+RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
+RUN brew --version # Confirm installation
</code_context>
<issue_to_address>
**🚨 issue (security):** `curl | bash` style install of an unpinned script is a security and reproducibility risk.
Executing the install script from `HEAD` at build time makes builds non-deterministic and exposes you to any repo or network compromise. Where possible, pin this to a specific commit or tagged release URL and/or verify a checksum or signature before running it, so the image is reproducible and less vulnerable to supply-chain attacks.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| USER claude | ||
|
|
||
| # Homebrew does not publish versioned releases of its install script | ||
| RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
There was a problem hiding this comment.
🚨 issue (security): curl | bash style install of an unpinned script is a security and reproducibility risk.
Executing the install script from HEAD at build time makes builds non-deterministic and exposes you to any repo or network compromise. Where possible, pin this to a specific commit or tagged release URL and/or verify a checksum or signature before running it, so the image is reproducible and less vulnerable to supply-chain attacks.
This PR adds a profile for the Homebrew package manager.
Summary by Sourcery
Add a new Homebrew profile to the configuration system and wire it into the profile registry.
New Features:
Enhancements: