bazel icon indicating copy to clipboard operation
bazel copied to clipboard

data attributes are not propagated from objc_library to cc_library or cc_binary

Open senchangniantic opened this issue 3 years ago • 6 comments

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.

Archive.zip

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

senchangniantic avatar Sep 13 '22 18:09 senchangniantic

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.

github-actions[bot] avatar Dec 31 '23 01:12 github-actions[bot]

Hello, I'm having the same issue with release 7.1.0. Have you found a workaround? Thanks.

yyuting avatar Oct 11 '24 18:10 yyuting

@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.

jiawen avatar Oct 11 '24 21:10 jiawen

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

keith avatar Oct 12 '24 00:10 keith

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).

fmeum avatar Oct 12 '24 08:10 fmeum

I imagine data has mostly been ignored there because most apple app resources are handled differently

keith avatar Oct 12 '24 14:10 keith

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.

github-actions[bot] avatar Dec 17 '25 01:12 github-actions[bot]

Still relevant for non-Apple platforms. On Apple platforms, there are now workarounds using an aspect that controls resource collecting.

jiawen avatar Dec 17 '25 15:12 jiawen