Stream native failure manifests during publication

This commit is contained in:
gloamxun committed 2026-11-19 14:50:11 +08:00
1 parent 72ed779749
commit 5aa7dc7331
5 files changed
+46 -9

No files matched your search

+14 -6
View File
@@ -403,12 +403,20 @@ impl CompileFailure {
schema: u32,
failure: &'a CompileFailure,
}
let bytes = serde_json::to_vec_pretty(&Report {
schema: 1,
failure: self,
})
.map_err(|e| e.to_string())?;
PreparedOutput::write(&destination, &bytes)?.commit_new(&destination)
PreparedOutput::write_with(&destination, |file| {
use std::io::{BufWriter, Write};
let mut buffer = BufWriter::new(file);
serde_json::to_writer_pretty(
&mut buffer,
&Report {
schema: 1,
failure: self,
},
)
.map_err(|error| error.to_string())?;
buffer.flush().map_err(|error| error.to_string())
})?
.commit_new(&destination)
}
fn persist_requested(mut self) -> Self {
if let Some(path) = &self.request.failure_manifest {