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

Add support for rustc's --error-format short #5879

Merged
merged 4 commits into from
Aug 12, 2018

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Aug 9, 2018

Running a local build of this branch on some broken code shows this kind of output:

18:42:29 $ dcargo check --message-format=short --tests
    Checking bufstream v0.1.3
    Checking cargo v0.30.0 (file:///d/cargo)
tests/testsuite/config.rs:298:9: error[E0308]: mismatched types
tests/testsuite/config.rs:307:9: error[E0308]: mismatched types
tests/testsuite/config.rs:363:9: error[E0308]: mismatched types
tests/testsuite/config.rs:367:9: error[E0308]: mismatched types
tests/testsuite/config.rs:371:9: error[E0308]: mismatched types
tests/testsuite/config.rs:375:9: error[E0308]: mismatched types
tests/testsuite/config.rs:382:9: error[E0308]: mismatched types
tests/testsuite/config.rs:386:9: error[E0308]: mismatched types
tests/testsuite/config.rs:400:9: error[E0308]: mismatched types
tests/testsuite/config.rs:428:9: error[E0308]: mismatched types
tests/testsuite/config.rs:479:9: error[E0308]: mismatched types
tests/testsuite/config.rs:491:9: error[E0308]: mismatched types
tests/testsuite/config.rs:496:9: error[E0308]: mismatched types
tests/testsuite/config.rs:501:9: error[E0308]: mismatched types
tests/testsuite/config.rs:506:9: error[E0308]: mismatched types
tests/testsuite/config.rs:512:9: error[E0308]: mismatched types
tests/testsuite/config.rs:582:9: error[E0308]: mismatched types
tests/testsuite/config.rs:660:9: error[E0308]: mismatched types
tests/testsuite/config.rs:666:9: error[E0308]: mismatched types
tests/testsuite/config.rs:672:9: error[E0308]: mismatched types
tests/testsuite/config.rs:678:9: error[E0308]: mismatched types
error: aborting due to 21 previous errors
error: Could not compile `cargo`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Rehash of @QuietMisdreavus' #4720 now that --short-message is stable (thanks for the ping @pickfire!).

Feedback welcome.

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@dwijnand
Copy link
Member Author

dwijnand commented Aug 9, 2018

Should I remove .json_messages() so we make sure to handle the different message formats? For instance see this change in a parallel PR:

https://github.com/rust-lang/cargo/pull/5878/files#diff-7f98585dbf9d30aa100c8318e2c77e79R608

@alexcrichton
Copy link
Member

This looks good to me, thanks! And yeah I think it may be fine to test out how verbose a removal of .json_messages() looks like, if it's a pretty small diff I think it should be safe to remove

@@ -745,8 +745,10 @@ fn build_base_args<'a, 'cfg>(
add_path_args(bcx, unit, cmd);
add_color(bcx, cmd);

if bcx.build_config.json_messages() {
cmd.arg("--error-format").arg("json");
match bcx.build_config.message_format {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you rebase, I think it would be nice to pull this out into a separate function so that both the rustc and rustdoc calls could share the same code.

Running a local build of this branch on some broken code shows this kind of output:

    18:42:29 $ dcargo check --message-format=short --tests
        Checking bufstream v0.1.3
        Checking cargo v0.30.0 (file:///d/cargo)
    tests/testsuite/config.rs:298:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:307:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:363:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:367:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:371:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:375:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:382:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:386:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:400:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:428:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:479:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:491:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:496:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:501:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:506:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:512:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:582:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:660:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:666:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:672:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:678:9: error[E0308]: mismatched types
    error: aborting due to 21 previous errors
    error: Could not compile `cargo`.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
@dwijnand
Copy link
Member Author

@ehuss done

@alexcrichton I tested it and didn't like the look of it (I could see someone, like myself, cleaning it up after). I think this is just the reality of changing algebraic data types combined with parallel development. But let me know if you have any further thoughts!

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Aug 10, 2018

📌 Commit 2c704d8 has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Aug 10, 2018

⌛ Testing commit 2c704d8 with merge ef1b6453ba0c27337ae35f82c585a3f9b8da5dc2...

@bors
Copy link
Collaborator

bors commented Aug 10, 2018

💔 Test failed - status-travis

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Collaborator

bors commented Aug 10, 2018

⌛ Testing commit 2c704d8 with merge 03c55c688d8d1dc7ae7fb0672fc51b39cdd4ea4f...

@bors
Copy link
Collaborator

bors commented Aug 10, 2018

💔 Test failed - status-travis

@dwijnand
Copy link
Member Author

Travis CI failed even worst this time round.. 😕

error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/travis/.rustup/tmp/o4tx0_y55x5dl6yn_file'
info: caused by: error during download
info: caused by: [28] Timeout was reached (Connection timed out after 30000 milliseconds)

@dwijnand
Copy link
Member Author

This could use a @bors: retry when someone gets a second.

@ehuss
Copy link
Contributor

ehuss commented Aug 12, 2018

@bors retry

@bors
Copy link
Collaborator

bors commented Aug 12, 2018

⌛ Testing commit 2c704d8 with merge 972ccba...

bors added a commit that referenced this pull request Aug 12, 2018
Add support for rustc's --error-format short

Running a local build of this branch on some broken code shows this kind of output:

    18:42:29 $ dcargo check --message-format=short --tests
        Checking bufstream v0.1.3
        Checking cargo v0.30.0 (file:///d/cargo)
    tests/testsuite/config.rs:298:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:307:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:363:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:367:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:371:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:375:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:382:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:386:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:400:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:428:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:479:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:491:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:496:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:501:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:506:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:512:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:582:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:660:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:666:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:672:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:678:9: error[E0308]: mismatched types
    error: aborting due to 21 previous errors
    error: Could not compile `cargo`.
    warning: build failed, waiting for other jobs to finish...
    error: build failed

Rehash of @QuietMisdreavus' #4720 now that `--short-message` is stable (thanks for the ping @pickfire!).

Feedback welcome.
@bors
Copy link
Collaborator

bors commented Aug 12, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 972ccba to master...

@bors bors merged commit 2c704d8 into rust-lang:master Aug 12, 2018
@dwijnand dwijnand deleted the short-errors branch August 12, 2018 16:05
bors added a commit to rust-lang/rust that referenced this pull request Aug 15, 2018
Update cargo

- Update transitioning url (rust-lang/cargo#5889)
- Resolve some clippy lint warnings (rust-lang/cargo#5884)
- Don't kill child processes on normal exit on Windows (rust-lang/cargo#5887)
- fix a bunch of clippy warnings (rust-lang/cargo#5876)
- Add support for rustc's --error-format short (rust-lang/cargo#5879)
- Support JSON with rustdoc. (rust-lang/cargo#5878)
- Fix rustfmt instructions in CONTRIBUTING.md (rust-lang/cargo#5880)
- Allow `cargo run` in workspaces. (rust-lang/cargo#5877)
- Change target filters in workspaces. (rust-lang/cargo#5873)
- Improve verbose console and log for finding git repo in package check (rust-lang/cargo#5858)
- Meta rename (rust-lang/cargo#5871)
- fetch: skip target tests when cross_compile is disabled (rust-lang/cargo#5870)
- Fully capture rustc and rustdoc output when -Zcompile-progress is passed (rust-lang/cargo#5862)
- Fix test --example docs. (rust-lang/cargo#5867)
- Add a feature to build a vendored OpenSSL (rust-lang/cargo#5865)
@ehuss ehuss added this to the 1.30.0 milestone Feb 6, 2022
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

Successfully merging this pull request may close these issues.

5 participants