Update versions in bazeliskrc and MODULE.bazel (#3769)

The patches to bazel_clang_tidy were adopted upstream and are no longer
necessary, so I think we can simplify to git_override.

This fixes an existing issue where bazel was complaining that some rules
indirectly requested rules_python 0.29.0.

Note I'm not updating protobuf or com_google_libprotobuf_mutator. This
is because I get build errors with a protobuf -> abseil dependency if
updating.

Co-authored-by: josh11b <github-llvm@technomagi.com>
This commit is contained in:
Jon Ross-Perkins
2024-03-12 19:56:35 +00:00
committed by GitHub
co-authored by josh11b
parent 50e5dd7754
commit 4fb4fd3738
6 changed files with 620 additions and 805 deletions
+1 -1
View File
@@ -4,4 +4,4 @@
# Keep pinned to a recent release, listed at
# https://github.com/bazelbuild/bazel.
USE_BAZEL_VERSION=7.0.1
USE_BAZEL_VERSION=7.1.0
+14 -20
View File
@@ -24,12 +24,12 @@ http_archive = use_repo_rule(
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(
name = "abseil-cpp",
version = "20240116.0",
version = "20240116.1",
repo_name = "com_google_absl",
)
bazel_dep(
name = "re2",
version = "2024-02-01",
version = "2024-03-01",
repo_name = "com_googlesource_code_re2",
)
bazel_dep(
@@ -76,7 +76,7 @@ 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.0-rc1")
bazel_dep(name = "rules_proto", version = "6.0.0-rc2")
bazel_dep(
name = "protobuf",
version = "21.7",
@@ -93,18 +93,12 @@ http_archive(
urls = ["https://github.com/google/libprotobuf-mutator/archive/v{0}.tar.gz".format(libprotobuf_mutator_version)],
)
clang_tidy_version = "d2aecc583d14c9554febeab185833c1e8cce5384"
http_archive(
name = "bazel_clang_tidy",
patch_args = ["-p1"],
patches = [
"@carbon//bazel/bazel_clang_tidy:0001_Add_hdrs.patch",
"@carbon//bazel/bazel_clang_tidy:0002-Add-a-workaround-for-a-bug-in-clang-tidy-16-and-C-20.patch",
],
sha256 = "89c198a9f544beac119bb41904d16d8870686ccb5fe946442c1576934c9e6869",
strip_prefix = "bazel_clang_tidy-{0}".format(clang_tidy_version),
urls = ["https://github.com/erenon/bazel_clang_tidy/archive/{0}.tar.gz".format(clang_tidy_version)],
bazel_dep(name = "bazel_clang_tidy", dev_dependency = True)
git_override(
module_name = "bazel_clang_tidy",
# HEAD as of 2024-03-12.
commit = "bff5c59c843221b05ef0e37cef089ecc9d24e7da",
remote = "https://github.com/erenon/bazel_clang_tidy.git",
)
bazel_cc_toolchain = use_extension(
@@ -118,15 +112,15 @@ register_toolchains("@bazel_cc_toolchain//:all")
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
# HEAD as of 2023-12-19.
commit = "af167878427c469db96444b65f026d064ec62a4f",
# HEAD as of 2024-03-12.
commit = "204aa593e002cbd177d30f11f54cff3559110bb9",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)
# Required for llvm-project.
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "zlib", version = "1.3", repo_name = "llvm_zlib")
bazel_dep(name = "zstd", version = "1.5.5", repo_name = "llvm_zstd")
bazel_dep(name = "zlib", version = "1.3.1.bcr.1", repo_name = "llvm_zlib")
bazel_dep(name = "zstd", version = "1.5.5.bcr.1", repo_name = "llvm_zstd")
###############################################################################
# llvm-project
@@ -163,7 +157,7 @@ use_repo(llvm_project, "llvm-project")
# Python
###############################################################################
bazel_dep(name = "rules_python", version = "0.27.1")
bazel_dep(name = "rules_python", version = "0.31.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
+605 -706
View File
File diff suppressed because it is too large Load Diff
@@ -1,25 +0,0 @@
From c2b1cfb7ec8ba667218382b97a986a3ef2f7ff56 Mon Sep 17 00:00:00 2001
From: jonmeow <jperkins@google.com>
Date: Fri, 5 Jan 2024 10:35:19 -0800
Subject: [PATCH] Add hdrs so that clang-tidy runs on them directly.
---
clang_tidy/clang_tidy.bzl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl
index 4d515fc..1af7ee4 100644
--- a/clang_tidy/clang_tidy.bzl
+++ b/clang_tidy/clang_tidy.bzl
@@ -94,6 +94,9 @@ def _rule_sources(ctx):
if hasattr(ctx.rule.attr, "srcs"):
for src in ctx.rule.attr.srcs:
srcs += [src for src in src.files.to_list() if src.is_source and check_valid_file_type(src)]
+ if hasattr(ctx.rule.attr, "hdrs"):
+ for src in ctx.rule.attr.hdrs:
+ srcs += [src for src in src.files.to_list() if src.is_source and check_valid_file_type(src)]
return srcs
def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile):
--
2.43.0.472.g3155946c3a-goog
@@ -1,44 +0,0 @@
From f383ddf21542762b883cfa1fb39599e094647fc5 Mon Sep 17 00:00:00 2001
From: Chandler Carruth <chandlerc@gmail.com>
Date: Sat, 27 Jan 2024 00:16:09 +0000
Subject: [PATCH] Add a workaround for a bug in clang-tidy 16 and C++20.
In that mode, the Bazel suppression of a Clang warning doesn't actually
suppress the clang-tidy check. Neither does disabling the check in
a `.clang-tidy` config file. Instead, disable it directly on the command
line when running `clang-tidy`. The clang-tidy bug is:
https://github.com/llvm/llvm-project/issues/61969
This is harmless for other versions as this check is not useful with
most Bazel configurations, and can be achieved with a compiler warning
if truly needed.
Fixes #29
---
clang_tidy/run_clang_tidy.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh
index aa6598c..5cddb59 100755
--- a/clang_tidy/run_clang_tidy.sh
+++ b/clang_tidy/run_clang_tidy.sh
@@ -25,4 +25,16 @@ test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy
logfile="$(mktemp)"
trap 'if (($?)); then cat "$logfile" 1>&2; fi; rm "$logfile"' EXIT
+# Prepend a flag-based disabling of a check that has a serious bug in
+# clang-tidy 16 when used with C++20. Bazel always violates this check and the
+# warning is typically disabled, but that warning disablement doesn't work
+# correctly in this circumstance and so we need to disable it at the clang-tidy
+# level both as a check and from `warnings-as-errors` to avoid it getting
+# re-promoted to an error. See the clang-tidy bug here for details:
+# https://github.com/llvm/llvm-project/issues/61969
+set -- \
+ --checks=-clang-diagnostic-builtin-macro-redefined \
+ --warnings-as-errors=-clang-diagnostic-builtin-macro-redefined \
+ "$@"
+
"${CLANG_TIDY_BIN}" "$@" >"$logfile" 2>&1
--
2.43.0
-9
View File
@@ -1,9 +0,0 @@
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
package(default_visibility = ["//visibility:public"])
exports_files(glob([
"*.patch",
]))