Skip to content

fix(deps): install Homebrew uses_from_macos dependencies on Linux - #14288

Merged
jdx merged 4 commits into
jdx:mainfrom
itskyf:fix/brew-uses-from-macos-linux-deps
Oct 11, 2026
Merged

jdx merged 4 commits into
jdx:mainfrom
itskyf:fix/brew-uses-from-macos-linux-deps

Conversation

@itskyf

@itskyf itskyf commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On Linux, brew:chafa could install successfully through mise bootstrap packages but fail at runtime with libbz2.so.1.0: cannot open shared object file.

FreeType declares uses_from_macos "bzip2" in Homebrew's formula metadata. Homebrew requires that formula on Linux, but mise's bottle dependency resolver did not include uses_from_macos in its dependency closure.

This change resolves those dependencies on Linux, including transitive dependencies and per-bottle platform variations. It excludes optional and test-only dependencies, installs build-only dependencies for source builds, and shares the dependency selection logic with the source-build environment. macOS behavior is unchanged.

Verification

Validated in a Fedora Podman container as a non-root user:

  • cargo fmt --all -- --check — passed
  • cargo test --all-features — passed
  • cargo clippy --workspace --all-features --all-targets -- -D warnings — passed
  • Fresh mise bootstrap packages apply brew:chafa — passed; brew:bzip2 was installed automatically
  • chafa --version and ANSI rendering of an image downloaded from an online URL — passed

Regression tests cover metadata variations, runtime/build/test/optional dependency tags, Linux bottle installation dependencies, and source-build dependencies.

AI-assisted — Tool: ChatGPT; model: openai/GPT-6; version: unavailable.

Summary by CodeRabbit

  • New Features
    • Linux package installs now include runtime dependencies listed for macOS. Source builds also include dependencies marked for building; bottle installs do not.
    • Dependency lists can vary by bottle tag, with variation-specific lists taking precedence over formula-level lists. Tagged dependencies are included according to their runtime or build classification.
  • Bug Fixes
    • Build environment dependency discovery now follows the full install dependency set, including each dependency’s runtime requirements.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 08c4a24a-2424-43c6-ac1f-30e962e28266

📥 Commits

Reviewing files that changed from the base of the PR and between a3f4be0 and 393774a.


📒 Files selected for processing (1)
  • crates/mise-brew-metadata/src/lib.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

Homebrew metadata now parses uses_from_macos dependencies and tag-specific overrides. Linux install resolution includes eligible runtime dependencies, and Linux source builds also include eligible build dependencies. Source-build dependency traversal starts from install_deps and follows each dependency’s runtime_deps.

Changes

Homebrew macOS dependency resolution

Layer / File(s) Summary
Parse and select macOS dependencies
crates/mise-brew-metadata/src/lib.rs
Formula metadata and bottle-tag variations parse uses_from_macos entries as names or tagged mappings. The metadata classifies runtime and build names and selects a tag-specific override when present. Tests cover parsing and selection.
Select install dependencies
src/system/packages/brew/resolve.rs
Linux runtime dependency selection includes eligible uses_from_macos entries. Linux source installs also include eligible build entries, while bottle installs omit them. Tests cover bottle and source-build selection.
Traverse source-build dependencies
src/system/packages/brew/source.rs
Source-build traversal starts from install_deps and follows each dependency’s runtime_deps. The test formula fixture initializes uses_from_macos.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant FormulaMetadata
  participant BrewResolver
  participant SourceBuilder
  FormulaMetadata->>BrewResolver: Provide selected formula and uses_from_macos dependencies
  BrewResolver->>BrewResolver: Select runtime dependencies and source-build dependencies
  BrewResolver->>SourceBuilder: Provide install_deps
  SourceBuilder->>BrewResolver: Request runtime_deps for each dependency
Loading

Suggested reviewers: jdx


Merge Risk: ⚪ Minimal · up to 39377

