-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Reset requirement cache (again) after recursive_dependencies.map(&:to_formula)
invalidates singleton cache
#15971
Reset requirement cache (again) after recursive_dependencies.map(&:to_formula)
invalidates singleton cache
#15971
Conversation
class ExampleFormula < Formula
desc "Test"
depends_on "sqitchers/sqitch/sqitch" => "with-postgres-support"
end It looks like this is all it takes to repro (a |
This part of the codebase was changed last week in #15892 but it's not obvious to me at a glance how those changes are related. I wasn't able to get that example working locally for me because I was getting other loading errors (missing url/version). I tried the following but I didn't see any errors. class ExampleFormula < Formula
desc "Test"
url "url"
version "1.1.1"
depends_on "nlohmann/json/nlohmann_json" => "with_cmake"
end I also tried The call to Wait a second, which version of |
You're probably on version |
I think the |
Yep still getting the same on 4.1.8. You can see the stacktrace here: brew/Library/Homebrew/dependency.rb Lines 43 to 47 in d5d7478
brew/Library/Homebrew/formula.rb Lines 271 to 280 in d5d7478
|
Ah yeah, of course. Not sure how I missed that the first time. I'm guessing that this hasn't come up before because we don't use |
I think it's not even as simple as |
@maschwenk Would it be possible to share the full formula that's causing problems here? Neither me or @Bo98 can reproduce right now. I think it's not a problem in |
@apainintheneck Yep i’ll try to extract a reproducible repo, unfortunately current repro is in something I can’t make public. |
@maschwenk In that case, no worries. I just wonder if there's a better way to decide when to bust the cache. Fine with this as is though once tests pass. I looked at core formulae and casks and it seems like we don't bust the cache during |
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 @maschwenk!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew deps <my custom tap>/<my custom formula>
can blow up with
I can't provide a reproduction case at this moment, but the source of the bug seems to be that:
cache[cache_key] ||= {}
on line 225formulae = dependent.recursive_dependencies.map(&:to_formula)
if you look under the hood,to_formula
seems to clear the singleton cache