-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 create symbol graph plugin entrypoint #7629
Conversation
The functionality of `createSymbolGraphForPlugin` broke when the internal SwiftPM build graph was split into target and host graphs. A client running `createSymbolGraphForPlugin` on a host target would fail with `unspecified("could not find a target named “<Target-Name>”")` This PR fixes the plugin entry point to search for targets in the host build graph if not found in the target graph. This PR also includes a cosmetic fix for the above error so it renders as `Unspecified: Could not find a target named “MMIOMacros”.`
73a84d3
to
cfe1c75
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
|
||
let buildParameters: BuildParameters = try if destination == .target { | ||
buildSystem.buildPlan.destinationBuildParameters | ||
} else { |
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.
The indentation looks off here
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.
I think this is correct for if
expressions. swift-format
depending on options can reformat this to:
let buildParameters: BuildParameters =
try if destination == .target {
buildSystem.buildPlan.destinationBuildParameters
} else {
buildSystem.buildPlan.toolsBuildParameters
}
// FIXME: dynamic graph | ||
// This should work by requesting a build for a target w/ destination: | ||
// .destination and generating the graph needed on demand instead of | ||
// looking for a preexisting matching target. |
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.
Maybe we should add a func buildsetFor(target: String) throws -> Buildset
to BuildSystem
protocol which would encapsulate most of the logic here and allow you to select appropriate build parameters based on resulting buildset.
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.
I think the client should be able to request any module built for the target/destination platform and we should create the graph that does that. Is that what you're suggesting here?
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.
Yes, client would pass a name and we'd start with .destination
and if that doesn't exist produce a .host
if it's appropriate.
…t builds Supersedes swiftlang#7629
…t builds Supersedes swiftlang#7629
Superseded by #7646 |
The functionality of
createSymbolGraphForPlugin
broke when the internal SwiftPM build graph was split into target and host graphs. A client runningcreateSymbolGraphForPlugin
on a host target would fail withunspecified("could not find a target named “<Target-Name>”")
This PR fixes the plugin entry point to search for targets in the host build graph if not found in the target graph.
This PR also includes a cosmetic fix for the above error so it renders as
Unspecified: Could not find a target named “MMIOMacros”.