Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEmit JSON errors #30711
Conversation
rust-highfive
assigned
sfackler
Jan 5, 2016
This comment has been minimized.
This comment has been minimized.
|
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
huonw
reviewed
Jan 5, 2016
| @@ -855,6 +866,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> { | |||
| "NAME=PATH"), | |||
| opt::opt("", "sysroot", "Override the system root", "PATH"), | |||
| opt::multi("Z", "", "Set internal debugging options", "FLAG"), | |||
| opt::opt_u("", "output", "How errors and other mesasges are produced", "tty|json"), | |||
This comment has been minimized.
This comment has been minimized.
huonw
Jan 5, 2016
Member
I suspect we should have --output as the long form of -o, so maybe this could be --error-format or something? Also, the "tty" format might be better as "human", since e.g. json can go to a tty and the human-readable version can go to a file.
("Mesasges" is spelt wrong.)
This comment has been minimized.
This comment has been minimized.
atsky
referenced this pull request
Jan 5, 2016
Closed
Error and warning messages in JSON format #202
nrc
referenced this pull request
Jan 6, 2016
Closed
JSON errors with suggestions are incomplete #30701
This comment has been minimized.
This comment has been minimized.
|
r? @huonw (comment addressed) |
rust-highfive
assigned
huonw
and unassigned
sfackler
Jan 6, 2016
huonw
reviewed
Jan 7, 2016
| cp foo.rs $(TMPDIR) | ||
| cd $(TMPDIR) | ||
| $(RUSTC) -Z unstable-options --output=json foo.rs 2>foo.log || true | ||
| grep -q '{"message":"unresolved name `y`","code":{"code":"E0425","explanation":"\\nAn unresolved name was used. Example of erroneous codes.*"},"level":"error","span":{"file_name":"foo.rs","byte_start":523,"byte_end":524,"line_start":14,"line_end":14,"column_start":18,"column_end":19},"children":\[\]}' foo.log |
This comment has been minimized.
This comment has been minimized.
huonw
reviewed
Jan 7, 2016
| @@ -14,7 +14,6 @@ | |||
| pub use self::EntryFnType::*; | |||
| pub use self::CrateType::*; | |||
| pub use self::Passes::*; | |||
| pub use self::OptLevel::*; | |||
This comment has been minimized.
This comment has been minimized.
huonw
reviewed
Jan 7, 2016
| @@ -855,6 +866,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> { | |||
| "NAME=PATH"), | |||
| opt::opt("", "sysroot", "Override the system root", "PATH"), | |||
| opt::multi("Z", "", "Set internal debugging options", "FLAG"), | |||
| opt::opt_u("", "err-format", "How errors and other messages are produced", "human|json"), | |||
This comment has been minimized.
This comment has been minimized.
huonw
Jan 7, 2016
Member
The abbreviation of err instead of just using error doesn't seem worth it to me; thoughts?
This comment has been minimized.
This comment has been minimized.
nrc
Jan 7, 2016
Author
Member
Hmm, I started with error-format, and it just looked really long for an option. I agree err-format is not much better though
nrc
force-pushed the
nrc:json-errs
branch
from
bb7e80b
to
4be8667
Jan 11, 2016
This comment has been minimized.
This comment has been minimized.
|
@huonw comments addessed |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ I'm someone concerned about defacto stabilisation of the format, but it is under |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added a commit
that referenced
this pull request
Jan 11, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors retry |
bors
added a commit
that referenced
this pull request
Jan 11, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors: retry On Mon, Jan 11, 2016 at 4:40 PM, bors notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
|
I'm not sure why bors failing. It compiles fine. |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jan 12, 2016
This comment has been minimized.
This comment has been minimized.
|
|
nagisa
reviewed
Jan 12, 2016
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| // ignore-tidy-linelength |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nrc
added some commits
Dec 31, 2015
nrc
force-pushed the
nrc:json-errs
branch
from
ddbeb1f
to
68653e1
Jan 14, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors: r=huonw |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
bors
added a commit
that referenced
this pull request
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
|
|
nrc
force-pushed the
nrc:json-errs
branch
from
68653e1
to
82f8e5c
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors: r=huonw |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
merged commit 82f8e5c
into
rust-lang:master
Jan 15, 2016
nrc
added
the
relnotes
label
Jan 19, 2016
Stebalien
referenced this pull request
Feb 11, 2016
Closed
--color=always still checks for a terminal before printing colors #31546
oli-obk
referenced this pull request
Mar 4, 2016
Closed
Is it possible to get cargo's output as json? #1403
This comment has been minimized.
This comment has been minimized.
bruno-medeiros
commented
Mar 10, 2016
|
Interesting, definitely a welcome addition for the IDE world. However, I've only found out about this by chance, from seeing #30701 on Rust Weekly. Could we aggregate all changes related to IDE development in some communication channel/method? I was about to suggest an Issues label, however there doesn't seem to be a way to follow one, plus there might be changes spanning from more than one Git project (Cargo and rust for example), so it wouldn't work well to put under one label. Perhaps we could post about these changes on a tracker issue, like #31548 or a similar one? |
nrc commentedJan 5, 2016
The compiler can emit errors and warning in JSON format. This is a more easily machine readable form then the usual error output.
Closes #10492, closes #14863.