Skip to content

Commit

Permalink
Remove Bazel 5 and rules_apple 2 related code (#835)
Browse files Browse the repository at this point in the history
This PR removes the existing Bzlmod extensions required to work around
the API changes between rules apple 2 and rules apple 3. Additionally,
removes any branching we were doing for either Bazel 5 or rules_apple < 3
  • Loading branch information
luispadron authored Feb 22, 2024
1 parent 5c9479f commit e4f8ab3
Show file tree
Hide file tree
Showing 32 changed files with 146 additions and 596 deletions.
3 changes: 1 addition & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Enable Bzlmod
# TODO: While supporting Bazel 5 we need to keep experimental flag vs using "--enable_bzlmod"
common --experimental_enable_bzlmod
common --enable_bzlmod

# Spawn strategy required for some tests
build --spawn_strategy=standalone
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preflight_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# If flag --no-bzlmod is passed, writes a user.bazelrc file to disable Bzlmod.
if [[ "$*" == *--no-bzlmod* ]]; then
echo "build --noexperimental_enable_bzlmod" >> user.bazelrc
echo "build --noenable_bzlmod" >> user.bazelrc
fi
# If flag --use-remote-cache is passed, writes a user.bazelrc file to enable remote cache.
if [[ "$*" == *--use-remote-cache* ]]; then
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ We automate publishing to the [Bazel Central Registry](https://registry.bazel.bu
It will create a [PR like this one](https://github.com/bazelbuild/bazel-central-registry/pull/1063) whenever a new release is created. As such, there is no extra action required from the maintainers. Simply create a release and let the app publish it to the BCR.

If you need more reviews in the BCR repository you can ask in the [#bzlmod channel of the Bazel Slack](https://bazelbuild.slack.com/archives/C014RARENH0).

## Creating patches to older releases

If you need to create a new release for an older version, follow these steps:

- Create a new branch for the **major** version of the release you want to patch (e.g. to patch `3.x.x` create a branch named `v3`)
- (Optional) If applicable in the current release, first create a pull request into `main` with your changes.
- Create a pull request into the branch you just created with the changes you want to include in the new release.
- Merge the pull request into the branch.
- Create a new release as described above, but set the source branch for the action as the branch you created.
12 changes: 0 additions & 12 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ bazel_dep(
repo_name = "io_bazel_stardoc",
)

rules_apple_api_deps = use_extension("//rules:module_extensions.bzl", "rules_apple_api_deps")
use_repo(
rules_apple_api_deps,
"rules_apple_api",
)

rules_ios_bazel_version_deps = use_extension("//rules:module_extensions.bzl", "rules_ios_bazel_version_deps")
use_repo(
rules_ios_bazel_version_deps,
"rules_ios_bazel_version",
)

# Load non-bzlmod dependencies from rules_ios
non_module_deps = use_extension("//rules:module_extensions.bzl", "non_module_deps")
use_repo(
Expand Down
6 changes: 1 addition & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ load(
"rules_ios_dev_dependencies",
)

# Storing in a variable so `.github/workflows/tests.yml` can easily
# mutate this before running `rules_ios`s CI tests
LOAD_RULES_APPLE_2_DEPS = False

rules_ios_dependencies(load_rules_apple_2_dependencies = LOAD_RULES_APPLE_2_DEPS)
rules_ios_dependencies()

rules_ios_dev_dependencies()

Expand Down
9 changes: 1 addition & 8 deletions rules/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ bzl_library(
srcs = ["transition_support.bzl"],
visibility = ["//visibility:public"],
deps = [
"//rules/internal:bazel_version",
"@build_bazel_apple_support//lib:apple_support",
"@rules_apple_api//:api",
"@rules_ios_bazel_version//:api",
],
)

Expand Down Expand Up @@ -55,7 +52,7 @@ bzl_library(
deps = [
":providers",
":transition_support",
"@rules_apple_api//:api",
"@bazel_skylib//lib:dicts",
],
)

Expand Down Expand Up @@ -108,7 +105,6 @@ bzl_library(
":features",
"//rules/internal:objc_provider_utils",
"@build_bazel_rules_apple//apple",
"@rules_apple_api//:api",
],
)

Expand All @@ -132,7 +128,6 @@ bzl_library(
"@build_bazel_rules_apple//apple:apple_static_library",
"@build_bazel_rules_apple//apple:resources",
"@build_bazel_rules_swift//swift",
"@rules_apple_api//:api",
],
)

Expand All @@ -154,7 +149,6 @@ bzl_library(
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
"@build_bazel_rules_apple//apple",
"@build_bazel_rules_swift//swift",
"@rules_apple_api//:api",
],
)

Expand Down Expand Up @@ -206,7 +200,6 @@ bzl_library(
":transition_support",
"//rules/internal:framework_middleman",
"@build_bazel_rules_apple//apple:ios",
"@rules_apple_api//:api",
],
)

Expand Down
Loading

0 comments on commit e4f8ab3

Please sign in to comment.