Skip to content

Commit 8e09384

Browse files
luispadronnglevin
andauthored
Cherry-pick linking refactor from upstream (batch 1) (#2912)
Cherry-picks from the `upstream` branch - batch 1 of a larger sync effort (see #2861 for full context). ## Commits - Add platform attributes to the deprecated `apple_binary`, allowing it to work with platform-based resolution (upstream: 0654124) - Refactor linking logic to use named args and consolidate variables in `compilation_support.bzl` and `linking_support.bzl` (upstream: 2507186) No manual fixes or conflict resolution needed - clean cherry-picks. --------- Co-authored-by: Nicholas Levin <nglevin@google.com>
1 parent 8511ba3 commit 8e09384

File tree

4 files changed

+130
-127
lines changed

4 files changed

+130
-127
lines changed

apple/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ bzl_library(
7777
"//apple/internal:rule_attrs",
7878
"//apple/internal:rule_factory",
7979
"//apple/internal:transition_support",
80+
"@build_bazel_apple_support//lib:apple_support",
8081
],
8182
)
8283

apple/apple_binary.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
"""Starlark implementation of `apple_binary` to transition from native Bazel."""
1616

17+
load(
18+
"@build_bazel_apple_support//lib:apple_support.bzl",
19+
"apple_support",
20+
)
1721
load(
1822
"//apple/internal:linking_support.bzl",
1923
"linking_support",
@@ -147,6 +151,7 @@ implementation of `apple_binary` in Bazel core so that it can be removed.
147151
""",
148152
implementation = _apple_binary_impl,
149153
attrs = [
154+
apple_support.platform_constraint_attrs(),
150155
rule_attrs.binary_linking_attrs(
151156
deps_cfg = transition_support.apple_platform_split_transition,
152157
is_test_supporting_rule = False,

0 commit comments

Comments
 (0)