-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for generating more C files with Swift Build. #9252
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
There currently are restrictions on the ability for build plugins to generate C header, modulemap, and APInote files. This removes those restrictions when using Swift Build and adds the output directory for the plugin to the HEADER_SEARCH_PATH for the target.
@swift-ci please test |
|
||
// With Swift Build on the horizon, we won't add support for generated headers, modulemaps, and apinotes here | ||
for absPath in pluginTargetFiles.headers { | ||
observabilityScope.emit(warning: "Module maps generated by plugins are not supported at this time: \(absPath)") |
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.
This should say headers
observabilityScope.emit(warning: "Module maps generated by plugins are not supported at this time: \(absPath)") | ||
} | ||
for absPath in pluginTargetFiles.moduleMaps { | ||
observabilityScope.emit(warning: "API Notes generated by plugins are not supported at this time: \(absPath)") |
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.
This should say module maps
if absPath.extension == "swift" || toolsVersion >= .v6_3 { | ||
files.sources.insert(absPath) | ||
} else { | ||
observabilityScope.emit(warning: "Only Swift is supported for generated plugin source files at this time: \(absPath)") |
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.
"at this time" is weird now; this should instead mention that it's not supported in the current tools version
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.
Yeah, it's a weird statement. I guess Boris was just trying to give users hope :).
@swift-ci please test |
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 known this change is still in draft, but can we please add tests, trying to follow the test pyramid. Ie: more small (ie: unit test) and less large tests (ie: end-to-end)
I always do ;) |
There currently are restrictions on the ability for build plugins to generate C header, modulemap, and APInote files. This removes those restrictions when using Swift Build and adds the output directory for the plugin to the HEADER_SEARCH_PATH for the target.