Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix objc transition for cc_binary -- simplifying change #19236

Closed
wants to merge 7 commits into from

Conversation

cpsauer
Copy link
Contributor

@cpsauer cpsauer commented Aug 12, 2023

A quick cut at a change that would fix #19204.

An alternative to #19235 that attempts to simplify.

Please see #19204 for context.

@sgowroji sgowroji added the team-Rules-ObjC Issues for Objective-C maintainers label Aug 14, 2023
if platform_type == "macos":
return "darwin_{}".format(apple_split_cpu)
return "{}_{}".format(platform_type, apple_split_cpu)
return settings["//command_line_option:cpu"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm wouldn't removing all the other platforms here mean you couldn't build an objc library directly for iOS anymore? I feel like this change would likely be about the same as removing the transition all together?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Probably best to look at #19235 (comment) first, just to make sure we're on the same page. Thanks for thinking about it with me!)

To clarify: Not removing all the others; instead unifying a separate condition. (Note that despite how the diff preview decides to align, I've moved this code down from above, not replaced all the platform-specific cases with that macOS if statement. It's all the platform-specific, non-fat-binary-because-no-rules_apple-binary fallback cases that are unified into the last line, looking at CPU. I realize I still need to make the case to you that that's the right, consistent analysis, hence attempting to order the other comment first.)

To build an objc_library directly for iOS (rather than the default, Mac) one would now just specify --cpu (as elsewhere). Previously, (I think?) one couldn't build an objc_library directly for iOS with public APIs, since --apple_platform_type is undocumented (and explicitly labeled as not for direct use), and you'd have to specify it to hit the iOS case when building objc_library directly.

@cpsauer
Copy link
Contributor Author

cpsauer commented Aug 31, 2023

Closing because Keith's #19256 (merged) puts us on the path to remove the problematic transition entirely. See #16870

@cpsauer cpsauer closed this Aug 31, 2023
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-ObjC Issues for Objective-C maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Objc transition can swap architecture, leading to link failure
3 participants