toolchain: Clippy lints add categories to avoid ambiguity
This CL makes it so that the GetClippyLints endpoint in the BUILD API now
adds categories to package names when emerging. This prevents some
ambiguities which have previosuly broken builds.
BUG=b:195434166
TEST=./call_scripts
Change-Id: I15493cc065aad7b5f9b19c721e5877811280f4a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3069427
Commit-Queue: Allen Webb <allenwebb@google.com>
Reviewed-by: Andrew Lamb <andrewlamb@chromium.org>
Reviewed-by: Allen Webb <allenwebb@google.com>
Tested-by: Allen Webb <allenwebb@google.com>
diff --git a/api/controller/toolchain.py b/api/controller/toolchain.py
index a49392f..1c6c4d1 100644
--- a/api/controller/toolchain.py
+++ b/api/controller/toolchain.py
@@ -386,10 +386,12 @@
def GetClippyLints(input_proto, output_proto, _config):
"""Emerges the given packages and retrieves any findings from Cargo Clippy."""
emerge_cmd = chroot_util.GetEmergeCommand(input_proto.sysroot.path)
- package_names = [package.package_name for package in input_proto.packages]
+ packages = [
+ f'{package.category}/{package.package_name}'
+ for package in input_proto.packages]
cros_build_lib.sudo_run(
- emerge_cmd + package_names,
- preserve_env=True,
- extra_env={'ENABLE_RUST_CLIPPY':1}
+ emerge_cmd + packages,
+ preserve_env=True,
+ extra_env={'ENABLE_RUST_CLIPPY': 1}
)
output_proto.findings.extend(_fetch_clippy_lints())