Skip to content

Commit a5de56a

Browse files
committed
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 ```
1 parent df5cc59 commit a5de56a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bootstrap/toolstate.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ impl Builder<'_> {
262262
/// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be
263263
/// done. The file is updated immediately after this function completes.
264264
pub fn save_toolstate(&self, tool: &str, state: ToolState) {
265+
use std::io::Write;
266+
265267
// If we're in a dry run setting we don't want to save toolstates as
266268
// that means if we e.g. panic down the line it'll look like we tested
267269
// everything (but we actually haven't).
@@ -286,7 +288,8 @@ impl Builder<'_> {
286288
current_toolstates.insert(tool.into(), state);
287289
t!(file.seek(SeekFrom::Start(0)));
288290
t!(file.set_len(0));
289-
t!(serde_json::to_writer(file, &current_toolstates));
291+
t!(serde_json::to_writer(&file, &current_toolstates));
292+
t!(writeln!(file)); // make sure this ends in a newline
290293
}
291294
}
292295
}

0 commit comments

Comments
 (0)