Skip to content

Replace apple_common.compilation_support.build_common_variables with rules_cc version#2862

Open
brentleyjones wants to merge 2 commits intomainfrom
bj/replace-apple_common.compilation_support.build_common_variables-with-rules_cc-version
Open

Replace apple_common.compilation_support.build_common_variables with rules_cc version#2862
brentleyjones wants to merge 2 commits intomainfrom
bj/replace-apple_common.compilation_support.build_common_variables-with-rules_cc-version

Conversation

@brentleyjones
Copy link
Collaborator

Needed for Bazel 9.

PiperOrigin-RevId: 824908997
(cherry picked from commit 4b43d5d)

…h rules_cc version

Needed for Bazel 9.

PiperOrigin-RevId: 824908997
(cherry picked from commit 4b43d5d)
Signed-off-by: Brentley Jones <github@brentleyjones.com>
brentleyjones referenced this pull request Jan 15, 2026
PiperOrigin-RevId: 824908997
Signed-off-by: Brentley Jones <github@brentleyjones.com>
@brentleyjones
Copy link
Collaborator Author

rules_cc needs to adjust its visibility for this to land.

@luispadron luispadron mentioned this pull request Jan 15, 2026
3 tasks
@luispadron
Copy link
Contributor

luispadron commented Jan 16, 2026

My in-progress branch with a bunch of commits from upstream: #2861 just got to this one needing to be applied, im getting:

ERROR: /Users/lpadron/Development/rules_apple/test/starlark_tests/targets_under_test/ios/BUILD:236:16: in ios_application rule //test/starlark_tests/targets_under_test/ios:app: 
Traceback (most recent call last):
        File "/Users/lpadron/Development/rules_apple/apple/internal/ios_rules.bzl", line 247, column 65, in _ios_application_impl
                link_result = linking_support.register_binary_linking_action(
        File "/Users/lpadron/Development/rules_apple/apple/internal/linking_support.bzl", line 577, column 46, in _register_binary_linking_action
                linking_outputs = _link_multi_arch_binary(
        File "/Users/lpadron/Development/rules_apple/apple/internal/linking_support.bzl", line 245, column 75, in _link_multi_arch_binary
                common_variables = objc_compilation_support.build_common_variables(
        File "/private/var/tmp/_bazel_lpadron/d8d9324fa7fd2d11d5178d8cf2834c55/external/rules_cc+/cc/private/rules_impl/objc_compilation_support.bzl", line 80, column 60, in _build_common_variables
                compilation_attributes = _create_compilation_attributes(ctx = ctx)
        File "/private/var/tmp/_bazel_lpadron/d8d9324fa7fd2d11d5178d8cf2834c55/external/rules_cc+/cc/private/rules_impl/objc_compilation_support.bzl", line 58, column 29, in _create_compilation_attributes
                linkopts = cc_common.objc_expand_and_tokenize(ctx = ctx, attr = "linkopts", flags = getattr(ctx.attr, "linkopts", [])),
Error: 'struct' value has no field or method 'objc_expand_and_tokenize'
Available attributes: CcSharedLibraryHintInfo, CcToolchainInfo, action_is_enabled, check_experimental_cc_shared_library, compile, configure_features, create_cc_launcher_info, create_cc_toolchain_config_info, create_compilation_context, create_compilation_outputs, create_compile_action, create_compile_variables, create_debug_context, create_extra_link_time_library, create_library_to_link, create_link_variables, create_linker_input, create_linking_context, create_linking_context_from_compilation_outputs, create_lto_backend_artifacts, create_lto_compilation_context, create_module_map, do_not_use_tools_cpp_compiler_present, empty_variables, get_environment_variables, get_execution_requirements, get_memory_inefficient_command_line, get_tool_for_action, get_tool_requirement_for_action, implementation_deps_allowed_by_allowlist, incompatible_disable_objc_library_transition, is_cc_toolchain_resolution_enabled_do_not_use, is_enabled, launcher_provider, ld_tool_path, legacy_cc_flags_make_variable_do_not_use, link, merge_cc_infos, merge_compilation_contexts, merge_compilation_outputs, merge_debug_context, merge_linking_contexts, objcopy, objcopy_tool_path, register_linkstamp_compile_action

luispadron added a commit to luispadron/rules_cc that referenced this pull request Jan 16, 2026
@luispadron
Copy link
Contributor

bazelbuild/rules_cc#568

@hvadehra
Copy link
Member

Making this change would mean dropping support for Bazel < 9 (unless we cherry pick the required APIs into Bazel 7/8). Just want to make sure this is intended.

To remain compatible, rules_apple can use @bazel_features to conditionally use apple_common.compilation_support for Bazel <=8 or the loaded symbols from @rules_cc for Bazel >= 9.

copybara-service bot pushed a commit to bazelbuild/rules_cc that referenced this pull request Jan 19, 2026
Copybara Import from #568

BEGIN_PUBLIC
Mark `objc_compilation_support` as publicly visible (#568)

We need this to support Bazel 9+ (see: bazelbuild/rules_apple#2862)

Closes #568
END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=#568 from luispadron:patch-1 c6b6874
PiperOrigin-RevId: 857993845
Change-Id: I5dc48c54416d5c185627067be7cf8d61354d5343
luispadron added a commit to luispadron/rules_cc that referenced this pull request Jan 20, 2026
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.

6 participants