Open AttilaTheFun opened 1 year ago
You need the ios
key right now, like:
ios = {
"simulator": [
"arm64",
"x86_64",
],
"device": [
"arm64",
],
},
If that's the issue we should def improve the error. It's not required for the future and supporting other platforms I guess
Hmm @keith so that kinda worked but now it's complaining about transitive deps?
logan@Logans-MBP Snag % bazel build //Libraries/FoundationUI/ViewFoundationUI:ViewFoundationUIFramework
Starting local Bazel server and connecting to it...
ERROR: /Users/logan/Developer/Swift/Apps/Snag/Libraries/FoundationUI/ViewFoundationUI/BUILD:18:18: in apple_xcframework rule //Libraries/FoundationUI/ViewFoundationUI:ViewFoundationUIFramework:
Traceback (most recent call last):
File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/build_bazel_rules_apple/apple/internal/xcframework_rules.bzl", line 668, column 45, in _apple_xcframework_impl
processor_result = processor.process(
File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/build_bazel_rules_apple/apple/internal/processor.bzl", line 743, column 36, in _process
partial_outputs = [partial.call(p) for p in partials]
File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/bazel_skylib/lib/partial.bzl", line 43, column 28, in _call
return partial.function(*function_args, **function_kwargs)
File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/build_bazel_rules_apple/apple/internal/partials/swift_framework.bzl", line 59, column 61, in _swift_framework_partial_impl
swift_module = swift_info_support.swift_include_info(
File "/private/var/tmp/_bazel_logan/9c5dc880d421e060978209038345ac60/external/build_bazel_rules_apple/apple/internal/swift_info_support.bzl", line 77, column 17, in _swift_include_info
fail(
Error in fail: error: Swift third party frameworks expect a single swift_library dependency with no transitive swift_library dependencies.
ERROR: /Users/logan/Developer/Swift/Apps/Snag/Libraries/FoundationUI/ViewFoundationUI/BUILD:18:18: Analysis of target '//Libraries/FoundationUI/ViewFoundationUI:ViewFoundationUIFramework' failed
ERROR: Analysis of target '//Libraries/FoundationUI/ViewFoundationUI:ViewFoundationUIFramework' failed; build aborted:
INFO: Elapsed time: 6.257s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (81 packages loaded, 2495 targets configured)
I just want to generate a framework from a swift_library target and its transitive dependencies which I can pass to rules_xcodeproj in order to create an xcodeproj that builds the subgraph and can run tests on it. Should I just stick with ios_framework for now? Or is there a better option? My understanding was that Apple was pushing xcframeworks as future because you could just build one for all of their platforms.
the problem is a bundled xcframework can only contain a single swiftmodule file, where as in the ios_framework case you're not creating a bundled thing, you're just creating N frameworks, 1 for each swift_library. But really choosing between those is a matter of what you're trying to do with the thing. If it's just for development I would stay away from xcframeworks since they have different behavior since they expect to be distributed as an artifact to other devs (like enabling library evolution)
I'm trying to build an apple_xcframework from a swift_library target. The swift_library target already builds fine and I can use it in an ios_application without issue.
The xcframework is defined like this:
Where ViewFoundationUI is the swift_library.
I'm trying to build it with:
Which yields the following error: