Skip to content

Commit

Permalink
* Update Clang to 17.0.6 but keep last supported intel/mac version.
Browse files Browse the repository at this point in the history
* Fix clang-format detection for the external repo.
* Support version 19 in auto-detection.
  • Loading branch information
helly25 committed Mar 24, 2024
1 parent c40fe4f commit e905b83
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")

llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "17.0.4",
llvm_versions = {
"": "17.0.6",
"darwin-x86_64": "15.0.7", # For Intel based macs.
},
)

load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
Expand Down
6 changes: 5 additions & 1 deletion mbo/mope/mope.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ def _clang_format_impl(ctx, src, dst):
command = """
CLANG_FORMAT="{clang_format}"
if [ "{clang_format}" == "clang-format-auto" ]; then
if [ -x "${{LLVM_PATH}}/bin/clang-format" ]; then
if [ -x "external/llvm_toolchain_llvm/bin/clang-format" ]; then
CLANG_FORMAT="external/llvm_toolchain_llvm/bin/clang-format"
elif [ -x "${{LLVM_PATH}}/bin/clang-format" ]; then
CLANG_FORMAT="${{LLVM_PATH}}/bin/clang-format"
elif [ $(which "clang_format") ]; then
CLANG_FORMAT="clang_format"
elif [ $(which "clang-format-19") ]; then
CLANG_FORMAT="clang-format-19"
elif [ $(which "clang-format-18") ]; then
CLANG_FORMAT="clang-format-18"
elif [ $(which "clang-format-17") ]; then
Expand Down
5 changes: 2 additions & 3 deletions workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ def mbo_workspace_load_modules():
)

github_archive(
# Need a version > 0.10.3 to enable Clang v17.
name = "toolchains_llvm",
commit = "ade23e0e37c5308162c012a4f4224459c1c4fa22",
commit = "aa779570ae8ab4cc77c8ad5d823be6707f4b1f93",
repo = "https://github.com/bazel-contrib/toolchains_llvm",
sha256 = "c3764286d31738c3ee73397568272ddf71f1dbd443998920358fd797022d747f",
sha256 = "6bee8d99a22b9c1b872c383a50ffc14efaa88cab1afcbe6f612916120ea3e761",
)

0 comments on commit e905b83

Please sign in to comment.