Conversation
bazel/swift_header_collector.bzl
Outdated
| dep = ctx.attr.deps[0] | ||
| return [ | ||
| DefaultInfo( | ||
| files = dep[CcInfo].compilation_context.headers, |
There was a problem hiding this comment.
AFAIK since this is a direct dep there cannot be more than 1 in this list, but I could filter by ones ending with -Swift.h if that wasn't the case.
There was a problem hiding this comment.
From what I saw in the past we only had one here IIRC, so this is prob fine
|
Depends on #796 |
bazel/swift_header_collector.bzl
Outdated
| dep = ctx.attr.deps[0] | ||
| return [ | ||
| DefaultInfo( | ||
| files = dep[CcInfo].compilation_context.headers, |
There was a problem hiding this comment.
From what I saw in the past we only had one here IIRC, so this is prob fine
library/swift/src/BUILD
Outdated
|
|
||
| swift_header_collector( | ||
| name = "collector", | ||
| deps = ["lib"], |
There was a problem hiding this comment.
Does this change make it possible for us to split out the above code into different libraries and still collect them into one framework here?
There was a problem hiding this comment.
not particularly right here, but overall it depends on how you want to split things up. if you have public API in multiple modules I don't think that will end up working in a single framework, but if you have other internal modules like the EnvoyEngine objc is acting as here now, you could include that in private_deps and have as many as you want. But I think no matter what you'll have to be able to @_implementationOnly import them
With this change we can remove our custom swift_static_framework rule and replace it with the rules_apple ios_static_framework rule. There are a few behavioral differences here that required other changes. 1. ios_static_framework uses `-enable-library-evolution`, which means we get a `swiftinterface` file instead of a `swiftmodule`. This opts us in to having to guarantee some level of binary compatibility (once we hit 1.0 at least) but has the benefit of not requiring consumers to be on the exact same Xcode version as what we build with 2. To Support #1 we had to remove the bridging header use, this was previously required because if we imported the Objective-C dependency directly it also had to be shipped to consumers. Now we use `@_implementationOnly` imports with this, and consume it with `private_deps` so it's not exposed to consumers at all. This is a new-ish private feature in the Swift compiler to support this type of use case. 3. To propagate the correct header with the framework so that it can be imported by Objective-C (which isn't automatically done by rules_swift / rules_apple bazelbuild/rules_swift#291) we need to access it from the swift_library target, which I wrote a tiny rule to do. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
ba42f26 to
ce6b7b8
Compare
|
Might actually depend on bazelbuild/rules_apple#753 |
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
|
Potential fix for the duplicate symbol issue I'm seeing currently bazelbuild/rules_swift#420 |
1 similar comment
|
Potential fix for the duplicate symbol issue I'm seeing currently bazelbuild/rules_swift#420 |
|
Filed an issue for the blocker here bazelbuild/bazel#11223 |
This is an in between to #797 which starts building the archive with swiftinterface files, but does it with our existing swift_static_framework rule because of issues linked on that PR. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
This is an in between to #797 which starts building the archive with swiftinterface files, but does it with our existing swift_static_framework rule because of issues linked on that PR. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This is an in between to #797 which starts building the archive with swiftinterface files, but does it with our existing swift_static_framework rule because of issues linked on that PR. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This is an in between to #797 which starts building the archive with swiftinterface files, but does it with our existing swift_static_framework rule because of issues linked on that PR. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
This is an in between to #797 which starts building the archive with swiftinterface files, but does it with our existing swift_static_framework rule because of issues linked on that PR. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
This is an in between to #797 which starts building the archive with swiftinterface files, but does it with our existing swift_static_framework rule because of issues linked on that PR. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
With this change we can remove our custom swift_static_framework rule
and replace it with the rules_apple ios_static_framework rule. There are
a few behavioral differences here that required other changes.
-enable-library-evolution, which means weget a
swiftinterfacefile instead of aswiftmodule. This opts usin to having to guarantee some level of binary compatibility (once we
hit 1.0 at least) but has the benefit of not requiring consumers to
be on the exact same Xcode version as what we build with
previously required because if we imported the Objective-C dependency
directly it also had to be shipped to consumers. Now we use
@_implementationOnlyimports with this, and consume it withprivate_depsso it's not exposed to consumers at all. This is anew-ish private feature in the Swift compiler to support this type of
use case.
imported by Objective-C (which isn't automatically done by
rules_swift / rules_apple
Add generated_header to SwiftInfo? bazelbuild/rules_swift#291) we need to
access it from the swift_library target, which I wrote a tiny rule to
do.
Signed-off-by: Keith Smiley keithbsmiley@gmail.com