New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul Formula/Cask JSON generation #14615
Overhaul Formula/Cask JSON generation #14615
Conversation
Review period skipped due to |
See Homebrew/brew#14615 This will set placeholder values in the generated hash.
39b1f27
to
074490f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, thanks! Good we managed to get this in for 4.0.0 as I initially thought it might've been too late.
I think this covers the last of the known cask issues, which is excellent news.
The slight snag to be aware of is we might be breaking people until their next auto-update if we're generating the JSON with the new placeholders right away (same scenario as #14611).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I think this is a good idea. A few thoughts...
I wonder what the performance implications are for this when calling brew info --json=v2 --eval-all
though that's not something we need to necessarily figure out now.
It would be nice to see some regression tests here.
And like @Bo98 I'm a bit confused about this only being enabled by default in Cask#to_h
when we use Cask#to_hash_with_variations
to generate the API json.
074490f
to
7a192f6
Compare
Added.
Removed from both, will put only in Homebrew/formulae.brew.sh#744 instead. |
7a192f6
to
7b5c338
Compare
- Use constants for placeholders - Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder - Use environment variable to set `Dir.home` consistently to placeholder - Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder - Use `Cask.generating_hash!` to enable "generating mode" with these patches - Fix `Formula#caveats` from JSON Fixes #14505 Fixes #14595
7b5c338
to
237eec8
Compare
See Homebrew/brew#14615 This will set placeholder values in the generated hash.
See Homebrew/brew#14615 This will set placeholder values in the generated hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @MikeMcQuaid! This looks great, sorry for the review delay!
See Homebrew/brew#14615 This will set placeholder values in the generated hash.
Take a slightly hackier but more reliable method of setting up
$HOMEBREW_PREFIX
,$HOME
and--appdir
.HOMEBREW_PREFIX
consistently to placeholderDir.home
consistently to placeholderappdir
short-circuit to setCask#appdir
consistently to placeholderCask.generating_hash!
to enable "generating mode" with these patchesFormula#caveats
from JSONSee Homebrew/formulae.brew.sh#744 for the formulae.brew.sh side.
Fixes #14505
Fixes #14595