Skip to content
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

Using clippy from a rustup linked toolchain doesn't work. #2548

Closed
vext01 opened this issue Nov 5, 2020 · 7 comments
Closed

Using clippy from a rustup linked toolchain doesn't work. #2548

vext01 opened this issue Nov 5, 2020 · 7 comments

Comments

@vext01
Copy link

vext01 commented Nov 5, 2020

Originally discussed here.

Running cargo clippy when the project's toolchain has been overridden to a linked rustup toolchain doesn't work.

$ cargo clippy
error: 'cargo-clippy' is not installed for the toolchain 'yk-stage1'
To install, run `rustup component add clippy --toolchain yk-stage1`
$ rustup toolchain list -v
nightly-x86_64-unknown-linux-gnu (default)      /home/vext01/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu                                              
yk-stage1 (override)    /home/vext01/research/yorick/ykrustc/build/x86_64-unknown-linux-gnu/stage1                                                            

But running the tool manually with a library path set does work:

LD_LIBRARY_PATH=/home/vext01/research/yorick/ykrustc/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib \
    /home/vext01/research/yorick/ykrustc/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/cargo-clippy
@jyn514
Copy link
Member

jyn514 commented Nov 5, 2020

@vext01 I would expect this to be an x.py bug and not a rustup bug. Notice how the path with clippy is in stage1-tools, not stage1.

@jyn514
Copy link
Member

jyn514 commented Nov 5, 2020

See also rust-lang/rust#78717 and rust-lang/rust#76666.

@vext01
Copy link
Author

vext01 commented Nov 5, 2020

I see. So shall we close this?

@vext01
Copy link
Author

vext01 commented Nov 5, 2020

But wait.

To be clear, the error comes from running cargo clippy in a normal rust project (not the compiler) where the toolchain has been overridden. I don't think x.py is involved, is it?

@jyn514
Copy link
Member

jyn514 commented Nov 5, 2020

x.py needs to build clippy and put it in stage1/bin before rustup can use it. stage1-tools does not have a full toolchain.

@vext01
Copy link
Author

vext01 commented Nov 5, 2020

Ah yes, gotcha. It's building a clippy, but I guess it aint in the right place :)

@kinnison
Copy link
Contributor

kinnison commented Nov 6, 2020

I don't think this is an issue for rustup, so I'll close it. If I've misunderstood, please ping me and I'll reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants