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

Dull the errors #2421

Merged
merged 1 commit into from Mar 12, 2016

Conversation

Projects
None yet
4 participants
@sbeckeriv
Copy link
Contributor

sbeckeriv commented Feb 27, 2016

This resolves #426

Dearest Reviewer,

I have updated the error messages to use say_status at the shell level. I have also changed say_status to print the message in bold. I do think it looks nice but it does have the side effect of making some seemingly unrelated text bold. I do think it looks better bold but it is also very easy to revert. I have included examples of both.

Thank you,
Becker

Bold: Note the usage is bold.
screen shot 2016-02-27 at 10 49 05 am

No bold:
screen shot 2016-02-27 at 10 46 35 am

Both rendered on a mac with iterm 2.9.0

@rust-highfive

This comment has been minimized.

Copy link

rust-highfive commented Feb 27, 2016

r? @alexcrichton

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

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Feb 28, 2016

Thanks for the PR @sbeckeriv! I'm quite happy to see the UI of Cargo get some attention I feel like it's... been lacking for awhile :)

On one hand I think we may want to try to mirror the compiler's output as it's tried and true by this point as well. That would mean starting the error message with "error" instead of "Error" and using bold for the message. That runs the risk, however, of having Cargo's errors be indistinguishable from the compiler's errors, which could be unfortunate.

On the other hand I feel like it's definitely pretty bad today that we just print the entire message in red which makes it easy to overlook various parts. UI's not always been my strong suit, but I'm sure others may have opinions!

cc @rust-lang/tools, @brson, @wycats

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Feb 28, 2016

The lower case error is an easy change. Might I suggest "error[cargo]:" or "cargo error:". I often use something like the first format when sending email errors to tell me which system is having the error.

Thanks
Becker

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Feb 29, 2016

Hm "cargo error" may not be bad, yeah, we probably want to avoid "error[cargo]" unless the compiler also starts doing that as well.

I'm also a little curious why no tests needed to change? I would expect some tests need to be updated to match this output...

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 1, 2016

Playing with manual error cases I have found a few more for example using the bad-cksum package. I will also search for anywhere currently using RED.

My thought around "error[subsystem]" is that only the compiler would print "error" every other tool would identify itself in the message. I like "cargo error" just as well. I

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 1, 2016

[This is incorrect please see my next comment]
So funny story. The reason the test are green on github and they appear to pass locally is because I am running my test with the installed local cargo not the one I just built with the new error message. Also locally I get no output after the "test test_shell::no_term".

So before I go changing all the text in most of the test what are we thinking for text? Also should the test in the CI run on the newly compiled version of cargo?

I searched issues but found nothing about improving cargo's tests. I do not have a suggestion currently but the exact text matching is a bummer.

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 1, 2016

TLDR: mulitrust was causing my cargo tests to fail. I do have an errant error with no message after the test complete running running that I do not have with my installed version of cargo. What the errant error looks like https://gist.github.com/sbeckeriv/16bd5cabbcd32f9ae613

Long did read:
Ok. Now I am just embarrassing myself. I am running ./target/debug/cargo test or ./target/release/cargo test on master with a lot of failures. But my 0.7.0 nightly cargo passes tests. After running a standalone test I found the message:

"multirust: no default toolchain configured"

So I uninstalled mulitrust <sorry @brson > and I am running on beta 1.7 and master is fine. Also I get my standard 14 errors on this branch.

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 1, 2016

To follow up on the errant error message it comes from https://github.com/rust-lang/cargo/blob/master/src/bin/test.rs#L110 which also appears in bench as well. I am guessing it is so an error status is returned? Maybe we could just add a message "test have failed"?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 1, 2016

Ah yeah I've had problems with multirust in the past because the test suite changes HOME which can confuse multirust. I forget the incantation to fix this though because I use multirust and cargo test "just works" for me locally.

Maybe there's something wrong with the output matching in the test suite? We surely print an error somewhere and match on it, so we should expect the output to be somewhere...

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 3, 2016

I updated a test to check for the text error in a message. It appears that with_stderr acts more like partial match and since I am prepending the message the test do not fail.

It looks like the error in test and bench at https://github.com/rust-lang/cargo/blob/master/src/bin/test.rs#L110 print to stdout not stderr. I have yet to locate this output location. I am adding text to the empty error "test failed" and "bench failed" just so its not a random looking error message.

Thanks!
Becker

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 3, 2016

Hm that's definitely a bug if we're just doing suffix matching and not matching the entire line.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 3, 2016

Ok, found the bug and fixed in #2433. Once that lands this will likely need updates to quite a few tests.

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 4, 2016

186 failed! I am guessing you do not want me just place [..] in front of every message? Is there a final word on the text before I dive in? I should have some free time this weekend.

Thanks
Becker

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 4, 2016

I'd personally prefer to update the text that's matched, meaning we'd add error: in front. It may be worth getting some more consensus on this first though before changing all of them.

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 7, 2016

I updated all the errors to use format! and I included a new support helper ERROR. updating the error text should be a 3 line change once consensus is reached.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 7, 2016

Thanks @sbeckeriv! We've got a tools triage meeting this week so I'll be sure to bring this up as part of that.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 11, 2016

Ok, thanks for the patience @sbeckeriv! Could you remove the colon from error: (as it's already justified like the other status messages), and can you also remove the bold from the line? Other than that this looks good to go!

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 11, 2016

@alexcrichton Updated.

Thanks for the help!
Becker

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 11, 2016

Thanks! Could you also squash the commits down?

@sbeckeriv sbeckeriv force-pushed the sbeckeriv:decolor-messages-426 branch 2 times, most recently from d086b50 to 97a63ca Mar 11, 2016

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 12, 2016

Squashed!

Thanks!
Becker

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 12, 2016

@bors: r+ 97a63ca

Can't wait to give this a spin!

@sbeckeriv sbeckeriv force-pushed the sbeckeriv:decolor-messages-426 branch 3 times, most recently from f1a65e5 to cb836ec Mar 12, 2016

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 12, 2016

Rebased off of master. Updated a new test that was added. For some reason nightly is failing but I dont think its related to my change.

@sbeckeriv sbeckeriv force-pushed the sbeckeriv:decolor-messages-426 branch from cb836ec to f04e1b2 Mar 12, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 12, 2016

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 12, 2016

⌛️ Testing commit f04e1b2 with merge 0050a68...

bors added a commit that referenced this pull request Mar 12, 2016

Auto merge of #2421 - sbeckeriv:decolor-messages-426, r=alexcrichton
Dull the errors

This resolves #426

Dearest Reviewer,

I have updated the error messages to use say_status at the shell level. I have also changed say_status to print the message in bold. I do think it looks nice but it does have the side effect of making some seemingly unrelated text bold. I do think it looks better bold but it is also very easy to revert. I have included examples of both.

Thank you,
Becker

Bold: Note the usage is bold.
<img width="1072" alt="screen shot 2016-02-27 at 10 49 05 am" src="https://cloud.githubusercontent.com/assets/12170/13374778/0efd54ec-dd43-11e5-9f02-f0224608132a.png">

No bold:
<img width="885" alt="screen shot 2016-02-27 at 10 46 35 am" src="https://cloud.githubusercontent.com/assets/12170/13374775/fa3a6612-dd42-11e5-9c09-8f23506f5f0c.png">

Both rendered on a mac with iterm 2.9.0
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 12, 2016

💔 Test failed - cargo-linux-64

@sbeckeriv sbeckeriv force-pushed the sbeckeriv:decolor-messages-426 branch from f04e1b2 to 3b386bb Mar 12, 2016

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 12, 2016

Updated test_cargo_cross_compile::platform_specific_dependencies_do_not_leak for the linux-64 build

@sbeckeriv sbeckeriv force-pushed the sbeckeriv:decolor-messages-426 branch from 3b386bb to 6a2c8a9 Mar 12, 2016

Remove color from the errors
I updated the error states to use say_status.
Add text to the empty error
The empty error looked odd with the say_status change.
Update all stderr messages
Switch them to format statements and create a helper for the error
status.

@sbeckeriv sbeckeriv force-pushed the sbeckeriv:decolor-messages-426 branch from 6a2c8a9 to 1c43987 Mar 12, 2016

@sbeckeriv

This comment has been minimized.

Copy link
Contributor Author

sbeckeriv commented Mar 12, 2016

Rebased master. Nightly should pass again.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 12, 2016

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 12, 2016

⌛️ Testing commit 1c43987 with merge 626eeb7...

bors added a commit that referenced this pull request Mar 12, 2016

Auto merge of #2421 - sbeckeriv:decolor-messages-426, r=alexcrichton
Dull the errors

This resolves #426

Dearest Reviewer,

I have updated the error messages to use say_status at the shell level. I have also changed say_status to print the message in bold. I do think it looks nice but it does have the side effect of making some seemingly unrelated text bold. I do think it looks better bold but it is also very easy to revert. I have included examples of both.

Thank you,
Becker

Bold: Note the usage is bold.
<img width="1072" alt="screen shot 2016-02-27 at 10 49 05 am" src="https://cloud.githubusercontent.com/assets/12170/13374778/0efd54ec-dd43-11e5-9f02-f0224608132a.png">

No bold:
<img width="885" alt="screen shot 2016-02-27 at 10 46 35 am" src="https://cloud.githubusercontent.com/assets/12170/13374775/fa3a6612-dd42-11e5-9c09-8f23506f5f0c.png">

Both rendered on a mac with iterm 2.9.0
@bors

This comment has been minimized.

@bors bors merged commit 1c43987 into rust-lang:master Mar 12, 2016

2 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

This was referenced Mar 12, 2016

@sbeckeriv sbeckeriv deleted the sbeckeriv:decolor-messages-426 branch Mar 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.