Skip to content

Commit

Permalink
Update to bazel 8.0.0 (#4729)
Browse files Browse the repository at this point in the history
This updates to bazel 8.0.0, also updating bazel mod deps and tools to
make that function. The release is a couple weeks old, and we haven't
updated in a while, and it's a major release. Note it includes some
incompatible flag flips that this is trying to update with respect to.
I'll try generally enabling incompatible support separately.

The most visible bazel behavior change here will be the change from `~`
to `+` in repo path names. (If you're curious,
bazelbuild/bazel#23127 indicates this fixes a
Windows performance issue)

Note that this is building on top of both the action env update in #4728
(which got me started down this path) and the proto removal in #4731
(which would add significant work to this update). Only the commit
starting at "Work towards bazel 8.0.0" is specifically part of this PR.
  • Loading branch information
jonmeow authored Jan 6, 2025
1 parent bc637bd commit ccf51ce
Show file tree
Hide file tree
Showing 10 changed files with 2,419 additions and 2,949 deletions.
3 changes: 3 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ bazel-carbon-lang

# See github_tools/MODULE.bazel.
github_tools

# Used as part of repo patching.
third_party/boost_unordered
13 changes: 12 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,18 @@ build --allow_unresolved_symlinks=false
# RC file here if present.
try-import %workspace%/user.bazelrc

# TODO: WORKSPACE will be removed in bazel 9, should finish moving off.
common --enable_workspace

# The version of treesitter rules we're using depends on empty globs.
# TODO: Look at the different rules in the registry.
common --incompatible_disallow_empty_glob=false

# TODO: Enable as many incompatible flags as we can, per
# https://bazel.build/release/backward-compatibility. To get the latest list,
# using `bazelisk --migrate build //...` will help.
build --incompatible_strict_action_env
common --incompatible_strict_action_env

# This excludes things like rules_android to reduce warnings.
# TODO: Disable this completely.
common --incompatible_autoload_externally=+@rules_java,+@rules_python,+@rules_shell
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.0
8.0.0
4 changes: 2 additions & 2 deletions .gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

source external/_main~llvm_project~llvm-project/llvm/utils/gdb-scripts/prettyprinters.py
source external/_main~llvm_project~llvm-project/libcxx/utils/gdb/libcxx/printers.py
source external/+llvm_project+llvm-project/llvm/utils/gdb-scripts/prettyprinters.py
source external/+llvm_project+llvm-project/libcxx/utils/gdb/libcxx/printers.py
python register_libcxx_printer_loader()
4 changes: 2 additions & 2 deletions .vscode/lldb_launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"args": ["--file_tests=${relativeFile}"],
"debuggerRoot": "${workspaceFolder}",
"initCommands": [
"command script import external/_main~llvm_project~llvm-project/llvm/utils/lldbDataFormatters.py",
"command script import external/+llvm_project+llvm-project/llvm/utils/lldbDataFormatters.py",
"settings set target.source-map \".\" \"${workspaceFolder}\""
],
"env": { "TEST_TMPDIR": "/tmp" }
Expand All @@ -28,7 +28,7 @@
],
"debuggerRoot": "${workspaceFolder}",
"initCommands": [
"command script import external/_main~llvm_project~llvm-project/llvm/utils/lldbDataFormatters.py",
"command script import external/+llvm_project+llvm-project/llvm/utils/lldbDataFormatters.py",
"settings set target.source-map \".\" \"${workspaceFolder}\""
]
}
Expand Down
26 changes: 13 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ http_archive = use_repo_rule(
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "abseil-cpp", version = "20240116.2")
bazel_dep(name = "re2", version = "2024-06-01")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "google_benchmark", version = "1.8.4")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2")
bazel_dep(name = "re2", version = "2024-07-02.bcr.1")
bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "google_benchmark", version = "1.8.5")

# The registry only has an old version. We use that here to avoid a miss but
# override it with a newer version.
Expand All @@ -60,15 +60,15 @@ archive_override(
bazel_dep(name = "tcmalloc", version = "0.0.0-20240411-5ed309d", dev_dependency = True)
git_override(
module_name = "tcmalloc",
# HEAD as of 2024-07-14.
commit = "923df94c922e0cd2d0512c1662d374f63c2c0c96",
# HEAD as of 2024-12-20.
commit = "91765c11461a01579fcbdddf430a556b818818c4",
remote = "https://github.com/google/tcmalloc.git",
)

bazel_dep(name = "rules_bison", version = "0.2.2")
bazel_dep(name = "rules_flex", version = "0.2.1")
bazel_dep(name = "rules_m4", version = "0.2.3")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_bison", version = "0.3")
bazel_dep(name = "rules_flex", version = "0.3")
bazel_dep(name = "rules_m4", version = "0.2.4")
bazel_dep(name = "rules_cc", version = "0.1.0")

bazel_dep(name = "bazel_clang_tidy", dev_dependency = True)
git_override(
Expand Down Expand Up @@ -106,7 +106,7 @@ http_archive(

# Required for llvm-project.
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3", repo_name = "llvm_zlib")
bazel_dep(name = "zlib", version = "1.3.1.bcr.4", repo_name = "llvm_zlib")
bazel_dep(name = "zstd", version = "1.5.6", repo_name = "llvm_zstd")

###############################################################################
Expand Down Expand Up @@ -143,7 +143,7 @@ use_repo(llvm_project, "llvm-project")
# Python
###############################################################################

bazel_dep(name = "rules_python", version = "0.33.1")
bazel_dep(name = "rules_python", version = "1.0.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
Expand Down
Loading

0 comments on commit ccf51ce

Please sign in to comment.