Skip to content

Commit 585ba4c

Browse files
authored
Remove 7.x support (#2891)
1 parent 9120c86 commit 585ba4c

9 files changed

Lines changed: 30 additions & 74 deletions

File tree

.bazelci/presubmit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ x_defaults:
3232
# NOTE: To avoid listing the same things for build_flags/test_flags for each
3333
# of these tasks, they are listed in the .bazelrc instead.
3434
tasks:
35+
macos_8.0.0:
36+
name: "8.0.0"
37+
bazel: 8.0.0
38+
<<: *common
39+
3540
macos_8.x:
3641
name: "8.x"
3742
bazel: 8.x

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module(
44
name = "rules_apple",
55
version = "0",
6-
bazel_compatibility = [">=7.0.0"],
6+
bazel_compatibility = [">=8.0.0"],
77
compatibility_level = 1,
88
)
99

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ Besides these constraints this repo follows
7171

7272
| Bazel release | Minimum supported rules version | Final supported rules version | Supporting Branch |
7373
|:-------------------:|:-------------------:|:-------------------------:|:-------------------------:|
74-
| 8.x (most recent rolling) | 2.* | current | `main` |
75-
| 7.x | 2.* | current | `main` |
76-
| 6.x | 2.* | 3.13.0 | `main` |
74+
| 10.x (most recent rolling) | 2.* | current | `main` |
75+
| 9.x | 2.* | current | `main` |
76+
| 8.x | 2.* | current | `main` |
77+
| 7.x | 2.* | 4.5.1 | `bazel/7.x` |
78+
| 6.x | 2.* | 3.13.0 | N/A |
7779
| 5.x | 0.33.0 | 1.* | `bazel/5.x` |
7880
| 4.x | 0.30.0 | 0.32.0 | N/A |
7981
| 3.x | 0.20.0 | 0.21.2 | N/A |

apple/internal/aspects/resource_aspect_hint.bzl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ Available actions are
7575
Defines an aspect hint that generates an appropriate AppleResourceHintInfo based on the
7676
runfiles for this target.
7777
78-
> [!NOTE]
79-
> Bazel 6 users must set the `--experimental_enable_aspect_hints` flag to utilize
80-
> this rule. In addition, downstream consumers of rules that utilize this rule
81-
> must also set the flag. The flag is enabled by default in Bazel 7.
82-
8378
Some rules like `cc_library` may have data associated with them in the data attribute
8479
that is needed at runtime. If the library was linked in a `cc_binary` then those data
8580
files would be made available to the application as `runfiles`. To control this

apple/internal/linking_support.bzl

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ def _archive_multi_arch_static_library(
6868
- environment: Static library archive environment (e.g. 'device', 'simulator').
6969
"""
7070

71-
# TODO: Delete when we drop bazel 7.x
72-
legacy_linking_function = getattr(apple_common, "link_multi_arch_static_library", None)
73-
if legacy_linking_function:
74-
return legacy_linking_function(ctx = ctx)
75-
7671
split_deps = ctx.split_attr.deps
7772
split_avoid_deps = ctx.split_attr.avoid_deps
7873

@@ -203,20 +198,6 @@ def _link_multi_arch_binary(
203198
* `debug_outputs_provider`: An AppleDebugOutputs provider
204199
"""
205200

206-
# TODO: Delete when we drop bazel 7.x
207-
legacy_linking_function = getattr(apple_common, "link_multi_arch_binary", None)
208-
if legacy_linking_function:
209-
return legacy_linking_function(
210-
ctx = ctx,
211-
avoid_deps = avoid_deps,
212-
extra_linkopts = extra_linkopts,
213-
extra_link_inputs = extra_link_inputs,
214-
extra_requested_features = extra_requested_features,
215-
extra_disabled_features = extra_disabled_features,
216-
variables_extension = variables_extension,
217-
stamp = stamp,
218-
)
219-
220201
split_deps = ctx.split_attr.deps
221202

222203
if split_deps and split_deps.keys() != cc_toolchains.keys():

apple/internal/providers.bzl

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ dependencies of the given target if any were generated.
229229
init = _make_banned_init(provider_name = "AppleDsymBundleInfo"),
230230
)
231231

232-
_AppleDynamicFrameworkInfo = provider(
232+
AppleDynamicFrameworkInfo, new_appledynamicframeworkinfo = provider(
233233
doc = "Contains information about an Apple dynamic framework.",
234234
fields = {
235235
"framework_dirs": """\
@@ -246,37 +246,15 @@ A `CcInfo` which contains information about the transitive dependencies linked
246246
into the binary.
247247
""",
248248
},
249+
init = _make_banned_init(provider_name = "AppleDynamicFrameworkInfo"),
249250
)
250251

251-
# TODO: Remove when we drop 7.x
252-
AppleDynamicFrameworkInfo = getattr(
253-
apple_common,
254-
"AppleDynamicFramework",
255-
_AppleDynamicFrameworkInfo,
256-
)
257-
258-
# TODO: Remove when we drop 7.x
259-
def new_appledynamicframeworkinfo(**kwargs):
260-
legacy_initializer = getattr(
261-
apple_common,
262-
"new_dynamic_framework_provider",
263-
None,
264-
)
265-
if legacy_initializer:
266-
return legacy_initializer(**kwargs)
267-
268-
return AppleDynamicFrameworkInfo(**kwargs)
269-
270-
_AppleExecutableBinaryInfo = provider(
252+
AppleExecutableBinaryInfo, new_appleexecutablebinaryinfo = provider(
271253
doc = """
272254
Contains the executable binary output that was built using
273255
`link_multi_arch_binary` with the `executable` binary type.
274256
""",
275257
fields = {
276-
# TODO: Remove when we drop 7.x
277-
"objc": """\
278-
apple_common.Objc provider used for legacy linking behavior.
279-
""",
280258
"binary": """\
281259
The executable binary artifact output by `link_multi_arch_binary`.
282260
""",
@@ -285,18 +263,9 @@ A `CcInfo` which contains information about the transitive dependencies linked
285263
into the binary.
286264
""",
287265
},
266+
init = _make_banned_init(provider_name = "AppleExecutableBinaryInfo"),
288267
)
289268

290-
AppleExecutableBinaryInfo = getattr(apple_common, "AppleExecutableBinary", _AppleExecutableBinaryInfo)
291-
292-
# TODO: Use common init pattern when we drop 7.x
293-
def new_appleexecutablebinaryinfo(**kwargs):
294-
legacy_initializer = getattr(apple_common, "new_executable_binary_provider", None)
295-
if legacy_initializer:
296-
return legacy_initializer(**kwargs)
297-
298-
return AppleExecutableBinaryInfo(**kwargs)
299-
300269
AppleExtraOutputsInfo, new_appleextraoutputsinfo = provider(
301270
doc = """
302271
Provides information about extra outputs that should be produced from the build.

apple/internal/rule_attrs.bzl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ def _common_linking_api_attrs(*, deps_cfg):
125125
providers = [cc_common.CcToolchainInfo, ApplePlatformInfo],
126126
default = "//apple:default_cc_toolchain_forwarder",
127127
),
128-
# TODO: Remove this when we drop bazel 7.x
129-
"_child_configuration_dummy": attr.label(
130-
cfg = deps_cfg,
131-
providers = [cc_common.CcToolchainInfo, ApplePlatformInfo],
132-
default = "//apple:default_cc_toolchain_forwarder",
133-
),
134128
})
135129

136130
def _static_library_archive_attrs(*, deps_cfg):

apple/internal/transition_support.bzl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ load(
4343
)
4444

4545
_supports_visionos = hasattr(apple_common.platform_type, "visionos")
46-
_is_bazel_7 = not hasattr(apple_common, "apple_crosstool_transition")
4746

4847
_PLATFORM_TYPE_TO_CPUS_FLAG = {
4948
"ios": "//command_line_option:ios_multi_cpus",
@@ -335,7 +334,7 @@ def _command_line_options(
335334
settings = settings,
336335
)
337336

338-
default_platforms = [settings[_CPU_TO_DEFAULT_PLATFORM_FLAG[cpu]]] if _is_bazel_7 else []
337+
default_platforms = [settings[_CPU_TO_DEFAULT_PLATFORM_FLAG[cpu]]]
339338
return {
340339
build_settings_labels.use_tree_artifacts_outputs: force_bundle_outputs if force_bundle_outputs else settings[build_settings_labels.use_tree_artifacts_outputs],
341340
"//command_line_option:apple_platform_type": platform_type,

doc/providers.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,17 @@ Provides information for an Apple dSYM bundle.
267267
<pre>
268268
load("@rules_apple//apple:providers.bzl", "AppleDynamicFrameworkInfo")
269269

270-
AppleDynamicFrameworkInfo(<a href="#AppleDynamicFrameworkInfo-framework_dirs">framework_dirs</a>, <a href="#AppleDynamicFrameworkInfo-framework_files">framework_files</a>, <a href="#AppleDynamicFrameworkInfo-binary">binary</a>, <a href="#AppleDynamicFrameworkInfo-cc_info">cc_info</a>)
270+
AppleDynamicFrameworkInfo(<a href="#AppleDynamicFrameworkInfo-_init-kwargs">*kwargs</a>)
271271
</pre>
272272

273273
Contains information about an Apple dynamic framework.
274274

275+
**CONSTRUCTOR PARAMETERS**
276+
277+
| Name | Description | Default Value |
278+
| :------------- | :------------- | :------------- |
279+
| <a id="AppleDynamicFrameworkInfo-_init-kwargs"></a>kwargs | <p align="center">-</p> | none |
280+
275281
**FIELDS**
276282

277283
| Name | Description |
@@ -289,17 +295,22 @@ Contains information about an Apple dynamic framework.
289295
<pre>
290296
load("@rules_apple//apple:providers.bzl", "AppleExecutableBinaryInfo")
291297

292-
AppleExecutableBinaryInfo(<a href="#AppleExecutableBinaryInfo-objc">objc</a>, <a href="#AppleExecutableBinaryInfo-binary">binary</a>, <a href="#AppleExecutableBinaryInfo-cc_info">cc_info</a>)
298+
AppleExecutableBinaryInfo(<a href="#AppleExecutableBinaryInfo-_init-kwargs">*kwargs</a>)
293299
</pre>
294300

295301
Contains the executable binary output that was built using
296302
`link_multi_arch_binary` with the `executable` binary type.
297303

304+
**CONSTRUCTOR PARAMETERS**
305+
306+
| Name | Description | Default Value |
307+
| :------------- | :------------- | :------------- |
308+
| <a id="AppleExecutableBinaryInfo-_init-kwargs"></a>kwargs | <p align="center">-</p> | none |
309+
298310
**FIELDS**
299311

300312
| Name | Description |
301313
| :------------- | :------------- |
302-
| <a id="AppleExecutableBinaryInfo-objc"></a>objc | apple_common.Objc provider used for legacy linking behavior. |
303314
| <a id="AppleExecutableBinaryInfo-binary"></a>binary | The executable binary artifact output by `link_multi_arch_binary`. |
304315
| <a id="AppleExecutableBinaryInfo-cc_info"></a>cc_info | A `CcInfo` which contains information about the transitive dependencies linked into the binary. |
305316

0 commit comments

Comments
 (0)