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

Cherry pick upstream #671

Merged
merged 4 commits into from
Aug 11, 2021
Merged

Cherry pick upstream #671

merged 4 commits into from
Aug 11, 2021

Conversation

thii
Copy link
Member

@thii thii commented Aug 11, 2021

No description provided.

allevato and others added 3 commits August 11, 2021 10:12
To my knowledge, this has never been used; consumers can/should access it from the `SwiftInfo` provider instead. Since this is the only remaining custom output group supported by the rules, it's a cleanup opportunity.

PiperOrigin-RevId: 380075418
(cherry picked from commit 6e7efbf)

 Conflicts:
	swift/internal/compiling.bzl
	swift/internal/swift_binary_test.bzl
	swift/internal/swift_grpc_library.bzl
	swift/internal/swift_library.bzl
	swift/internal/swift_module_alias.bzl
	swift/internal/swift_protoc_gen_aspect.bzl
Bazel's implementation of `create_linking_context_from_compilation_outputs` only sets `alwayslink` on a **copy** of the `LibraryToLink` that it merges into the returned `CcLinkingContext`, but **not** on the `LibraryToLink` that is returned in the `CcLinkingOutputs`. This means we can't read it back from that value, as it will always return false.

PiperOrigin-RevId: 380240044
(cherry picked from commit dad2488)
@google-cla
Copy link

google-cla bot commented Aug 11, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Aug 11, 2021
thii referenced this pull request Aug 11, 2021
To my knowledge, this has never been used; consumers can/should access it from the `SwiftInfo` provider instead. Since this is the only remaining custom output group supported by the rules, it's a cleanup opportunity.

PiperOrigin-RevId: 380075418
thii referenced this pull request Aug 11, 2021
Bazel's implementation of `create_linking_context_from_compilation_outputs` only sets `alwayslink` on a **copy** of the `LibraryToLink` that it merges into the returned `CcLinkingContext`, but **not** on the `LibraryToLink` that is returned in the `CcLinkingOutputs`. This means we can't read it back from that value, as it will always return false.

PiperOrigin-RevId: 380240044
thii referenced this pull request Aug 11, 2021
The new `aspect_hints` attribute in Bazel, available on all rules, lets us attach arbitrary providers to targets that `swift_clang_module_aspect` can read. The `swift_interop_hint` rule uses this to provide the module name for whichever target references it in its `aspect_hints`.

A canonical auto-deriving hint is also provided as part of the Swift build rules (in `.../swift:auto_module`), so that the default/recommended behavior of deriving a module name from the target label can be easily obtained without having to declare one's own `swift_module_hint` targets.

This is a more principled approach to handling Swift interop than the current `tags` implementation (which will be removed in a future change), and lets us associate additional metadata easily in the future, including files (for example, custom module maps or APINotes).

PiperOrigin-RevId: 387147846
thii referenced this pull request Aug 11, 2021
This allows rules like `cc_library` to associate a custom module map if needed (however, this should be rare and used sparingly). It also eliminates the need for the `swift_c_module`, which will be removed.

Added analysis tests around the propagation of the module map artifacts.

PiperOrigin-RevId: 387195026
thii referenced this pull request Aug 11, 2021
…using `swift_interop_hint`.

PiperOrigin-RevId: 387355219
thii referenced this pull request Aug 11, 2021
Its functionality has been replaced by `swift_import_hint` and `aspect_hints`.

PiperOrigin-RevId: 387358449
thii referenced this pull request Aug 11, 2021
thii referenced this pull request Aug 11, 2021
thii referenced this pull request Aug 11, 2021
Interop for non-Obj-C rules should now exclusively use `aspect_hints` (see the documentation for `swift_interop_hint`).

PiperOrigin-RevId: 388940287
PiperOrigin-RevId: 387407891
(cherry picked from commit c2d2d59)

 Conflicts:
	swift/internal/linking.bzl
@google-cla
Copy link

google-cla bot commented Aug 11, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@thii thii marked this pull request as ready for review August 11, 2021 01:28
@thii
Copy link
Member Author

thii commented Aug 11, 2021

swift_interop_hint related changes require the new aspect_hints attribute which is not available in Bazel 4.x.

@thii thii merged commit 2b9485b into bazelbuild:master Aug 11, 2021
@thii thii deleted the cherry-pick-upstream branch August 11, 2021 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants