Skip to content

Commit ad59a10

Browse files
author
Vinh Tran
committed
Reproduce bug in clippy-driver
1 parent 50b9ef3 commit ad59a10

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

rust/private/clippy.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ def _clippy_aspect_impl(target, ctx):
8888
cc_toolchain, feature_configuration = find_cc_toolchain(ctx)
8989

9090
dep_info, build_info, linkstamps = collect_deps(
91-
deps = crate_info.deps,
91+
deps = depset(direct = crate_info.deps.to_list()),
9292
proc_macro_deps = crate_info.proc_macro_deps,
9393
aliases = crate_info.aliases,
9494
# Clippy doesn't need to invoke transitive linking, therefore doesn't need linkstamps.
9595
are_linkstamps_supported = False,
96+
from_clippy = True,
9697
)
9798

9899
compile_inputs, out_dir, build_env_files, build_flags_files, linkstamp_outs, ambiguous_libs = collect_inputs(

rust/private/rustc.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ def collect_deps(
195195
deps,
196196
proc_macro_deps,
197197
aliases,
198-
are_linkstamps_supported = False):
198+
are_linkstamps_supported = False,
199+
from_clippy = False):
199200
"""Walks through dependencies and collects the transitive dependencies.
200201
201202
Args:
@@ -224,7 +225,15 @@ def collect_deps(
224225
transitive_metadata_outputs = []
225226

226227
crate_deps = []
228+
counter = 0
227229
for dep in depset(transitive = [deps, proc_macro_deps]).to_list():
230+
if from_clippy:
231+
# Change limit to 23 to reproduce error with duplicate --sysroot flag
232+
if counter == 22:
233+
break
234+
else:
235+
counter += 1
236+
228237
crate_group = None
229238

230239
if type(dep) == "Target" and rust_common.crate_group_info in dep:

0 commit comments

Comments
 (0)