From a7b388519966e1dd0833cd22b0eb1abc2b55859e Mon Sep 17 00:00:00 2001 From: Luis Padron Date: Thu, 18 Apr 2024 12:32:41 -0400 Subject: [PATCH] Add Bazel 7 support and CI (#843) This PR adds 7.1.0 as a tested version in CI. It additionally updates the README to specify the next release will officially support Bazel 7+ Depends on: - #848 - #847 - #850 Closes #795 --- .bazelversion | 2 +- .bcr/presubmit.yml | 2 +- .github/workflows/tests.yml | 18 ++++++++++++------ MODULE.bazel | 4 ---- README.md | 1 + docs/app_doc.md | 2 +- docs/framework_doc.md | 2 +- docs/import_middleman_doc.md | 2 +- docs/library_doc.md | 2 +- docs/test_doc.md | 12 ++++++------ 10 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.bazelversion b/.bazelversion index f22d756da..a3fcc7121 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.5.0 +7.1.0 diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 3a425c6ef..0f604656b 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -1,5 +1,5 @@ matrix: - bazel: ["6.x"] + bazel: ["6.x", "7.x"] tasks: verify_build_targets: name: Verify Build targets on macOS diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd9b8a0e2..33397998e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,8 +18,9 @@ jobs: name: Build and test (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }} / Virtual Frameworks ${{ matrix.virtual_frameworks }}) runs-on: macos-14 strategy: + fail-fast: false matrix: - bazel_version: [6.5.0] + bazel_version: [6.5.0, 7.1.0] xcode_version: [15.2] virtual_frameworks: [true, false] env: @@ -63,8 +64,9 @@ jobs: name: arm64 Simulator (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }}) runs-on: macos-14 strategy: + fail-fast: false matrix: - bazel_version: [6.5.0] + bazel_version: [6.5.0, 7.1.0] xcode_version: [15.2] env: XCODE_VERSION: ${{ matrix.xcode_version }} @@ -103,8 +105,9 @@ jobs: name: Buildifier and Documentation (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }}) runs-on: macos-14 strategy: + fail-fast: false matrix: - bazel_version: [6.5.0] + bazel_version: [7.1.0] # Only run on latest Bazel version as stardoc changes between versions and produces different results xcode_version: [15.2] env: XCODE_VERSION: ${{ matrix.xcode_version }} @@ -133,8 +136,9 @@ jobs: name: Legacy xcodeproj tests (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }}) runs-on: macos-14 strategy: + fail-fast: false matrix: - bazel_version: [6.5.0] + bazel_version: [6.5.0] # Only test on a single Bazel version as fixtures require updates across Bazel verisons xcode_version: [15.2] env: XCODE_VERSION: ${{ matrix.xcode_version }} @@ -155,8 +159,9 @@ jobs: name: LLDB tests (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }}) runs-on: macos-14 strategy: + fail-fast: false matrix: - bazel_version: [6.5.0] + bazel_version: [6.5.0, 7.1.0] xcode_version: [15.2] env: XCODE_VERSION: ${{ matrix.xcode_version }} @@ -184,8 +189,9 @@ jobs: name: iOS App Multiple Architectures (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }}) runs-on: macos-14 strategy: + fail-fast: false matrix: - bazel_version: [6.5.0] + bazel_version: [6.5.0, 7.1.0] xcode_version: [15.2] env: XCODE_VERSION: ${{ matrix.xcode_version }} diff --git a/MODULE.bazel b/MODULE.bazel index 81e01f396..6abfcdacf 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -9,10 +9,6 @@ module( version = "0", bazel_compatibility = [ ">=6.0.0", - # Temporarily limit the usage of Bazel 7+ until - # https://github.com/bazel-ios/rules_ios/issues/795 - # is complete. - "<7.0.0", ], compatibility_level = 1, repo_name = "build_bazel_rules_ios", diff --git a/README.md b/README.md index 2920e7705..84714a502 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ See the following table for supported release versions. | Bazel release | Minimum supported rules version | Final supported rules version |:-------------------:|:-------------------------:|:-------------------------: +| 7.* | 4.4.0 | current | 6.* | 2.0.0 | current | 5.* | 1.0.0 | 3.2.2 | 4.* | 1.0.0 | 1.0.0 diff --git a/docs/app_doc.md b/docs/app_doc.md index 01ff90608..8e64f75dc 100755 --- a/docs/app_doc.md +++ b/docs/app_doc.md @@ -20,7 +20,7 @@ Builds and packages an iOS application. | :------------- | :------------- | :------------- | | name | The name of the iOS application. | none | | families | A list of iOS device families the target supports. | `["iphone", "ipad"]` | -| apple_library | The macro used to package sources into a library. | `` | +| apple_library | The macro used to package sources into a library. | `` | | infoplists | A list of Info.plist files to be merged into the iOS app. | `[]` | | infoplists_by_build_setting | A dictionary of infoplists grouped by bazel build setting.

Each value is applied if the respective bazel build setting is resolved during the analysis phase.

If '//conditions:default' is not set the value in 'infoplists' is set as default. | `{}` | | xcconfig | A dictionary of xcconfigs to be applied to the iOS app by default. | `{}` | diff --git a/docs/framework_doc.md b/docs/framework_doc.md index bf936c156..1d5ae76ba 100755 --- a/docs/framework_doc.md +++ b/docs/framework_doc.md @@ -61,7 +61,7 @@ Builds and packages an Apple framework. | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name | The name of the framework. | none | -| apple_library | The macro used to package sources into a library. | `` | +| apple_library | The macro used to package sources into a library. | `` | | infoplists | A list of Info.plist files to be merged into the framework. | `[]` | | infoplists_by_build_setting | A dictionary of infoplists grouped by bazel build setting.

Each value is applied if the respective bazel build setting is resolved during the analysis phase.

If '//conditions:default' is not set the value in 'infoplists' is set as default. | `{}` | | xcconfig | A dictionary of xcconfigs to be applied to the framework by default. | `{}` | diff --git a/docs/import_middleman_doc.md b/docs/import_middleman_doc.md index a2f503f3d..1cfcf4b4a 100755 --- a/docs/import_middleman_doc.md +++ b/docs/import_middleman_doc.md @@ -42,7 +42,7 @@ can be updated to work without the other behavior | name | A unique name for this target. | Name | required | | | deps | - | List of labels | optional | `[]` | | test_deps | - | List of labels | optional | `[]` | -| update_in_place | - | Label | optional | `//tools/m1_utils:update_in_place` | +| update_in_place | - | Label | optional | `"@rules_ios//tools/m1_utils:update_in_place"` | diff --git a/docs/library_doc.md b/docs/library_doc.md index 0f8f3bc39..1a9790f4d 100755 --- a/docs/library_doc.md +++ b/docs/library_doc.md @@ -18,7 +18,7 @@ Extends a modulemap with a Swift submodule | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | -| destination | - | Label | optional | | +| destination | - | Label | optional | `None` | | module_name | - | String | required | | | source | - | Label | optional | `None` | | swift_header | - | String | optional | `""` | diff --git a/docs/test_doc.md b/docs/test_doc.md index 2172eeb1b..78c2876bb 100755 --- a/docs/test_doc.md +++ b/docs/test_doc.md @@ -145,8 +145,8 @@ Builds and packages iOS UI Tests. | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name | The name of the UI test. | none | -| apple_library | The macro used to package sources into a library. | `` | -| test_factory | Use this to generate other variations of tests. | `struct(make_named_split = , make_runner_split = , make_test = , make_test_suite = , make_test_suite_splits = , make_tests = )` | +| apple_library | The macro used to package sources into a library. | `` | +| test_factory | Use this to generate other variations of tests. | `struct(make_named_split = , make_runner_split = , make_test = , make_test_suite = , make_test_suite_splits = , make_tests = )` | | kwargs | Arguments passed to the apple_library and ios_ui_test rules as appropriate. | none | @@ -166,8 +166,8 @@ Builds and packages iOS Unit Snapshot Tests. | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name | The name of the UI test. | none | -| apple_library | The macro used to package sources into a library. | `` | -| test_factory | Use this to generate other variations of tests. | `struct(make_named_split = , make_runner_split = , make_test = , make_test_suite = , make_test_suite_splits = , make_tests = )` | +| apple_library | The macro used to package sources into a library. | `` | +| test_factory | Use this to generate other variations of tests. | `struct(make_named_split = , make_runner_split = , make_test = , make_test_suite = , make_test_suite_splits = , make_tests = )` | | kwargs | Arguments passed to the apple_library and ios_unit_test rules as appropriate. | none | @@ -187,8 +187,8 @@ Builds and packages iOS Unit Tests. | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name | The name of the unit test. | none | -| apple_library | The macro used to package sources into a library. | `` | -| test_factory | Use this to generate other variations of tests. | `struct(make_named_split = , make_runner_split = , make_test = , make_test_suite = , make_test_suite_splits = , make_tests = )` | +| apple_library | The macro used to package sources into a library. | `` | +| test_factory | Use this to generate other variations of tests. | `struct(make_named_split = , make_runner_split = , make_test = , make_test_suite = , make_test_suite_splits = , make_tests = )` | | kwargs | Arguments passed to the apple_library and ios_unit_test rules as appropriate. | none |