Replies: 1 comment 1 reply
|
Thanks for writing this up before opening another PR — that was the right call. I dug into it, and I think the framing of all three options is more elaborate than the problem actually needs. There's a fourth answer: match what Homebrew itself serializes.
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
How should mise handle valid cask declarations that depend on files only available after archive extraction?
AeroSpace is the example I encountered: its manpage glob prevents Ruby metadata extraction, blocking installation of the app and CLI even though mise currently skips static
manpageartifacts. I'd like to agree on a general approach before opening another PR—not add an AeroSpace-specific exception or require changes to individual taps.This follows the now-closed discussion #13163. The narrower fixes for
HOMEBREW_PREFIX(#13199) and nested app names (#13200) have merged; the staged-file-dependent declaration remains a separate issue.Concrete example
The intended configuration is:
The AeroSpace 0.21.3-Beta cask contains:
Evaluating that unmodified cask with the metadata shim from mise commit
9caff417, using Ruby 4.0.7 and macOS/ARM metadata inputs, fails with:As a metadata-only experiment, defining
staged_pathas a nonexistent directory allows extraction to succeed with both ARM and Intel metadata inputs. It retains the app, CLI, three completion binaries, and two structured postflight commands, but the glob matches nothing and silently omits the manuals. No archive was downloaded or application installed in this test; it does not establish end-to-end compatibility.I don't propose shipping that placeholder workaround: its result depends on filesystem state, and indiscriminately suppressing globs could also hide required app or binary declarations.
Why this needs a design decision
#10671 added explicit skipping of static
manpageartifacts so casks containing them could install. That behavior remains in the cask artifact dispatcher.Here, Ruby evaluates
staged_pathand the glob before that skip behavior can apply. Makingmanpagea no-op alone therefore cannot fix it. There are two separable questions: how to represent file-dependent declarations, and whether to install the resulting manuals.Possible approaches
Preserve symbolic declarations; explicitly skip unsupported manpage installation. Represent staged paths and a supported subset of glob/iteration operations without reading the host filesystem. Retain the cask-provided pattern as metadata, then deliberately skip/report the manpage artifact. No hardcoded paths or cask names, and no manpage installer is required. Arbitrary Ruby filtering, transformations, and file reads would need defined semantics or explicit rejection—not guessed results.
Resolve deferred declarations and implement manpage installation. Preserve the pattern during metadata extraction, expand it against the extracted archive during installation, and install the manuals. This provides fuller cask support but also needs destination validation, ownership tracking, rollback, upgrade cleanup, and removal. My closed, unmerged #13165 explored this broader approach; I'm not assuming that scope is the preferred solution.
Introduce staged evaluation for file-dependent declarations. Discover download information first, then evaluate applicable declarations against real extracted files during installation. This could support more Ruby patterns than symbolic evaluation, but requires separating discovery from lifecycle execution, preserving sandboxing, and defining what dry-run can report without downloading the archive. Manpage installation could still be a separate decision.
Questions
I'd like the solution to generalize to other valid casks without per-cask exceptions, while keeping unsupported behavior explicit and the initial scope reviewable.
AI-assisted — Tool: Pi; model: openai-codex/gpt-6-astra; version: 0.85.1.
All reactions