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

update backtrace formating text tips #41989

Closed
wants to merge 1 commit into from
Closed

update backtrace formating text tips #41989

wants to merge 1 commit into from

Conversation

F001
Copy link
Contributor

@F001 F001 commented May 14, 2017

Follow up with #38165, improve consistency.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Mark-Simulacrum
Copy link
Member

Looks like a test needs to be updated.

[00:50:03] failures:
[00:50:03] 
[00:50:03] ---- [run-pass] run-pass/multi-panic.rs stdout ----
[00:50:03] 	
[00:50:03] error: test run failed!
[00:50:03] status: exit code: 101
[00:50:03] command: /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/multi-panic.stage2-x86_64-unknown-linux-gnu 
[00:50:03] stdout:
[00:50:03] ------------------------------------------
[00:50:03] 
[00:50:03] ------------------------------------------
[00:50:03] stderr:
[00:50:03] ------------------------------------------
[00:50:03] thread 'main' panicked at 'assertion failed: `(left == right)` (left: `Some("note: Run with `RUST_BACKTRACE=full` for a backtrace.")`, right: `Some("note: Run with `RUST_BACKTRACE=1` for a backtrace.")`)', /checkout/src/test/run-pass/multi-panic.rs:19
[00:50:03] note: Run with `RUST_BACKTRACE=full` for a backtrace.
[00:50:03] 
[00:50:03] ------------------------------------------
[00:50:03] 
[00:50:03] thread '[run-pass] run-pass/multi-panic.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2472
[00:50:03] note: Run with `RUST_BACKTRACE=full` for a backtrace.
[00:50:03] 
[00:50:03] 
[00:50:03] failures:
[00:50:03]     [run-pass] run-pass/multi-panic.rs
[00:50:03] 
[00:50:03] test result: FAILED. 2682 passed; 1 failed; 5 ignored; 0 measured

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 14, 2017
@F001
Copy link
Contributor Author

F001 commented May 15, 2017

@Mark-Simulacrum Fixed. Do you have other concerns?

@Mark-Simulacrum
Copy link
Member

Out of interest, why did you add RUST_BACKTRACE=no as an option? Otherwise, I'm going to leave for @arielb1 to review the heart of the changes, I don't really know this area of the compiler.

@F001
Copy link
Contributor Author

F001 commented May 15, 2017

Well, this option is not added by this PR. It has been added by the PR #38165, but I think not all the occurrences are updated accordingly.

@arielb1
Copy link
Contributor

arielb1 commented May 16, 2017

r? @alexcrichton

@alexcrichton
Copy link
Member

Thanks for the PR! Could you expand a bit on the rationle though? I'm not sure why we'd suggest RUST_BACKTRACE=full to start with, it seems like you'd only want to reach for that if you saw a backtrace and already determined that it may not be good enough.

@F001
Copy link
Contributor Author

F001 commented May 17, 2017

The rationale is that, according to #38165, the options are defined as:

  • RUST_BACKTRACE=full prints all the informations (current behaviour)
  • RUST_BACKTRACE=(short|yes) is the default
  • RUST_BACKTRACE=(0|no) disables the backtrace.
  • RUST_BACKTRACE= is equivalent to short for backward compatibility.

So I think the suggestion should be updated to RUST_BACKTRACE=(full|short|yes), and the old style RUST_BACKTRACE=(1|0) should not be the official suggestion.

I'm not sure which one is the best either, (full|short|yes) all seems reasonable to me. They are all better than (1|0).

@F001
Copy link
Contributor Author

F001 commented May 17, 2017

@alexcrichton If you think full is not appropriate in the suggestion, I'll update it to yes.

@F001
Copy link
Contributor Author

F001 commented May 17, 2017

Another alternative, use longer sentence for the suggestion:

note: Run with RUST_BACKTRACE=yes for a backtrace, and run with RUST_BACKTRACE=full for a verbose backtrace.

@alexcrichton
Copy link
Member

Ah yes sorry, so I'm not personally a fan of the simultaneous change in interface here either, I'd prefer to not change how we parse values just yet. What I'm worried about though is that this is recommending RUST_BACKTRACE=full before RUST_BACKTRACE=1, which seems backwards?

Follow up with PR 38165
@F001
Copy link
Contributor Author

F001 commented May 17, 2017

Yeah, I understand your concern. Now I have changed the recommending to RUST_BACKTRACE=yes which has the same behavior as RUST_BACKTRACE=1.

The motivation is that right now option 1 is supported only for backward compatibility, the option short|yes is more official with the same behavior.

I would like to hear suggestion from @Yamakaky too, do you think we should update the recommending words?

@Yamakaky
Copy link
Contributor

My rational for only suggesting the short back trace was that new users will not want the full one in almost any case, and advanced users will know about the full version.

@F001
Copy link
Contributor Author

F001 commented May 18, 2017

Yeah~ I agree to suggesting the short style too. I just think yes is better than 1.

@Yamakaky
Copy link
Contributor

I do too! I think yes/short, full and no should be good, with the old values as compat.

@F001
Copy link
Contributor Author

F001 commented May 20, 2017

@alexcrichton PR is updated.

@alexcrichton
Copy link
Member

Ok not recommending "full" sounds good to me, but otherwise I'm still not sure I understand the rationale for this PR? Why change from "1" to "yes"? Why add "no" as a way to turn it off?

@F001
Copy link
Contributor Author

F001 commented May 20, 2017

I thought that the options of RUST_BACKTRACE had been changed to (full|short|yes|no) as described in #38165 , and it has been an agreement in core team. But It turns out to be not true.

I'm sorry for the confusion I caused. Therefore, I'm going to close this PR.

@F001 F001 closed this May 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants