-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix incorrect executable target diagnostic #7447
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
Conversation
The determination for executable targets isn't limited to Swift files, it will also find 'main.m' for example. This was originally reflected in the diagnostic, but #3254 updated it incorrectly.
@swift-ci please test |
@@ -953,7 +953,7 @@ public final class PackageBuilder { | |||
{ | |||
self.observabilityScope | |||
.emit( | |||
warning: "'\(potentialModule.name)' was identified as an executable target given the presence of a 'main.swift' file. Starting with tools version \(ToolsVersion.v5_4) executable targets should be declared as 'executableTarget()'" | |||
warning: "'\(potentialModule.name)' was identified as an executable target given the presence of a 'main' file. Starting with tools version \(ToolsVersion.v5_4) executable targets should be declared as 'executableTarget()'" |
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.
How about "given the presence of an entry point file"? Makes it a bit more general.
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.
due to presence of ...
to make it slightly shorter?
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 "entry point file" might be too general, especially in the non-Swift case. There's really no rule outside of SwiftPM that makes "main.m" a special file.
The determination for executable targets isn't limited to Swift files, it will also find 'main.m' for example. This was originally reflected in the diagnostic, but #3254 updated it incorrectly.