-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Validation of package products should check that a library product doesn't try to include executable targets #5625
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
Validation of package products should check that a library product doesn't try to include executable targets #5625
Conversation
@swift-ci please smoke test |
@@ -56,6 +56,10 @@ extension Basics.Diagnostic { | |||
.error("system library product \(product) shouldn't have a type and contain only one target") | |||
} | |||
|
|||
static func libraryProductWithExectuableTarget(product: String) -> Self { | |||
.error("library product '\(product)' should not contain an executable 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.
Should the message contain the name(s) of the executable targets? Would make it easier for folks to resolve the issue.
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.
+1 if possible
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.
Good point.
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 was trying to match the existing style but can add the target names to some of the other messages here that don't have it.
…esn't try to include executable targets Currently a library product that includes an executable target in its `targets` array only results in a warning. This was the best that could be done before `executableTarget` was introduced, since further checking was needed to see if a `target` was a library or executable target. Since we have explicit types now, we should promote this to an error since people are running into it and it's not clear what the problem is. This check is limited to tools version 5.7 or later. This change includes a new test fixture and unit test. rdar://95782540
1ea317b
to
64834c5
Compare
@swift-ci please smoke test |
Added the target names to this new message. We can go back and add to the existing messages in a separate PR. |
…uct doesn't try to include executable targets (swiftlang#5625) Currently a library product that includes an executable target in its `targets` array only results in a warning. This was the best that could be done before `executableTarget` was introduced, since further checking was needed to see if a `target` was a library or executable target. Since we have explicit types now, we should promote this to an error since people are running into it and it's not clear what the problem is. This check is limited to tools version 5.7 or later. This change includes a new test fixture and unit test. rdar://95782540 (cherry picked from commit 5bd3355)
…uct doesn't try to include executable targets (#5625) (#5629) Currently a library product that includes an executable target in its `targets` array only results in a warning. This was the best that could be done before `executableTarget` was introduced, since further checking was needed to see if a `target` was a library or executable target. Since we have explicit types now, we should promote this to an error since people are running into it and it's not clear what the problem is. This check is limited to tools version 5.7 or later. This change includes a new test fixture and unit test. rdar://95782540 (cherry picked from commit 5bd3355)
Currently a library product that includes an executable target in its
targets
array only results in a warning. This was the best that could be done beforeexecutableTarget
was introduced, since further checking was needed to see if atarget
was a library or executable target. Since we have explicit types now, we should promote this to an error since people are running into it and it's not clear what the problem is.This check is limited to tools version 5.7 or later. This change includes a new test fixture and unit test.
rdar://95782540