-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve check for unsafe flags #2845
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
Improve check for unsafe flags #2845
Conversation
@@ -570,8 +570,11 @@ private final class ResolvedTargetBuilder: ResolvedBuilder<ResolvedTarget> { | |||
} | |||
|
|||
func diagnoseInvalidUseOfUnsafeFlags(_ product: ResolvedProduct) { | |||
let inputTargets = product.targets | |||
let recursiveDependencies = inputTargets.lazy.flatMap { $0.recursiveDependencies() } |
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 should be recursiveTargetDependencies
@@ -570,8 +570,11 @@ private final class ResolvedTargetBuilder: ResolvedBuilder<ResolvedTarget> { | |||
} | |||
|
|||
func diagnoseInvalidUseOfUnsafeFlags(_ product: ResolvedProduct) { | |||
let inputTargets = product.targets | |||
let recursiveDependencies = inputTargets.lazy.flatMap { $0.recursiveDependencies() } | |||
let reachableTargets = Set(inputTargets).union(recursiveDependencies.compactMap { $0.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 worth making this a property of product rather than a local thing
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.
We already have recursiveTargetDependencies
computed property as commented above
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.
nice. your comment above sounded like you wanted the variable to renamed
We prohibit unsafe flags in package dependencies, but the check was only looking at targets which are direct dependencies of a product, not transitive ones. rdar://problem/66499615
5389245
to
b9fcfa4
Compare
@swift-ci please smoke test |
Looks like this ran into the known module cache issue. |
@swift-ci please smoke test |
We prohibit unsafe flags in package dependencies, but the check was only looking at targets which are direct dependencies of a product, not transitive ones.
rdar://problem/66499615