Closed
Description
Summary
The Bazel rules set for rust pass the same flags to clippy-driver
as it would pass to rustc
. This has worked till we hit a corner case (see bazelbuild/rules_rust#2447) where we set both --sysroot
flag and SYSROOT
env var and the --sysroot
flag ends up in a param file that rustc correctly handles.
Reproducer
- Create a file
@program.params
with--sysroot=""
- Run
SYSROOT="" clippy-driver @program.params
I expected to see the command not to fail because SYSROOT="" clippy-driver --sysroot
works fine.
Instead, it fails with
error: Option 'sysroot' given more than once
because
Line 191 in 66c29b9
checks whether the args includes
--sysroot
but doesn't check whether @program.params
includes --sysroot
.
Version
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: aarch64-apple-darwin
release: 1.75.0
LLVM version: 17.0.6
Additional Labels
No response