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

error: "multiple input filenames provided" #2566

Closed
matthiaskrgr opened this issue Mar 24, 2018 · 12 comments
Closed

error: "multiple input filenames provided" #2566

matthiaskrgr opened this issue Mar 24, 2018 · 12 comments

Comments

@matthiaskrgr
Copy link
Member

Todays nightly breakage:

cargo new --bin clippy_test
cd clippy_test
cargo clippy

fails with

bin: clippy_test
   Compiling clippy_test v0.1.0 (file:///tmp/clippy_test)
error: multiple input filenames provided
error: Could not compile `clippy_test`.
To learn more, run the command again with --verbose.

I have on ideas what is going on there :/ I tried adding --verbose but that didn't help at all.

@matthiaskrgr
Copy link
Member Author

Ok I can still run it by running ~/.cargo/bin/cargo-clippy in my program source git repo.
Maybe this related to cargo switching to clap?

@rcoh
Copy link
Contributor

rcoh commented Mar 24, 2018

Same problem, although ~/.cargo/bin/cargo-clippy doesn't work

error while loading shared libraries: librustc_driver-db41696708e95c28.so: cannot open shared object file: No such file or directory

@ghost
Copy link

ghost commented Mar 24, 2018

I think the issue is that cargo is now passing cargo-clippy the argument clippy. Maybe this is a bug in cargo.

@mthiesen
Copy link

I think you are right. The commit that caused this is probably this:
https://github.com/rust-lang/cargo/pull/5209/files

The test case even verifies that the test program cargo-foo gets passed foo as a parameter.

@matthiaskrgr
Copy link
Member Author

@rcoh I assume you use the nightly toolchain, did you rebuild clippy after upgrading nightly?
Clippy links against rustc components so after upgrading nightly it needs to relink against the latest version.

@ghost
Copy link

ghost commented Mar 24, 2018

Well, it can't be the "clippy" argument because stable also does that. I also think it has something to do with clap.

@mthiesen
Copy link

I am pretty sure that this is the issue, the clippy parameter is passed verbatim to rustc which confuses it.

This works for me: mthiesen@cb2ef1e

I just remove the clippy parameter if it is present. Whether this is a good solution for the problem is another question.

@ehuss
Copy link
Contributor

ehuss commented Mar 24, 2018

I think that this recent change to the arguments (47a7066) should be reverted. It was just a temporary hiccup that nightly cargo was not forwarding the command name to subcommands.

https://github.com/rust-lang-nursery/rust-clippy/blob/09725c8c0d7e0c08a62dc90218518e8d4bb93f9f/src/main.rs#L151

@oli-obk
Copy link
Contributor

oli-obk commented Mar 25, 2018

Thank you all for the diagnostics work. I should've payed more attention to why I need to make this change...

@ElBe-Plaq
Copy link

The issue is still reproducible with the error message

error: multiple input filenames provided (first two filenames are `-` and `--exclude`)

@lauralt
Copy link

lauralt commented Apr 12, 2024

Should the issue be reopened if it's still reproducible? I couldn't find an open issue for this.

@ElBe-Plaq
Copy link

That'd be great.

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

7 participants