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 incorrect executable target diagnostic #7447

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neonichu
Copy link
Member

@neonichu neonichu commented Apr 9, 2024

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.

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.
@neonichu neonichu requested a review from owenv April 9, 2024 18:32
@neonichu neonichu self-assigned this Apr 9, 2024
@neonichu
Copy link
Member Author

neonichu commented Apr 9, 2024

@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()'"
Copy link
Member

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.

Copy link
Member

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?

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants