-
-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add utils/backtrace requires #17762
Add utils/backtrace requires #17762
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'm not opposed to this, but it does feel like this shouldn't go in formula.rb
if there is no direct call within this file.
It looks like it's used in 12 files (not including tests and other sorbet stuff). Maybe it's better to add it to those directly instead? I'm not sure how much of a performance difference it makes.
For context, I did this last time (not claiming this is the best way though): https://github.com/Homebrew/brew/pull/17738/files
31694f1
to
cb61340
Compare
cb61340
to
679f84f
Compare
I updated this to cover all the instances that I found where I generally used the approach that @Rylan12 linked to, where One thing to note is that I would appreciate more eyes on this, as I'm not sure if this is the best way to go about it all. |
679f84f
to
79c7334
Compare
This is primarily intended to resolve the `uninitialized constant Utils::Backtrace` error in `formula_versions.rb:60` but I expanded it to try to cover all existing usage of `Utils::Backtrace`. I've followed the existing pattern, where `utils/backtrace` is required in the context of where it's used. Many of these cases use `Backtrace` in a conditional manner, so I've tried to ensure that the `require` follows suit.
79c7334
to
11d6785
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.
Looks great, thanks @samford!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This is primarily intended to resolve the
uninitialized constant Utils::Backtrace
error informula_versions.rb:60
(e.g., https://github.com/Homebrew/homebrew-core/actions/runs/9942660636/job/27464770982?pr=177398, from Homebrew/homebrew-core#177398) but I expanded it to try to cover all existing usage ofUtils::Backtrace
.Per Rylan's comment below, I've followed the existing pattern, where
utils/backtrace
is required in the context of where it's used. Many of these cases useBacktrace
in a conditional manner, so I've tried to ensure that therequire
follows suit.