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

dependency: consider bounds when comparing macOS deps
This commit is contained in:
Bo Anderson 2023-08-29 13:11:41 +01:00 committed by GitHub
commit 98094739c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -231,6 +231,14 @@ class UsesFromMacOSDependency < Dependency
@bounds = bounds
end
def ==(other)
instance_of?(other.class) && name == other.name && tags == other.tags && bounds == other.bounds
end
def hash
[name, tags, bounds].hash
end
def installed?
use_macos_install? || super
end

View File

@ -65,8 +65,6 @@ 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