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

Remove j2objc_dead_code_pruner from rules_apple #2552

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

erikkerber
Copy link
Contributor

@erikkerber erikkerber commented Oct 9, 2024

Speculative fix for #2497

Appears j2objc_dead_code_pruner related code was removed from Bazel in bazelbuild/bazel@208b9c6

@erikkerber erikkerber changed the title Remove j2objc from rules_apple Remove j2objc_dead_code_pruner from rules_apple Oct 9, 2024
Copy link
Contributor

@mattrobmattrob mattrobmattrob left a comment

Choose a reason for hiding this comment

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

Can you change or remove the name of _j2objc_binary_linking_attrs and all associated j2objc references?

@erikkerber
Copy link
Contributor Author

@mattrobmattrob I can, if it's still the right thing to do. I don't know much of anything about j2objc, but the j2objc fragment is still needed from core:

ERROR: /Users/ekerber/Developer/rules_apple/test/starlark_tests/targets_under_test/ios/BUILD:1889:14: in ios_framework rule //test/starlark_tests/targets_under_test/ios:fmwk_stripped:
Traceback (most recent call last):
        File "/Users/ekerber/Developer/rules_apple/apple/internal/ios_rules.bzl", line 931, column 65, in _ios_framework_impl
                link_result = linking_support.register_binary_linking_action(
        File "/Users/ekerber/Developer/rules_apple/apple/internal/linking_support.bzl", line 243, column 58, in _register_binary_linking_action
                linking_outputs = apple_common.link_multi_arch_binary(
        File "/virtual_builtins_bzl/common/objc/linking_support.bzl", line 277, column 86, in _link_multi_arch_binary
        File "/virtual_builtins_bzl/common/objc/compilation_support.bzl", line 835, column 62, in _register_configuration_specific_link_actions
        File "/virtual_builtins_bzl/common/objc/compilation_support.bzl", line 605, column 26, in _register_j2objc_dead_code_removal_actions
Error: ios_framework has to declare 'j2objc' as a required fragment in order to access it. Please update the 'fragments' argument of the rule definition (for example: fragments = ["j2objc"])

As for the name of the Starlark macro holding _dummy_lib and _xcrunwrapper, those are needed IIUC for Bazel 6 support as they were used in j2objc-related code.

@erikkerber
Copy link
Contributor Author

Kept the macro name, dropped _dummy_lib and the cfg params, and modified the note to delete when Bazel 6 is dropped.

@mattrobmattrob
Copy link
Contributor

_dummy_lib was used as part of some function of using the j2objc functionality?

@erikkerber
Copy link
Contributor Author

It was part of the attributes returned in the macro so I assume so. CI passes with it deleted, and that's all the comfort I can provide ¯\_(ツ)_/¯

@luispadron
Copy link
Contributor

I'm cool with merging this, in general no idea why we have / need the j2objc stuff in open source.

@brentleyjones thoughts?

@mattrobmattrob
Copy link
Contributor

Fine to merge as well. We can revert or handle a different way if problems come up or someone with more knowledge chimes in.

@mattrobmattrob mattrobmattrob merged commit 2e45cef into bazelbuild:master Oct 9, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants