Open keith opened 4 years ago
After a bit more investigation the problem is that apple_binary
only takes linkopts
from the ObjcProvider
into account:
and objc_library
collects the linkopts
from its transitive cc_library
dependents: https://github.com/bazelbuild/bazel/blob/220a1c8414d92cf59c469591c19274d384109f0b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java#L382-L406
but swift_library
does not. Ideally apple_binary
would collect the linkopts
from all its transitive CcInfo
s. Alternatively swift_library
could be changed to propagate cc_library
's linkopts
with the ObjcProvider
it propagates.
When you have targets like these:
The invalid
linkopts
fromcc_library
are ignored.Sample project: linkopts.zip
Run
bazel build test
which should fail to link.