Skip to content

Commit

Permalink
Remove previous isRuntimeCompatible implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov committed Sep 19, 2023
1 parent 45c0cff commit 3c3422a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 0 additions & 8 deletions Sources/Basics/Triple+Basics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,6 @@ extension Triple {
)
}
}

public func isRuntimeCompatible(with triple: Triple) -> Bool {
guard self.isMacOSX, let version = self._macOSVersion, let comparedVersion = triple._macOSVersion else {
return self.tripleString == triple.tripleString
}

return version >= comparedVersion
}
}

extension Triple {
Expand Down
13 changes: 11 additions & 2 deletions Sources/PackageModel/SwiftSDKBundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,17 @@ extension [SwiftSDKBundle] {
for bundle in self {
for (artifactID, variants) in bundle.artifacts {
for variant in variants {
guard variant.metadata.supportedTriples.contains(where: {
hostTriple.isRuntimeCompatible(with: $0)
guard variant.metadata.supportedTriples.contains(where: { variantTriple in
if
hostTriple.arch == variantTriple.arch &&
hostTriple.vendor == variantTriple.vendor &&
hostTriple.os == variantTriple.os &&
hostTriple.environment == variantTriple.environment
{
return hostTriple.osVersion >= variantTriple.osVersion
} else {
return false
}
}) else {
continue
}
Expand Down

0 comments on commit 3c3422a

Please sign in to comment.