Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Invalid arguments when using rust 1.13 (nightly) #69

Closed
LaylBongers opened this issue Aug 18, 2016 · 7 comments · Fixed by #74
Closed

Invalid arguments when using rust 1.13 (nightly) #69

LaylBongers opened this issue Aug 18, 2016 · 7 comments · Fixed by #74

Comments

@LaylBongers
Copy link

Updated rust today, and got an invalid arguments error. Looking into this it seems cargo has a problem with the -- --error-format=json part. Asking in the #rust channel it seems this was never an accepted way to pass commands to rustc via cargo. Using the rustc option however will result in "invalid specified features" errors being spammed for every line of output given from cargo.

@LaylBongers
Copy link
Author

After the update to linter-rust that just now landed, the "rustc" option works fine but the "build" option produces no errors at all even with syntax errors in the file.

@White-Oak
Copy link
Member

Adding options after '--' was always the way to pass an additional options to rustc.

I'll see what I can do to fix 'build' command (Sorry for the inconvenience, it was my PR that broke some things down)

@rebo
Copy link

rebo commented Aug 28, 2016

Just to let you know that I am also getting the issue where the "build" option is producing zero errors.

@White-Oak
Copy link
Member

Can you specify your OS, rustc version please?

@Henning-K
Copy link

Henning-K commented Aug 31, 2016

I just re-enabled this plugin again after I had an issue with a previous version ("EPERM: access denied something something") and I also get no error messages.
@White-Oak Win7, rustc-1.13.0-nightly (eac41469d 2016-08-30)

edit: fixed quotation marks

@LaylBongers
Copy link
Author

@White-Oak

rustc 1.13.0-nightly (aef6971ca 2016-08-17)
cargo 0.13.0-nightly (4c21961 2016-08-17)

@White-Oak
Copy link
Member

White-Oak commented Sep 2, 2016

@LaylConway so yes, it basically was wrong to think that cargo build would accept the same way to pass arguments to compiler as cargo rustc. And, yes, build and run commands can't pass arguments to compiler. I'll try to make an issue on cargo project to decide how to fix this. In the meantime. you can use rustc option to get actual error messages.

EDIT: this is probably solved by using RUSTFLAGS variable. I'll try this out.

White-Oak added a commit to White-Oak/linter-rust that referenced this issue Sep 2, 2016
Closes AtomLinter#69

Also fixed the way envinronment variables were passed to BufferedProcess --
according to [the documentation](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)
(*`BufferedProcess` is actually a wrapper above node's exec*)
they should be passed in an `env` subobject of `options`, but they were passed as raw in options object.
Adding to these environment variables accordingly set `RUSTFLAGS` variable, when JSON errors are available, makes cargo tell compiler to
output JSON errors.
When using `rustc` simply providing `--error-format=json` is enough to make compiler do what we want.
White-Oak added a commit to White-Oak/linter-rust that referenced this issue Sep 2, 2016
Closes AtomLinter#69

Also fixed the way envinronment variables were passed to BufferedProcess --
according to [the documentation](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)
(*`BufferedProcess` is actually a wrapper above node's exec*)
they should be passed in an `env` subobject of `options`, but they were passed as raw in options object.
Adding to these environment variables accordingly set `RUSTFLAGS` variable, when JSON errors are available, makes cargo tell compiler to
output JSON errors.
When using `rustc` simply providing `--error-format=json` is enough to make compiler do what we want.
@gmist gmist closed this as completed in #74 Sep 2, 2016
gmist pushed a commit that referenced this issue Sep 2, 2016
Fixed the way json errors are requested from cargo & rustc. Closes #69
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants