From 81351dd1a9f60010b1a7db2209a1578ebe6a57b0 Mon Sep 17 00:00:00 2001 From: Calvin Date: Tue, 16 Jul 2024 08:21:18 -0700 Subject: [PATCH] build: fix clang format location helper (again) (#42911) --- script/lib/util.py | 3 +++ script/run-clang-format.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/script/lib/util.py b/script/lib/util.py index 18452d9ed4..eb03a856fd 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -194,6 +194,9 @@ def get_buildtools_executable(name): chromium_platform = 'linux64' else: raise Exception(f"Unsupported platform: {sys.platform}") + + if name == 'clang-format': + chromium_platform += '-format' path = os.path.join(buildtools, chromium_platform, name) if sys.platform == 'win32': diff --git a/script/run-clang-format.py b/script/run-clang-format.py index dfb83dd866..0ec5013fd4 100644 --- a/script/run-clang-format.py +++ b/script/run-clang-format.py @@ -23,7 +23,7 @@ import traceback import tempfile from functools import partial -from lib.util import get_depot_tools_executable +from lib.util import get_buildtools_executable DEFAULT_EXTENSIONS = 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx,mm' DEFAULT_CLANG_FORMAT_IGNORE = '.clang-format-ignore' @@ -203,7 +203,7 @@ def main(): '--clang-format-executable', metavar='EXECUTABLE', help='path to the clang-format executable', - default=get_depot_tools_executable('clang-format')) + default=get_buildtools_executable('clang-format')) parser.add_argument( '--extensions', help='comma-separated list of file extensions'