Stop propagating duplicate SwiftUsageInfo providers from swift_usage_aspect#306
Merged
swiple-rules-gardener merged 1 commit intobazelbuild:masterfrom Sep 9, 2019
Conversation
sergiocampama
approved these changes
Sep 9, 2019
Contributor
sergiocampama
left a comment
There was a problem hiding this comment.
this looks reasonable to me, but I'll defer to Tony, since perhaps he didn't intend for this to be a use case, in which case, we'll need to figure out another path
allevato
approved these changes
Sep 9, 2019
Member
allevato
left a comment
There was a problem hiding this comment.
It makes sense to do this, since some custom rules may need to indicate that they "use Swift" in ways that the aspect can't otherwise detect.
Honestly, if provider already there: return [] should probably be present at the beginning of 99% of aspect implementation functions anyway.
swiple-rules-gardener
added a commit
that referenced
this pull request
Sep 9, 2019
…e-swiftusageinfo-providers-from-swift_usage_aspect PiperOrigin-RevId: 267991298
tymurmustafaiev
pushed a commit
to tymurmustafaiev/rules_swift
that referenced
this pull request
Jul 19, 2023
…g-duplicate-swiftusageinfo-providers-from-swift_usage_aspect PiperOrigin-RevId: 267991298
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the changes in bazelbuild/rules_apple#566, the
swift_usage_aspectneeds to handle a new case.If a rule and an aspect both provide the same provider type, bazel raises this error:
src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java#L167
This changes
swift_usage_aspectto not propagate aSwiftUsageInfoif the target already does. Specifically, this makes the updatedapple_static_framework_importwork in apps that have other swift deps.