Skip to content

Commit

Permalink
[7.2.0] Cherry-picks for starlarkifying all repo rules (#22203)
Browse files Browse the repository at this point in the history
RELNOTES: Added a new flag `--incompatible_disable_native_repo_rules` to
disable native repo rule usage in WORKSPACE. All native repo rules now
have a Starlark counterpart that can be used in both WORKSPACE and
Bzlmod; see #22080 for more details.
  • Loading branch information
Wyverald authored Apr 30, 2024
1 parent e09b536 commit d448e11
Show file tree
Hide file tree
Showing 81 changed files with 917 additions and 588 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ platform(
constraint_values = [
":highcpu_machine",
],
parents = ["@local_config_platform//:host"],
parents = ["@platforms//host"],
)

platform(
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bazel_dep(name = "rules_license", version = "0.0.7")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "grpc", version = "1.48.1.bcr.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "stardoc", version = "0.5.6", repo_name = "io_bazel_skydoc")
bazel_dep(name = "zstd-jni", version = "1.5.2-3.bcr.1")
Expand Down
130 changes: 82 additions & 48 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ log "Building output/bazel"
# host.
bazel_build "src:bazel_nojdk${EXE_EXT}" \
--action_env=PATH \
--host_platform=@local_config_platform//:host \
--platforms=@local_config_platform//:host \
--host_platform=@platforms//host \
--platforms=@platforms//host \
|| fail "Could not build Bazel"
bazel_bin_path="$(get_bazel_bin_path)/src/bazel_nojdk${EXE_EXT}"
[ -e "$bazel_bin_path" ] \
Expand Down
3 changes: 2 additions & 1 deletion site/en/concepts/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ Project owners should define explicit
they want to build for. These are then triggered with `--platforms`.

When `--platforms` isn't set, Bazel defaults to a `platform` representing the
local build machine. This is auto-generated at `@local_config_platform//:host`
local build machine. This is auto-generated at `@platforms//host` (aliased as
`@bazel_tools//tools:host_platform`)
so there's no need to explicitly define it. It maps the local machine's `OS`
and `CPU` with `constraint_value`s declared in
[`@platforms`](https://github.com/bazelbuild/platforms){: .external}.
Expand Down
Loading

0 comments on commit d448e11

Please sign in to comment.