Skip to content

Fix data on objc_library#632

Open
keith wants to merge 2 commits intobazelbuild:mainfrom
keith:ks/fix-data-on-objc_library
Open

Fix data on objc_library#632
keith wants to merge 2 commits intobazelbuild:mainfrom
keith:ks/fix-data-on-objc_library

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented Mar 12, 2026

Previously this was just ignored, now it is correctly propagated.

Fixes bazelbuild/bazel#16270

@keith keith force-pushed the ks/fix-data-on-objc_library branch 3 times, most recently from f8344ce to 90ff8b4 Compare March 24, 2026 16:30
@armandomontanez armandomontanez added type: bug Something that should be working isn't working P1 I'll work on this now. (Assignee required) platform: darwin category: core rules labels Mar 24, 2026
@keith keith force-pushed the ks/fix-data-on-objc_library branch from 90ff8b4 to daa232b Compare March 27, 2026 16:29
lilygorsheneva
lilygorsheneva previously approved these changes Apr 17, 2026
@hvadehra hvadehra removed their request for review April 18, 2026 20:39
@pzembrod
Copy link
Copy Markdown
Collaborator

pzembrod commented Apr 21, 2026

This breaks a number of internal targets; most with a 'UIKit/UIKit.h' file not found error.

Maybe most targeted is a failure of https://github.com/bazelbuild/bazel/blob/master/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java:

ObjcLibraryTest.testArtifactsToAlwaysBuild fails:

value of: sortedBaseNamesOf(...)
expected: x.o x2.o y.o y2.o
but was : libx.a liby.a x.o x2.o y.o y2.o
	at com.google.devtools.build.lib.rules.objc.ObjcLibraryTest.testArtifactsToAlwaysBuild([ObjcLibraryTest.java:1909](https://cs.corp.google.com/#search/&q=f:com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java:1909&ws=tap-presubmit-rerun-server/134289872&snapshot=2))

Does that repro when running the test with Bazel?

@pzembrod
Copy link
Copy Markdown
Collaborator

Fwiw, almost all tests pass for me if I just comment out the default_runfiles = runfiles, param in the DefaultInfo constructor.

And on that note: would following the second "avoid" in https://bazel.build/extending/rules#runfiles_features_to_avoid be useful guidance here? Honest question on my side, as I don't (yet) know much about this "avoid" guidance.

Previously this was just ignored, now it is correctly propagated.
@keith
Copy link
Copy Markdown
Member Author

keith commented Apr 24, 2026

And on that note: would following the second "avoid" in bazel.build/extending/rules#runfiles_features_to_avoid be useful guidance here? Honest question on my side, as I don't (yet) know much about this "avoid" guidance.

It's a good question on this weirdo branch specifically, especially since we're adding something new. I copied this from cc_library since semantically I think they should work the same way. but idk how common the "old way" is

@keith
Copy link
Copy Markdown
Member Author

keith commented Apr 24, 2026

I fixed the issue with the .a being in the runfiles, that was a bug, updated the tests to verify it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: core rules P1 I'll work on this now. (Assignee required) platform: darwin type: bug Something that should be working isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data attributes are not propagated from objc_library to cc_library or cc_binary

4 participants