-
Notifications
You must be signed in to change notification settings - Fork 481
Clippy Builds fail on 0.36.2 #2418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you give an example workspace for this? |
Yeah I'm surprised CI isn't failing. Several folks have reported this problem before and it seems like something I should look into fixing. @SvenKratzEasel I would appreciate if you have some steps to reproduce the bug. |
Here are the rust-related items from the WORKSPACE file:
Building any rust_clippy target will produce the above error. |
There's a full minimal-ish repro at https://github.com/dmeister/rules_rules_clippy_repo from https://bazelbuild.slack.com/archives/CSV56UT0F/p1704923287157729 A workaround is to set I suspect the fix may be just to not add the flag in clippy specifically. |
Thanks! I'll take a look. |
I think clippy should definitely be given an explicit sysroot. I struggle to see where the flag is being passed twice. I only see one instance if I print the args in the process wrapper |
I think clippy is setting it based on the env var being set - we set both If you apply this patch (which isn't on its own a solution, but could be cleaned up into one), the error goes away: % git diff
diff --git a/rust/private/clippy.bzl b/rust/private/clippy.bzl
index 9fd9842c..636212a6 100644
--- a/rust/private/clippy.bzl
+++ b/rust/private/clippy.bzl
@@ -171,6 +171,8 @@ See https://github.com/bazelbuild/rules_rust/pull/1264#discussion_r853241339 for
env["CLIPPY_CONF_DIR"] = "${{pwd}}/{}".format(ctx.file._config.dirname)
compile_inputs = depset([ctx.file._config], transitive = [compile_inputs])
+ env.pop("SYSROOT", None)
+
ctx.actions.run(
executable = ctx.executable._process_wrapper,
inputs = compile_inputs, |
Oh, I’m happy to remove the end var. I wanted that to happen when —sysroot was added. But why doesn’t this fail in CI now? |
I've opened #2428, does this help avoid the issue? |
An incomplete recap of this interesting problem As of rust-lang/rust-clippy#10149, setting both
Now, why is CI not failing? 👀 When I build a target in
This matches the action produced by https://github.com/dmeister/rules_rules_clippy_repo which also sets One difference between and rules_rust/examples/hello_world/BUILD.bazel Lines 5 to 9 in fe610da
is the former sets |
I suspect passing
and it passed Apparently, setting |
|
The fix to this issue should be done upstream in rust-lang/rust-clippy#12203. |
Closing this issue. This bug will be fixed when future rust release includes rust-lang/rust-clippy#12203. |
Building of clippy targets fail with the following message :
error: Option 'sysroot' given more than once
The text was updated successfully, but these errors were encountered: