Change:
(Sorry if this isn't the right template, I wasn't sure what to choose) Hi, when I run tests with x.py from the command I get this error .
can you add some more context? there should be output printed before this panic, what does it say? what commit are you testing?
I'd like to contribute to Rust so I'm first trying to understand and try the tests from x.py, I haven't made any changes, I just cloned the repo then did an x.py setup then this command . Here is what I get from this command:
ok, great! now we need to find which of the tests are causing the "Microsoft Windows [version 10.0..1778]" output - can you run and print the ~20 or so lines before the panic?
hmm, that doesn't show the test that panicked. try adding ?
still the same thing, earlier today I had a theory, I thought it had nothing to do with tests but more a story of utf-8 and console
right, I understand it's still panicking, but I'm trying to find what's causing it to panic. alternatively, you could try making this change to bootstrap to have it print the thing it couldn't parse: you can paste that into and it should make the change for you.
I'm not sure what to copy, is that enough?
is that with ? I'm trying to find which of the tests are emitting this output, not just the output itself. If you could paste the 20 or so lines before in addition to this version output it would be very helpful.
It's with this line, but I don't know where to start copying the 20 lines, I don't have any more crashes?
I started from the last line where I was
hmm, this runs on windows, maybe that's printing the version notice?
can you post the output of ?
hmm ok, but you don't see the "Microsoft Windows [version 10.0..1778]" from ? it might be a different test that's making bootstrap panic then. cc do you have ideas what could be going wrong here? is using a french locale and that's making one of the tests emit non-utf8 on Windows for some reason.
When I launch a terminal, I get "Microsoft Windows...", but with the command I don't get "Microsoft Windows..."
I set my computer to English, I deleted the changes from earlier and I no longer have the problem.
Setting the environment variable to should work if the Visual Studio English language pack is installed. I believe rustc itself sets this. I did recently add some code to rustc to attempt to re-encode as UTF-8 if the output is not UTF-8 but this only triggers for linker output. Perhaps other tools may also want the same treatment but I've not investigated.
Oh sorry, just read that again. This is caused by cmd when used with ? Hm, strange. I'm not sure off-hand. Using should switch to the UTF-8 code page. But I'm unsure of the cause so I don't know if that would help in this case.

Discussion:
} fn render_all(mut self) { <del> let mut line = String::new(); </del> <ins> let mut line = Vec::new(); </ins> loop { line.clear(); <del> match self.stdout.read_line(&mut line) { </del> <ins> match self.stdout.read_until(b'n', &mut line) { </ins> Ok(_) => {} Err(err) if err.kind() == std::io::ErrorKind::UnexpectedEof => break, Err(err) => panic!("failed to read output of test runner: {err}"),

break; } <del> match serde_json::from_str(&line) { </del> <ins> match serde_json::from_slice(&line) { </ins> Ok(parsed) => self.render_message(parsed), Err(_err) => { // Handle non-JSON output, for example when --nocapture is passed. <del> print!("{line}"); let _ = std::io::stdout().flush(); </del> <ins> let mut stdout = std::io::stdout(); stdout.write_all(&line).unwrap(); let _ = stdout.flush(); </ins> } } }