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

Doesn't work with custom rustc path #2765

Open
valff opened this issue May 16, 2018 · 3 comments
Open

Doesn't work with custom rustc path #2765

valff opened this issue May 16, 2018 · 3 comments

Comments

@valff
Copy link

valff commented May 16, 2018

cargo clippy doesn't work with the following .cargo/config:

[build]
rustc = ".cargo/rustc.sh"

Output:

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/val/.cargo/bin/clippy-driver /home/val/Projects/drone-os/drone-stm32/.cargo/rustc.sh - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 101)
--- stderr
error: multiple input filenames provided

.cargo/rustc.sh is just a wrapper:

#!/bin/bash
exec rustc --cfg procmacro2_semver_exempt $@

The wrapper is needed because of rust-lang/cargo#4423.


clippy v0.0.200
rustc 1.27.0-nightly (f0fdaba04 2018-05-15)

@valff
Copy link
Author

valff commented May 16, 2018

Looks like the issue starts here: https://github.com/rust-lang-nursery/rust-clippy/blob/master/src/driver.rs#L165

    if orig_args[1] == "rustc" {
        // we still want to be able to invoke it normally though
        orig_args.remove(1);
    }

@oli-obk
Copy link
Contributor

oli-obk commented May 16, 2018

yea sorry, we need that hack for cargo-clippy.

The hack is at https://github.com/rust-lang-nursery/rust-clippy/blob/master/src/main.rs#L101

What you can do is change your script to use $RUSTC_WRAPPER instead of rustc. That should work.

@uberjay
Copy link

uberjay commented Jun 3, 2018

Unrelated to your actual issue, but you probably want to quote the args in your wrapper script.

exec rustc --cfg procmacro2_semver_exempt "$@"

😬

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