rules_swift icon indicating copy to clipboard operation
rules_swift copied to clipboard

Depending on a framework in the root of the WORKSPACE fails

Open keith opened this issue 5 years ago • 1 comments

If you have a pre-compiled framework vended by apple_static_framework_import in the root of your WORKSPACE, if you depend on it from a swift_library rule you will get a strange build failure:

<unknown>:0: error: unknown argument: '-disable-autolink-framework'

because rules_swift ends up passing -F without a path since paths.dirname resolves to an empty string on a single component:

-Ibazel-out/ios-x86_64-min10.0-applebin_ios-ios_x86_64-dbg/bin
-F
-Xfrontend
-disable-autolink-framework
-Xfrontend
RxSwift

I'm not sure this is worth solving but if so we need to change https://github.com/bazelbuild/rules_swift/blob/cd5f5ec01f2a91cf21452c32b47588c61ff8e231/swift/internal/compiling.bzl#L377 to a function that returns paths.dirname or ..

keith avatar Apr 16 '19 21:04 keith

I just ran into this right now, moving the Framework into a subdirectory from the WORKSPACE fixed it

tinder-maxwellelliott avatar Jul 15 '20 00:07 tinder-maxwellelliott