-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix swift-api-digester
search paths
#7664
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
base: main
Are you sure you want to change the base?
Conversation
Fixes an architecture and implementation bug where the include paths for `swift-api-digester` were being determined inside build plan instead of by the target build description. This is effectively the same change as #7621 but for api-digester rather than symbolgraph-extract. This commit also leaves hooks in to enable api-digester on clang modules as a future improvement.
@swift-ci test |
@swift-ci test linux |
@@ -97,6 +97,16 @@ public struct IdentifiableSet<Element: Identifiable>: Collection { | |||
public func contains(id: Element.ID) -> Bool { | |||
self.storage.keys.contains(id) | |||
} | |||
|
|||
public func filter(_ isIncluded: (Self.Element) throws -> Bool) rethrows -> Self { |
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.
public func filter(_ isIncluded: (Self.Element) throws -> Bool) rethrows -> Self { | |
package func filter(_ isIncluded: (Self.Element) throws -> Bool) rethrows -> Self { |
@@ -118,3 +128,9 @@ extension IdentifiableSet: Hashable { | |||
} | |||
} | |||
} | |||
|
|||
extension IdentifiableSet: ExpressibleByArrayLiteral { | |||
public init(arrayLiteral elements: Element...) { |
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.
public init(arrayLiteral elements: Element...) { | |
package init(arrayLiteral elements: Element...) { |
CI compiler crash currently tracked as rdar://129847951 |
package func apiDigesterEmitBaselineArguments() throws -> [String] { | ||
var args = [String]() | ||
args += try self.apiDigesterCommonArguments() | ||
return args | ||
} | ||
|
||
/// Determines the arguments needed to run `swift-api-digester` for | ||
/// comparing to an API baseline for this module. | ||
package func apiDigesterCompareBaselineArguments() throws -> [String] { | ||
var args = [String]() | ||
args += try self.apiDigesterCommonArguments() | ||
return args | ||
} |
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.
Unclear what these two methods are for if they just append the result of apiDigesterCommonArguments
to an empty array?
/// Determines the arguments needed to run `swift-api-digester` for emitting | ||
/// an API baseline for a particular module. | ||
public func apiDigesterEmitBaselineArguments(for module: ResolvedModule) throws -> [String] { | ||
guard let description = self.targetMap[module.id] else { | ||
throw InternalError("Expected description for module \(module)") | ||
} | ||
return try description.apiDigesterEmitBaselineArguments() | ||
} | ||
|
||
/// Determines the arguments needed to run `swift-api-digester` for | ||
/// comparing to an API baseline for a particular module. | ||
public func apiDigesterCompareBaselineArguments(for module: ResolvedModule) throws -> [String] { | ||
guard let description = self.targetMap[module.id] else { | ||
throw InternalError("Expected description for module \(module)") | ||
} | ||
return try description.apiDigesterCompareBaselineArguments() | ||
} |
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.
Ditto, it looks like these two functions are equivalent
Fixes an architecture and implementation bug where the include paths for
swift-api-digester
were being determined inside build plan instead of by the target build description.This is effectively the same change as #7621 but for api-digester rather than symbolgraph-extract.
This commit also leaves hooks in to enable api-digester on clang modules as a future improvement.