-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Remove problematic :final from Requirement sigs #18814
Conversation
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.
I can reproduce the failure locally with brew audit --formula hyperestraier --git --skip-style
so reverting makes sense. It'd also be interesting to find out why this only affects some formulae. I tried a few other formulae locally and they succeeded.
885fc07
to
7b45b32
Compare
Thanks! Used that to discover that it also fails with I can't immediately identify the problem, I suspect it may be a sorbet issue, it will have to wait until I have the bandwidth to dive in though. |
7b45b32
to
ccfc8bf
Compare
Here's the full backtrace for the curious: https://gist.github.com/apainintheneck/0b8154b50940b80f3114e8969cccc0e0 I can't make heads or tails of it. |
It'll be from old formulae: Homebrew/homebrew-core@60003ee#diff-7af2303fb6e63cb2941f96909dcf3eef5cd35a6eab39c1691e4ec06f1d6e3f7a. Errors from basic loading/parsing of old formula must result in a brew/Library/Homebrew/formulary.rb Line 110 in 8d30564
Unfortunately, Sorbet does not map this to an error like they do for |
In any case: while the old syntax is not really supported, some third-party taps do use still use it (because we never really deprecated it) and we probably shouldn't make those formulae completely unreadable: https://github.com/brewsci/homebrew-science/blob/5d14d2fda3934c0eb8243c1cbdb9fb4621ec110b/Formula/lp_solve.rb#L6. Or at least not in a patch release. |
def fatal? = false | ||
end | ||
end | ||
.to raise_error(RuntimeError, /\AThe method `fatal\?` on #{described_class.name} was declared as final/) |
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.
It's interesting that I added this test before I discovered that :final
checks had to be explicitly enabled
So it seems Sorbet is aware of being run in tests, and enables :final
in that context, which was counterproductive in our case…
Thanks for fix @dduugg! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Partial revert of https://github.com/Homebrew/brew/pull/16640/files#diff-b75efe9741aed6830d257b35e55eb243a38c7b187774b42cf26be6deef8990db
We only enabled
:final
enforcement two days ago, which has caused GH Action failures, e.g. https://github.com/Homebrew/homebrew-core/actions/runs/11991937306/job/33431223236?pr=198784#step:3:322