Merge pull request #15919 from EricFromCanada/macos-deps-caching

dependency_collector: distinguish macOS deps by OS
This commit is contained in:
Mike McQuaid 2023-08-28 17:38:20 +01:00 committed by GitHub
commit 1d136be229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -261,4 +261,9 @@ class UsesFromMacOSDependency < Dependency
def dup_with_formula_name(formula)
self.class.new(formula.full_name.to_s, tags, env_proc, option_names, bounds: bounds)
end
sig { returns(String) }
def inspect
"#<#{self.class.name}: #{name.inspect} #{tags.inspect} #{bounds.inspect}>"
end
end

View File

@ -65,6 +65,8 @@ class DependencyCollector
def cache_key(spec)
if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy
File.extname(spec.url)
elsif spec.is_a?(UsesFromMacOSDependency)
"#{spec.name}-#{spec.bounds}"
else
spec
end