Repository navigation
fix(brew): link keg-only-on-macOS formulae on Linux - #13108
Conversation
Mirror brew's KegOnlyReason#applicable?: keg-only reasons tied to macOS (:provided_by_macos, :shadowed_by_macos) do not apply on other OSes, where brew links these formulae into the prefix.
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: π Files selected for processing (7)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. π WalkthroughWalkthroughHomebrew metadata now records keg-only reasons. Linking evaluates those reasons for the target platform, including normal Linux linking for macOS-provided formulae. Tests and documentation cover the new behavior. ChangesHomebrew keg-only linking
Priority: β¬οΈ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant FormulaMetadata
participant Formula
participant pour
participant link_keg
FormulaMetadata->>Formula: deserialize keg_only_reason
Formula->>Formula: keg_only_for_target()
Formula-->>pour: target-specific keg-only status
pour->>link_keg: link keg with status
Merge Risk: βͺ Minimal Β· up to The platform-aware keg-only behavior is applied consistently to both installation paths and is covered for Linux linking, with no concrete unresolved merge risk identified. π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 47.37% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 5 files. (2 skipped: 2 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
### π Features - **(bootstrap)** declare Dock applications in order by @azohra in [#13075](#13075) - **(brew)** implement `mise bootstrap packages where` for keg-only packages by @himkt in [#13083](#13083) - **(cli)** add configurable output truncation by @jdx in [#13112](#13112) - **(daemons)** manage project daemons and database presets with pitchfork by @jdx in [#13085](#13085) - **(doctor)** add project diagnostic checks by @jdx in [#13062](#13062) - **(dotfiles)** infer variant sources from dotfiles root by @jdx in [#13087](#13087) - **(fmt)** sort lists whose order carries no meaning by @jrandolf in [#13058](#13058) - **(vfox)** add backend tool discovery by @jdx in [#13111](#13111) ### π Bug Fixes - **(asdf)** avoid recursive compatibility dispatch by @jdx in [#13114](#13114) - **(bootstrap)** explain macos defaults type differences by @jdx in [#13096](#13096) - **(bootstrap)** find ssh and tar on Windows for remote bootstrap by @JamBalaya56562 in [#13117](#13117) - **(brew)** link keg-only-on-macOS formulae on Linux by @lil-lon in [#13108](#13108) - **(config)** merge monorepo settings across overlays by @jdx in [#13084](#13084) - **(config)** scope runtime lockfile lookup to effective tool config by @nettlesh in [#13042](#13042) - **(doctor)** align project check roots, dir expansion, schema, and signals by @jdx in [#13089](#13089) - **(dotfiles)** honor global yes setting when tracking files by @nettlesh in [#13072](#13072) - **(dotfiles)** warn when tracking a symlink without its source by @jdx in [#13095](#13095) - **(http)** make shared extraction opt-in by @jdx in [#13059](#13059) - **(lockfile)** allow packslip to replace legacy provenance by @jdx in [#13105](#13105) - **(nushell)** wrap hide-env in try instead of in-env guard by @i-api in [#13071](#13071) - **(packslip)** skip unsupported lockfile targets by @jdx in [#13102](#13102) - **(schema)** model dotfiles manifests by @risu729 in [#12741](#12741) - **(task)** auto-install tools for run task references by @jdx in [#13086](#13086) - **(upgrade)** detect letter-suffixed version updates by @jdx in [#13119](#13119) - extract structured flight steps from tap casks by @jdx in [#13060](#13060) ### π Documentation - **(agents)** write PR titles and descriptions for release notes by @jdx in [#13090](#13090) - **(task)** organise task-running guidance by @azohra in [#13077](#13077) - diagram tracked dotfile synchronization by @jdx in [#13069](#13069) - diagram artifact cache execution by @jdx in [#13068](#13068) - diagram tool configuration precedence by @jdx in [#13067](#13067) - illustrate bootstrap machine resources by @jdx in [#13066](#13066) - illustrate project environment switching by @jdx in [#13065](#13065) - prevent landing tabs from shifting content by @jdx in [#13107](#13107) - prohibit drive-by AI discussion spam by @jdx in [#13110](#13110) ### β‘ Performance - **(lockfile)** avoid scheduling cached generation targets by @jdx in [#13101](#13101) - **(lockfile)** skip generation for current warm installs by @jdx in [#13103](#13103) - **(oci)** leave same-repository base layers remote during push by @jdx in [#13055](#13055) - **(oci)** cache local tool layers across image builds by @jdx in [#13056](#13056) ### π¦οΈ Dependency Updates - update rust crate aube-registry to v2.2.14 by @renovate[bot] in [#13015](#13015) - update communique to v1.4.0 by @jdx in [#13104](#13104) - update rattler by @renovate[bot] in [#12966](#12966) - update rust crate aube to v2.2.14 by @renovate[bot] in [#13014](#13014) - update rust crate usage-lib to v6.9.0 by @renovate[bot] in [#12892](#12892) - update rust crate usage-cli to v6.9.0 by @renovate[bot] in [#12891](#12891) ### π¦ Registry - add mpv (conda:mpv) by @i-api in [#13049](#13049) - use conda for postgres, redis, and mongodb by @jdx in [#13061](#13061) - add agent-browser by @3w36zj6 in [#13088](#13088) - add himalaya ([github:pimalaya/himalaya](https://github.com/pimalaya/himalaya)) by @i-api in [#13091](#13091) - fix editorconfig-checker 4.0.1 by @jdx in [#13098](#13098) - fix mc downloads from MinIO releases by @jdx in [#13113](#13113) ### Chore - **(ci)** replace actionlint with zizmor by @jdx in [#13097](#13097) ### Ci - increase vfox runner memory by @jdx in [#13118](#13118) ### New Contributors - @lil-lon made their first contribution in [#13108](#13108) ## π¦ Aqua Registry Updates ### New Packages (1) - [`getgaal/gaal`](https://github.com/getgaal/gaal) ### Updated Packages (1) - [`yadm-dev/yadm`](https://github.com/yadm-dev/yadm)
Problem
mise bootstrap packages applyreports formulae likebrew:zip/brew:unzipas installed on Linux, but their commands never appear in
<prefix>/bin. Thekegs are poured, yet no symlinks are created because the formulae are marked
keg-only β even though these formulae are keg-only only because macOS already
provides them, and brew itself links them normally on Linux.
Cause
mise deserializes only the
keg_onlybool from the formulae.brew.sh JSON andignores the adjacent
keg_only_reasonobject.link_kegthen skips prefixlinking whenever the bool is true, with no OS or reason check. Homebrew's own
KegOnlyReason#applicable?returns false outside macOS for the:provided_by_macos/:shadowed_by_macosreasons, so brew links theseformulae on Linux while mise does not.
Change
keg_only_reasonand addFormula::keg_only_for_target(), mirroringbrew's
KegOnlyReason#applicable?: macOS-tied reasons do not apply on otherOSes;
:versioned_formula, free-text reasons, and a missing reason staykeg-only everywhere.
link_kegcall sites (bottle pour and source build).link_kegitself is unchanged; the policy decision moves to the callers.keg_onlyreason and emits it inthe same shape as the API JSON, so tapped formulae behave the same way.
macOS behavior is unchanged by construction.
Tests
test_system_install_brew_linux):brew:unzipends up with<prefix>/bin/unziplinked, no.mise-keg-onlymarker, and a runnablebinary.
Verification
Passing locally:
cargo test --all-features system::packages::brewmise run lintcargo clippy --workspace --all-features --all-targets -- -D warningsKnown limitation
Kegs already installed by earlier mise versions keep their
.mise-keg-onlymarker and stay unlinked; the repair path intentionally does not consult
formula metadata. They are fixed by the next formula version bump via
mise bootstrap packages upgrade, or by removing the keg and re-runningmise bootstrap packages apply.AI-assisted β Tool: Claude Code; model: anthropic/claude-fable-5; version: unavailable.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation