data attributes are not propagated from objc_library to cc_library or cc_binary
Description of the bug:
When building a cc_binary with objc_library as dependency , the data in objc_library is not copied as runfile for the cc_binary.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Which operating system are you running Bazel on?
macOS 12.2.1 on m1
What is the output of bazel info release?
release 5.2.0
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
No response
Have you found anything relevant by searching the web?
https://github.com/bazelbuild/bazel/issues/11425 is possibly related
Any other information, logs, or outputs that you want to share?
No response
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.
Hello, I'm having the same issue with release 7.1.0. Have you found a workaround? Thanks.
@keith Does this have anything to do with the Objective-C transition (#16870)?
@yyuting On the basis of just a hunch, you can try --incompatible_disable_objc_library_transition. It will probably break numerous other things in your larger project however.
I don't think so but I haven't tested. I assume that there's somewhere in the data collection that's only looking at certain rule types but I haven't looked. I imagine if we could find the spot it could be an easy fix
Looking at objc_library.bzl, it doesn't seem to be doing anything with ctx.attr.data and instead only returns the output archives as data_runfiles (which also seems unnecessary).
I imagine data has mostly been ignored there because most apple app resources are handled differently
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
Still relevant for non-Apple platforms. On Apple platforms, there are now workarounds using an aspect that controls resource collecting.