Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to bazel 8.0.0 #4729

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
31 changes: 21 additions & 10 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build --flag_alias=nightly_date=//bazel/version:nightly_date
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
build:clang-tidy --output_groups=report
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
build:clang-tidy --action_env=PATH --host_action_env=PATH

# This warning seems to incorrectly fire in this build configuration, despite
# not firing in our normal builds.
Expand All @@ -46,6 +47,10 @@ build --disk_cache=~/.cache/carbon-lang-build-cache
# future Bazel releases.
build --experimental_guard_against_concurrent_changes

# Used by clang_configuration.bzl.
build --action_env=CC --host_action_env=CC
build --action_env=CMAKE_SYSROOT --host_action_env=CMAKE_SYSROOT

# Disable warnings for all external compilations. These involve code that isn't
# developed as part of Carbon and may be difficult or impossible to patch, so
# warnings aren't likely to be actionable.
Expand All @@ -57,16 +62,6 @@ build --host_per_file_copt=external/.*\.(c|cc|cpp|cxx)$@-w
build --per_file_copt=utils/treesitter/_treesitter.tree_sitter/.*\.c$@-w
build --host_per_file_copt=utils/treesitter/_treesitter.tree_sitter/.*\.c$@-w

# The `cc_proto_library` rule doesn't allow providing `copts`:
# https://github.com/bazelbuild/bazel/issues/22610
#
# We unfortunately need to work around issues with `-Wmissing-prototypes` in
# generated protobuf code, so pass the `copt` manually here. The warning issue
# is likely part of:
# https://github.com/llvm/llvm-project/issues/94138
build --per_file_copt=.*\.pb\.cc$@-Wno-missing-prototypes
build --host_per_file_copt=.*\.pb\.cc$@-Wno-missing-prototypes

# Default dynamic linking to off. While this can help build performance in some
# edge cases with very large linked executables and a slow linker, between using
# fast linkers on all platforms (LLD and the Apple linker), as well as having
Expand Down Expand Up @@ -132,3 +127,19 @@ build --allow_unresolved_symlinks=false
# Allow users to override any of the flags desired by importing a user-specific
# 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.
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ repos:
- id: clang-format
name: clang-format
entry: clang-format
types_or: [c++, proto, def]
types_or: [c++, def]
language: python
args: ['-i']
additional_dependencies: ['clang-format==17.0.1']
Expand Down Expand Up @@ -184,7 +184,7 @@ repos:
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- --custom_format
- '\.(carbon|c|json|proto|scss|ypp)(\.tmpl)?$'
- '\.(carbon|c|json|scss|ypp)(\.tmpl)?$'
- ''
- '// '
- ''
Expand Down
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
38 changes: 13 additions & 25 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,27 +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_proto", version = "6.0.2")
bazel_dep(name = "protobuf", version = "27.1")

libprotobuf_mutator_version = "1.3"

http_archive(
name = "com_google_libprotobuf_mutator",
build_file = "@//:third_party/libprotobuf_mutator/BUILD.txt",
sha256 = "1ee3473a6b0274494fce599539605bb19305c0efadc62b58d645812132c31baa",
strip_prefix = "libprotobuf-mutator-{0}".format(libprotobuf_mutator_version),
urls = ["https://github.com/google/libprotobuf-mutator/archive/v{0}.tar.gz".format(libprotobuf_mutator_version)],
)
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 @@ -118,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 @@ -155,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
Loading