intellij-rust / intellij-rust

Rust plugin for the IntelliJ Platform
https://intellij-rust.github.io
MIT License
4.53k stars 380 forks source link

Flags for cargo run commands are passed to cargo build #6617

Open fxwiegand opened 3 years ago

fxwiegand commented 3 years ago

Environment

Problem description

Flags for cargo run commands seem to be wrongly passed on to cargo build. When I add a new run configuration containing -l, I receive the following error message:

error: Found argument '-l' which wasn't expected, or isn't valid in this context

and

/Users/felixwiegand/.cargo/bin/cargo +stable build --color=always -l --message-format=json-diagnostic-rendered-ansi
error: Found argument '-l' which wasn't expected, or isn't valid in this context
USAGE:
    cargo build --color <WHEN>
For more information try --help
Process finished with exit code 1

Removing the -l flag makes everything compile and work as usual.

Steps to reproduce

Simply add a new run configuration with a flag that is not valid for the cargo build command.

avantgardnerio commented 1 year ago

There seem to be multiple issues all related to inappropriate command line arguments being passed to cargo. It would be extremely helpful to allow users to see, and override any options so that each one did not have to be it's own bug.