_objc_expand_and_tokenize isn't backwards compatible with LTS releases
https://github.com/bazelbuild/rules_cc/blob/285fdce428cf3c5cf8e35c9f0ac4247e8e27ec58/cc/private/cc_common.bzl#L675
this code relies on cc_common having expand_and_tokenize, but that wasn't the case until https://github.com/bazelbuild/bazel/commit/eb1bba007113890f60c214929d02237554a299af#diff-538c699a2bb42c3a1c7436b75fa3390c18d8ce0718d6805d03118a067e28d800
which isn't present in bazel 8.4.2, leading to this code failing at that point. I think we need to point to the since removed objc_internal version of this method if it is still present? I tried some variations with _builtins.internal.objc_internal but that doesn't seem to work, I assume intentionally
cc @comius any other ideas on how to fix? I think this blocks us supporting bazel 9.x in the apple rules
this is the resulting trace with 8.4.2:
ERROR: /Users/ksmiley/dev/bazelbuild/apple_support/test/test_data/BUILD:41:22: in starlark_apple_binary rule //test/test_data:macos_binary:
Traceback (most recent call last):
File "/Users/ksmiley/dev/bazelbuild/apple_support/test/starlark_apple_binary.bzl", line 7, column 41, in _starlark_apple_binary_impl
link_result = link_multi_arch_binary(
File "/Users/ksmiley/dev/bazelbuild/apple_support/test/linking_support.bzl", line 550, column 70, in link_multi_arch_binary
common_variables = compilation_support.build_common_variables(
File "/private/var/tmp/_bazel_ksmiley/61d047e43f5a23509d22c2f655531c99/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_ksmiley/61d047e43f5a23509d22c2f655531c99/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'
(and i assume the same with 7.x)
looks like this workaround works:
build_common_variables = apple_common.compilation_support.build_common_variables if hasattr(apple_common, "compilation_support") else compilation_support.build_common_variables
common_variables = build_common_variables(
ctx = ctx,
toolchain = cc_toolchain,
deps = deps,
attr_linkopts = attr_linkopts,
)
looks like that workaround approach works for 8.x and HEAD but not rolling, so i guess there was an intermediate step where the API existed but didn't fully work