Comments (4)
I also noticed that
swift_import
takes multiple archives, and multiple swiftmodules, this seems to conflict withnew_objc_provider
which expects only 1 of each of these. Would it be reasonable to either remove the array support fromswift_import
and require multipleswift_import
s per module, or possibly assume the indexes of the libraries line up with their swiftmodules in the definition?
I think we want to retain the ability to list multiple modules and libraries in the rule; in the future I'd like for swift_import
to have smarter handling of framework-based modules (where you have the Modules
subdirectory with a file for each architecture), and it's a much better user experience for the BUILD author to just glob
those and let the compiler sort it out than to select
the right one based on target architecture.
Likewise, requiring indices to line up is fragile, so we should avoid that.
I'll have some feedback on your PR soon—the past couple weeks have been hectic and I'm trying to get some other changes pushed out that might affect your work.
from rules_swift.
I think I see what's happening here.
ios_unit_test
uses apple_binary
underneath to link the binary. Unlike swift_binary
, apple_binary
is a native rule so it doesn't know anything about SwiftInfo
provider; it can only get the libraries that need to be linked from the Objc
provider. We make this work for swift_library
by also creating and propagating an Objc
provider with the library in it: https://github.com/bazelbuild/rules_swift/blob/master/swift/internal/api.bzl#L626
So fixing this should just be a matter of having swift_import
also propagate an Objc
provider.
from rules_swift.
Thanks for the context, I've looked into a fix a bit more for this, it looks like there might be another issue related to this ObjC vs Swift rule. It seems like the SwiftToolchainInfo created here may also not be propagated, leading the the linker flags to the Swift libraries not being included in the final link. Would this make sense?
I also noticed that swift_import
takes multiple archives, and multiple swiftmodules, this seems to conflict with new_objc_provider
which expects only 1 of each of these. Would it be reasonable to either remove the array support from swift_import
and require multiple swift_import
s per module, or possibly assume the indexes of the libraries line up with their swiftmodules in the definition?
from rules_swift.
I've submitted an solution to this problem for discussion #38
from rules_swift.
Related Issues (20)
- Integrating 3rd party framework with Bazel to iOS project HOT 21
- `private_deps` may lost `data` fields which could cause an unexpected resource lost HOT 3
- Multiple swift_library transitions results in duplicate linkopts HOT 11
- rules_swift is failing with Bazel@HEAD in CI HOT 7
- --incompatible_enable_cc_toolchain_resolution + universal tools fails to build HOT 17
- Compiling Sources/CNIOBoringSSL/ssl/tls_method.cc failed in rules_swift 1.11.0 HOT 5
- Error in fail: Compiling objc_library targets requires the Apple CC toolchain HOT 13
- Error index out of range for rules_swift with Bazel@HEAD HOT 6
- Swift Macro Test - build issue - when it depends on the universal plugin HOT 1
- Bug: Incremental compilation cache poisoning HOT 1
- It is not possible to use `@testable` when `compilation_mode=opt` HOT 3
- On Xcode 15, binaries depending on swift_proto_library fail to link with error: duplicate -rpath '/usr/lib/swift' HOT 6
- How to build shared libraries using rule_swift (.so)? HOT 6
- Error in new_objc_provider: Key 'linkopt' no longer supported in ObjcProvider HOT 1
- Error: There is no configuration fragment named 'swift'. Available fragments: 'platform', 'coverage', 'bazel_py', 'android', 'bazel_android', 'apple', 'cpp', 'java', 'j2objc', 'objc', 'proto', 'py' HOT 1
- Duplicate symbol error when migrating to bzlmod HOT 4
- Error adding "apple_core_data_model" dependency to "swift_library" HOT 10
- CC_Library without a tag does not generate a ModuleMap HOT 6
- 'apple_cc_toolchain' is not defined in CI at Bazel@HEAD HOT 1
- Swift Macro - cc_wrapper.sh failed: error executing CppLink command HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_swift.