Make sure toolstates.json ends in a newline
This avoids the following broken logging in CI: ``` {"book":"test-pass","reference":"test-pass","rustbook":"test-fail","rust-by-example":"test-pass","nomicon":"test-pass","embedded-book":"test-pass","edition-guide":"test-pass"}::group::Building bootstrap ```
This commit is contained in:
parent
df5cc59a68
commit
a5de56a95e
1 changed files with 4 additions and 1 deletions
|
@ -262,6 +262,8 @@ impl Builder<'_> {
|
||||||
/// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be
|
/// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be
|
||||||
/// done. The file is updated immediately after this function completes.
|
/// done. The file is updated immediately after this function completes.
|
||||||
pub fn save_toolstate(&self, tool: &str, state: ToolState) {
|
pub fn save_toolstate(&self, tool: &str, state: ToolState) {
|
||||||
|
use std::io::Write;
|
||||||
|
|
||||||
// If we're in a dry run setting we don't want to save toolstates as
|
// If we're in a dry run setting we don't want to save toolstates as
|
||||||
// that means if we e.g. panic down the line it'll look like we tested
|
// that means if we e.g. panic down the line it'll look like we tested
|
||||||
// everything (but we actually haven't).
|
// everything (but we actually haven't).
|
||||||
|
@ -286,7 +288,8 @@ impl Builder<'_> {
|
||||||
current_toolstates.insert(tool.into(), state);
|
current_toolstates.insert(tool.into(), state);
|
||||||
t!(file.seek(SeekFrom::Start(0)));
|
t!(file.seek(SeekFrom::Start(0)));
|
||||||
t!(file.set_len(0));
|
t!(file.set_len(0));
|
||||||
t!(serde_json::to_writer(file, ¤t_toolstates));
|
t!(serde_json::to_writer(&file, ¤t_toolstates));
|
||||||
|
t!(writeln!(file)); // make sure this ends in a newline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue