Skip to content

Commit c97983d

Browse files
googlewaltswiple-rules-gardener
authored andcommitted
Internal change
PiperOrigin-RevId: 549758968
1 parent 3a07e48 commit c97983d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

apple/internal/rule_attrs.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ visibility([
7272
"//test/...",
7373
])
7474

75+
# The name of the execution group used to run j2objc linking actions.
76+
_J2OBJC_LINKING_EXEC_GROUP = "j2objc"
77+
7578
def _common_attrs():
7679
"""Private attributes on all rules; these should be included in all rule attributes."""
7780
return dicts.add(
@@ -172,13 +175,14 @@ def _j2objc_binary_linking_attrs(*, deps_cfg):
172175
cfg = deps_cfg,
173176
default = Label("@bazel_tools//tools/objc:dummy_lib"),
174177
),
178+
# TODO(b/292086564): Remove once j2objc dead code prunder action is removed.
175179
"_j2objc_dead_code_pruner": attr.label(
176180
executable = True,
177181
# Setting `allow_single_file=True` would be more correct. Unfortunately,
178182
# doing so prevents using py_binary as the underlying target because py_binary
179183
# produces at least _two_ output files (the executable plus any files in srcs)
180184
allow_files = True,
181-
cfg = "exec",
185+
cfg = config.exec(_J2OBJC_LINKING_EXEC_GROUP),
182186
default = Label("@bazel_tools//tools/objc:j2objc_dead_code_pruner_binary"),
183187
),
184188
# xcrunwrapper is no longer used by rules_apple, but the underlying implementation of

apple/internal/rule_factory.bzl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ AppleTestRunnerInfo provider.
8686
),
8787
}
8888

89+
# The name of the execution group used to run j2objc linking actions.
90+
_J2OBJC_LINKING_EXEC_GROUP = "j2objc"
91+
8992
def _create_apple_rule(
9093
*,
9194
cfg = transition_support.apple_rule_transition,
@@ -127,6 +130,12 @@ def _create_apple_rule(
127130
cfg = cfg,
128131
doc = doc,
129132
executable = is_executable,
133+
# TODO(b/292086564): Remove once j2objc dead code prunder action is removed.
134+
exec_groups = {
135+
_J2OBJC_LINKING_EXEC_GROUP: exec_group(
136+
exec_compatible_with = ["@platforms//os:osx"],
137+
),
138+
},
130139
fragments = ["apple", "cpp", "objc"],
131140
toolchains = toolchains,
132141
**extra_args
@@ -157,6 +166,12 @@ def _create_apple_test_rule(*, doc, implementation, platform_type):
157166
*ide_visible_attrs
158167
),
159168
doc = doc,
169+
# TODO(b/292086564): Remove once j2objc dead code prunder action is removed.
170+
exec_groups = {
171+
_J2OBJC_LINKING_EXEC_GROUP: exec_group(
172+
exec_compatible_with = ["@platforms//os:osx"],
173+
),
174+
},
160175
test = True,
161176
toolchains = use_cpp_toolchain(),
162177
)

0 commit comments

Comments
 (0)