瀏覽代碼

Use rustfmt from third_party/rust-toolchain/bin directory.

Chromium now has rust toolchain in a well-established directory, which is properly gated with `use_rust` gclient variable. External projects can setup this directory using their own toolchains and have rustfmt work properly in presubmit format checks.

Bug: 1395070
Change-Id: I3d1de8278b9da0db1cdb75673cb7d637ce0273ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4070004
Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Aleksey Khoroshilov 2 年之前
父節點
當前提交
6e33ba049f
共有 1 個文件被更改,包括 2 次插入5 次删除
  1. 2 5
      rustfmt.py

+ 2 - 5
rustfmt.py

@@ -31,11 +31,8 @@ def FindRustfmtToolInChromiumTree():
         'Could not find checkout in any parent of the current path.\n'
         'Set CHROMIUM_BUILDTOOLS_PATH to use outside of a chromium checkout.')
 
-  # TODO(lukasza): Deduplicate the is-Rust-supported and find-Rust-binaries code
-  # by somehow sharing the `rust_prefix` variable from //build/config/rust.gni
-  tool_path = os.path.join(chromium_src_path, 'third_party',
-                           'android_rust_toolchain', 'toolchain', 'bin',
-                           'rustfmt' + gclient_paths.GetExeSuffix())
+  tool_path = os.path.join(chromium_src_path, 'third_party', 'rust-toolchain',
+                           'bin', 'rustfmt' + gclient_paths.GetExeSuffix())
   if not os.path.exists(tool_path):
     raise NotFoundError('File does not exist: %s' % tool_path)
   return tool_path