formula: add global caching for declared_runtime_dependencies

This commit is contained in:
Bo Anderson 2023-09-15 03:08:22 +01:00
parent b2cf50bbe1
commit be2834ace8
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -2579,7 +2579,8 @@ class Formula
# Returns a list of Dependency objects that are declared in the formula.
# @private
def declared_runtime_dependencies
recursive_dependencies do |_, dependency|
cache_key = "Formula#declared_runtime_dependencies" unless build.any_args_or_options?
Dependency.expand(self, cache_key: cache_key) do |_, dependency|
Dependency.prune if dependency.build?
next if dependency.required?