No actionable merge-blocking risk is identified; the change is mergeable after normal checks.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: installing Homebrew uses_from_macos dependencies on Linux.
Docstring Coverage Passed Docstring coverage is 94.44% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@itskyf
itskyf marked this pull request as ready for review October 11, 2026 07:29
@itskyf
itskyf force-pushed the fix/brew-uses-from-macos-linux-deps branch from c55fd24 to a3f4be0 Compare October 11, 2026 09:40
Include platform-specific dependencies from Homebrew formula metadata in
Linux runtime and source-build dependency resolution. This fixes missing
libbz2 for packages depending on freetype, such as chafa.

Add regression coverage for runtime, build-only, test-only, and
platform-variation dependency metadata.
Exercise the bottled FreeType dependency selection separately from
source builds, and exclude optional uses_from_macos formulae from
the default dependency closure.
@itskyf
itskyf force-pushed the fix/brew-uses-from-macos-linux-deps branch from a3f4be0 to 393774a Compare October 11, 2026 11:24
@jdx
jdx merged commit 3580aef into jdx:main Oct 11, 2026
45 checks passed
jdx pushed a commit that referenced this pull request Oct 13, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/640
<!-- entire-trail-link-end -->

### 🚀 Features

- **(bootstrap)** add apt repositories and PPAs with
[bootstrap.apt.sources] by @jdx in
[#14306](#14306)
- **(bootstrap)** embed apt source signing keys inline in .sources files
by @jdx in [#14348](#14348)
- **(bootstrap)** render templates in [bootstrap.repos] checkout paths
by @jdx in [#14359](#14359)
- **(bootstrap)** declare macOS login items by @jdx in
[#14354](#14354)
- **(bootstrap)** layer dnf packages with rpm-ostree on Fedora Atomic
hosts by @jdx in [#14357](#14357)
- **(bootstrap)** support run0 and doas for privilege elevation by @jdx
in [#14351](#14351)
- **(dotfiles)** show tracked entries that no variant selects in status
by @jdx in [#14266](#14266)
- **(dotfiles)** group mise dot status into sections by @jdx in
[#14361](#14361)
- **(github)** add oauth_copy_code to copy the device code to the
clipboard by @jdx in [#14269](#14269)
- **(github)** keep the native OAuth refresh token in a password manager
or keychain by @jdx in [#14360](#14360)
- **(http)** add libc() and avx2() template functions by @jdx in
[#14298](#14298)
- **(pypi)** read upload times from PEP 691 simple indexes by @jdx in
[#14352](#14352)
- **(rust)** download rustup-init from RUSTUP_UPDATE_ROOT by @jdx in
[#14356](#14356)

### 🐛 Bug Fixes

- **(aqua)** warn once for packages with no repo to list versions from
by @jdx in [#14336](#14336)
- **(backend)** keep decoded download file names inside the download
directory by @JamBalaya56562 in
[#14274](#14274)
- **(bootstrap)** support dnf package groups by @jdx in
[#14347](#14347)
- **(bootstrap)** don't print a stdin-only helper as a manual command by
@jdx in [#14350](#14350)
- **(bootstrap)** explain why dnf packages cannot install on ostree
hosts by @jdx in [#14353](#14353)
- **(brew)** install bottle etc files and run post_install_steps when
pouring by @jdx in [#14272](#14272)
- **(brew)** refuse to chown a prefix owned by another user by @jdx in
[#14345](#14345)
- **(brew)** preserve protected post-install copy destinations by @jdx
in [#14311](#14311)
- **(brew-cask)** support generate completions in evaluated casks by
@pmmmwh in [#14255](#14255)
- **(docker)** install libatomic1 in the Debian image so Node.js 26 runs
by @jdx in [#14303](#14303)
- **(dotfiles)** keep existing ciphertext when an encrypted file is
unchanged by @jdx in [#14300](#14300)
- **(dotfiles)** stop a newly selected profile from deleting its shared
file by @jdx in [#14275](#14275)
- **(dotfiles)** restore config entries when adopting under a symlinked
home by @jdx in [#14315](#14315)
- **(dotfiles)** show per-file diffs for directory copy entries in dot
diff by @jdx in [#14333](#14333)
- **(dotfiles)** apply mise's own config before planning the other
entries by @jdx in [#14339](#14339)
- **(go)** read an exact go line in go.mod as the toolchain version by
@jdx in [#14308](#14308)
- **(http)** retry artifact downloads started by mise exec and shims by
@jdx in [#14342](#14342)
- **(npm)** resolve unlocked latest to the npm version of a graph-locked
install by @jdx in [#14307](#14307)
- **(npm)** give unlocked requests their own install under the identity
layout by @jdx in [#14309](#14309)
- **(oci)** ignore host apt hooks when installing apt bootstrap packages
by @jdx in [#14296](#14296)
- **(packslip)** let a workflow list carry the signer pin across a
workflow move by @jdx in
[#14338](#14338)
- **(packslip)** keep a renamed project's lockfile signer under packslip
1.7 by @jdx in [#14362](#14362)
- **(prune)** keep a uv-locked pipx tool's installs for every Python by
@jdx in [#14335](#14335)
- **(prune)** keep versions of task-scoped tools by @jdx in
[#14334](#14334)
- **(schema)** accept [bootstrap.secrets] by @JamBalaya56562 in
[#14322](#14322)
- **(schema)** accept [bootstrap.groups] and [bootstrap.users] by
@JamBalaya56562 in [#14340](#14340)
- **(schema)** accept table forms for vars._.file and vars._.source by
@JamBalaya56562 in [#14383](#14383)
- **(shim)** keep other projects' command wrappers on reshim by @jdx in
[#14355](#14355)
- **(task)** bump gix so remote tasks work in git hooks by @any-victor
in [#14316](#14316)
- hide the Windows console for the tool-update service by @jdx in
[#14344](#14344)

### 🚜 Refactor

- replace serde_yaml with serde-saphyr by @jdx in
[#14328](#14328)

### 📚 Documentation

- **(bootstrap)** explain when to use --from versus --adopt by @jdx in
[#14301](#14301)
- **(bootstrap)** recommend fish = "auto" for fish shell activation by
@jdx in [#14304](#14304)
- **(dotfiles)** explain when to use sync, pull, and apply by @jdx in
[#14343](#14343)
- **(shims)** explain how to check whether a tool is installed by @jdx
in [#14337](#14337)
- switch body text to DM Sans and tighten the releases page by @jdx in
[#14302](#14302)
- self-host DM Sans and JetBrains Mono so they load on mise.jdx.dev by
@jdx in [#14310](#14310)

### 🧪 Testing

- **(bootstrap)** don't depend on bc being absent in the apt sources
test by @jdx in [#14371](#14371)

### 📦️ Dependency Updates

- install Homebrew uses_from_macos dependencies on Linux by @itskyf in
[#14288](#14288)
- bump packslip to 1.7.0 by @jdx in
[#14363](#14363)
- lock file maintenance by @renovate[bot] in
[#14320](#14320)
- update github actions by @renovate[bot] in
[#14380](#14380)
- update dependency python to v3.14.8 by @renovate[bot] in
[#14381](#14381)
- update rust crates by @renovate[bot] in
[#14382](#14382)
- update docker images by @renovate[bot] in
[#14379](#14379)

### 📦 Registry

- install opencode 2 from npm by @jdx in
[#14295](#14295)

### Chore

- **(ci)** switch to jactionlint v2 and drop zizmor by @jdx in
[#14256](#14256)
- fix CI for the aqua registry update and the unsafe-libyaml advisory by
@jdx in [#14326](#14326)

### Ci

- double the unit-macos job timeout by @jdx in
[#14346](#14346)

### Security

- **(config)** require trust for path: tool versions by @jdx in
[#14358](#14358)

### New Contributors

- @pmmmwh made their first contribution in
[#14255](#14255)
- @itskyf made their first contribution in
[#14288](#14288)

## 📦 Aqua Registry Updates

### New Packages (3)

- [`Alice39s/xmtr`](https://github.com/Alice39s/xmtr)
-
[`bufbuild/protoschema-plugins/protoc-gen-jsonschema`](https://github.com/bufbuild/protoschema-plugins)
- [`takumin/qemu-bin`](https://github.com/takumin/qemu-bin)

### Updated Packages (3)

- [`bootandy/dust`](https://github.com/bootandy/dust)
-
[`connectrpc/connect-go/protoc-gen-connect-go`](https://github.com/connectrpc/connect-go)
- [`sharkdp/hyperfine`](https://github.com/sharkdp/hyperfine)
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.

2 participants