Repository navigation
feat(brew): support generic cask artifacts - #11963
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Greptile SummaryThe PR adds generic Homebrew cask artifacts, including prefix-target installation, transactional protection and recovery, receipt tracking, obsolete-target cleanup, and fd-relative filesystem operations for unprivileged Unix paths.
Confidence Score: 3/5The PR does not yet appear safe to merge because elevated generic-artifact operations can still be redirected outside the validated Homebrew prefix after a mutable path component is replaced. The descriptor-bound changes protect unprivileged copying, cleanup, and rollback, but elevated copy, mkdir, cleanup, rollback, and recovery retain only canonicalized pathnames and pass them to sudo helpers that resolve them again after validation. Files Needing Attention: src/system/packages/brew/cask.rs Important Files Changed
Reviews (48): Last reviewed commit: "feat(brew): support generic cask artifac..." | Re-trigger Greptile |
Instruction counts
No instruction-count regression above 1%. Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.
|
eec445d to
ff61c32
Compare
7a3a4f5 to
71b95c4
Compare
71b95c4 to
cf98329
Compare
cf98329 to
5544d49
Compare
5544d49 to
82238cf
Compare
82238cf to
50ab820
Compare
50ab820 to
6c804e8
Compare
6c804e8 to
d4a9adf
Compare
c186fce to
0b06681
Compare
0b06681 to
07f5c21
Compare
07f5c21 to
4ac842b
Compare
25b7c09 to
a4caba3
Compare
a4caba3 to
d75e37d
Compare
d75e37d to
bd62b7e
Compare
bd62b7e to
0445f2e
Compare
0bc8f8b to
e3894b6
Compare
102169b to
347a3e9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dcdd73a. Configure here.

Summary
artifactstanzasContext
This is the second PR in the cask lifecycle stack. It builds on #11962 and covers the generic prefix artifacts used by
libcbliteandlibcblite-community.Stack
Validation
cargo test --bin mise system::packages::brew::cask::tests -- --test-threads=1cargo clippy --tests --bin mise -- -D warningscargo fmt --allgit diff --checkAI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.
Note
Medium Risk
Large new code path that writes under the Homebrew prefix and may elevate via sudo, but targets are constrained and heavily validated with extensive tests.
Overview
Adds Homebrew cask
artifactsupport so staged trees can be copied into$HOMEBREW_PREFIX(e.g.libcbliteinclude dirs), with docs updated to list generic prefix artifacts alongside existing cask types.Install path copies files or directories into prefix-relative targets, records them on the cask receipt, cleans up obsolete paths on upgrade, and wires the install into the existing flight/transaction journal. Flight rollback now distinguishes elevated vs trusted unprivileged backups via an
elevateflag on recovery records.Security-focused Unix plumbing: openat-based trusted parent traversal, prefix/symlink validation, private staging directories, optional sudo when targets are root-owned, and
nixdir/fsfeatures for safe copies (including fcopyfile on macOS). Permission-denied detection also treats wrappednix::errnoerrors as retry-with-sudo cases. Generic artifacts are excluded from prune-safe casks.Reviewed by Cursor Bugbot for commit 222fc68. Bugbot is set up for automated code reviews on this repo. Configure here.