Skip to content
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

Fix swift-api-digester search paths #7664

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix swift-api-digester search paths #7664

wants to merge 3 commits into from

Conversation

rauhul
Copy link
Member

@rauhul rauhul commented Jun 13, 2024

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.

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.
@rauhul
Copy link
Member Author

rauhul commented Jun 14, 2024

@swift-ci test

@MaxDesiatov
Copy link
Contributor

@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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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...) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public init(arrayLiteral elements: Element...) {
package init(arrayLiteral elements: Element...) {

@MaxDesiatov MaxDesiatov added the needs tests This change needs test coverage label Jun 14, 2024
@MaxDesiatov
Copy link
Contributor

CI compiler crash currently tracked as rdar://129847951

Comment on lines +646 to +658
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
}
Copy link
Contributor

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?

Comment on lines +613 to +629
/// 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()
}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests This change needs test coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants