Skip to content

Commit

Permalink
wip: updates for bazel 8 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
rickeylev committed Nov 8, 2024
1 parent 7010148 commit d7b780a
Show file tree
Hide file tree
Showing 12 changed files with 16,950 additions and 5,339 deletions.
23 changes: 19 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ buildifier:
test_flags:
- "--test_tag_filters=-integration-test"
.common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel
test_flags:
- "--noenable_bzlmod"
build_flags:
- "--noenable_bzlmod"
- "--build_tag_filters=-integration-test"
test_flags:
- "--noenable_bzlmod"
- "--test_tag_filters=-integration-test"
.common_workspace_flags: &common_workspace_flags
test_flags:
- "--noenable_bzlmod"
Expand Down Expand Up @@ -120,11 +122,13 @@ tasks:
<<: *common_workspace_flags_min_bazel
name: "Default: Ubuntu, workspace, minimum Bazel"
platform: ubuntu2004

ubuntu_min_bzlmod:
<<: *minimum_supported_version
<<: *reusable_config
name: "Default: Ubuntu, bzlmod, minimum Bazel"
platform: ubuntu2004
bazel: 7.x
ubuntu:
<<: *reusable_config
name: "Default: Ubuntu"
Expand Down Expand Up @@ -171,6 +175,7 @@ tasks:
<<: *reusable_config
name: "RBE: Ubuntu, minimum Bazel"
platform: rbe_ubuntu2004
bazel: 7.x
build_flags:
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
# which prevents cc toolchain autodetection from working correctly
Expand Down Expand Up @@ -232,24 +237,28 @@ tasks:
name: "examples/bzlmod: Ubuntu, minimum Bazel"
working_directory: examples/bzlmod
platform: ubuntu2004
bazel: 7.x
integration_test_bzlmod_ubuntu:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: Ubuntu"
working_directory: examples/bzlmod
platform: ubuntu2004
bazel: 7.x
integration_test_bzlmod_debian:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: Debian"
working_directory: examples/bzlmod
platform: debian11
bazel: 7.x
integration_test_bzlmod_macos:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: macOS"
working_directory: examples/bzlmod
platform: macos
bazel: 7.x
integration_test_bzlmod_windows:
<<: *reusable_build_test_all
# coverage is not supported on Windows
Expand All @@ -262,6 +271,7 @@ tasks:
name: "examples/bzlmod: Ubuntu with lockfile"
working_directory: examples/bzlmod
platform: ubuntu2004
bazel: 7.x
shell_commands:
# Update the lockfiles and fail if it is different.
- "../../tools/private/update_bzlmod_lockfiles.sh"
Expand All @@ -272,6 +282,7 @@ tasks:
name: "examples/bzlmod: macOS with lockfile"
working_directory: examples/bzlmod
platform: macos
bazel: 7.x
shell_commands:
# Update the lockfiles and fail if it is different.
- "../../tools/private/update_bzlmod_lockfiles.sh"
Expand All @@ -284,6 +295,7 @@ tasks:
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
working_directory: examples/bzlmod_build_file_generation
platform: ubuntu2004
bazel: 7.x
integration_test_bzlmod_generation_build_files_ubuntu:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod_build_file_generation
Expand Down Expand Up @@ -350,15 +362,16 @@ tasks:
<<: *minimum_supported_version
<<: *common_workspace_flags_min_bazel
<<: *reusable_build_test_all
name: "examples/pip_parse: Ubuntu, workspace, minimum supporte Bazel version"
name: "examples/pip_parse: Ubuntu, workspace, minimum supported Bazel version"
working_directory: examples/pip_parse
platform: ubuntu2004
integration_test_pip_parse_ubuntu_min_bzlmod:
<<: *minimum_supported_version
<<: *reusable_build_test_all
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supporte Bazel version"
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version"
working_directory: examples/pip_parse
platform: ubuntu2004
bazel: 7.x
integration_test_pip_parse_ubuntu:
<<: *reusable_build_test_all
name: "examples/pip_parse: Ubuntu"
Expand Down Expand Up @@ -393,6 +406,7 @@ tasks:
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
working_directory: examples/pip_parse_vendored
platform: ubuntu2004
bazel: 7.x
integration_test_pip_parse_vendored_ubuntu:
<<: *reusable_build_test_all
name: "examples/pip_parse_vendored: Ubuntu"
Expand Down Expand Up @@ -573,6 +587,7 @@ tasks:
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel"
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
platform: ubuntu2004
bazel: 7.x
shell_commands:
# Assert that @compile_pip_requirements//:requirements_test does the right thing.
- "bazel test @compile_pip_requirements//..."
Expand Down
22 changes: 16 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ module(

bazel_dep(name = "bazel_features", version = "1.9.1")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.0.14")
bazel_dep(name = "platforms", version = "0.0.4")

# Those are loaded only when using py_proto_library
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")

##bazel_dep(name = "protobuf", version = "28.0", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "29.0-rc1", repo_name = "com_google_protobuf")

internal_deps = use_extension("//python/private:internal_deps.bzl", "internal_deps")
use_repo(
Expand Down Expand Up @@ -71,7 +73,7 @@ pip.parse(
use_repo(pip, "rules_python_publish_deps")

# Not a dev dependency to allow usage of //sphinxdocs code, which refers to stardoc repos.
bazel_dep(name = "stardoc", version = "0.6.2", repo_name = "io_bazel_stardoc")
bazel_dep(name = "stardoc", version = "0.7.1", repo_name = "io_bazel_stardoc")

# ===== DEV ONLY DEPS AND SETUP BELOW HERE =====
bazel_dep(name = "rules_bazel_integration_test", version = "0.26.1", dev_dependency = True)
Expand All @@ -83,8 +85,16 @@ bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
single_version_override(
module_name = "gazelle",
patch_strip = 1,
patches = [
"patches/gazelle_native_sh.patch",
],
version = "0.33.0",
)

internal_dev_deps = use_extension(
"//python/private:internal_dev_deps.bzl",
Expand Down Expand Up @@ -144,7 +154,7 @@ bazel_binaries.local(
path = "tests/integration/bazel_from_env",
)
bazel_binaries.download(version = "6.4.0")
bazel_binaries.download(version = "7.3.1")
bazel_binaries.download(version = "7.4.0")
bazel_binaries.download(version = "rolling")
use_repo(
bazel_binaries,
Expand All @@ -153,7 +163,7 @@ use_repo(
# that should be use_repo()'d, so we add them as requested
"bazel_binaries_bazelisk",
"build_bazel_bazel_6_4_0",
"build_bazel_bazel_7_3_1",
"build_bazel_bazel_7_4_0",
"build_bazel_bazel_rolling",
"build_bazel_bazel_self",
)
Expand Down
2 changes: 1 addition & 1 deletion examples/bzlmod/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.1
7.x
8 changes: 6 additions & 2 deletions examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ local_path_override(
)

# (py_proto_library specific) We are using rules_proto to define rules_proto targets to be consumed by py_proto_library.
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")

# (py_proto_library specific) Add the protobuf library for well-known types (e.g. `Any`, `Timestamp`, etc)
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_java", version = "8.3.0")

##bazel_dep(name = "rules_rust", version = "0.45.1")
bazel_dep(name = "rules_rust", version = "0.54.1")

# We next initialize the python toolchain using the extension.
# You can set different Python versions in this block.
Expand Down
Loading

0 comments on commit d7b780a

Please sign in to comment.