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

Print to stderr consistently in bootstrap #96712

Closed
jyn514 opened this issue May 4, 2022 · 6 comments
Closed

Print to stderr consistently in bootstrap #96712

jyn514 opened this issue May 4, 2022 · 6 comments
Assignees
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented May 4, 2022

Bootstrap is unfortunately quite inconsistent about which it uses currently :(

$ rg -g '!build.rs' println src/bootstrap/ | grep -v eprintln | wc -l
88
$ rg eprintln src/bootstrap/ | wc -l
60

stderr probably makes more sense? but I don't know when someone would look at just stdout or just stderr; having a hard time imagining use cases.

cc @bjorn3

Originally posted by @jyn514 in #96687 (comment)

@bjorn3
Copy link
Member

bjorn3 commented May 4, 2022

For example ./x.py test >test_log.txt would show warnings on the terminal as stderr is not redirected but put the results of all tests in test_log.txt. Not that I can recall every doing something like that, but it could be useful I guess.

@jyn514
Copy link
Member Author

jyn514 commented May 4, 2022

Sure, seems fine. Let's use eprintln consistently then.

@rustbot label +E-easy +A-rustbuild

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels May 4, 2022
@raiyansayeed
Copy link
Contributor

@rustbot claim

@jyn514 jyn514 changed the title Decide whether to print to stdout or stderr in bootstrap Print to stderr consistently in bootstrap May 5, 2022
@lionellloh
Copy link
Contributor

@raiyansayeed are you still working on this?

@raiyansayeed
Copy link
Contributor

Hey yes I'm still working on it, have most of it implemented I think. I just haven't gotten the time to review my code / push, although I think I should be able to do it by the end of this week.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 27, 2022
…tly, r=Mark-Simulacrum

Print stderr consistently

Solves rust-lang#96712

I tried to follow what I perceived as the general consensus for error messages in boostrap i.e messages that were ..
* resulting from an Err(...) =>
* literally called as "Error: ...."
* by the end of the block scope forced to run a panic! or process::exit with a guaranteed non-zero error code.
@jyn514
Copy link
Member Author

jyn514 commented Jun 20, 2022

Looks like this was done in #97411, thanks!

@jyn514 jyn514 closed this as completed Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants