exec: move line capture out of context
The line sink, stream and pump are not context concerns: the host runner and every sandbox backend feed the same cleaned lines to the terminal. Move them and the fd sanitizer to exec, and have LocalDriver delegate to the shared host runner. Add a run_captured test against sh to pin the two-stream contract before the sandbox backends move.
This commit is contained in:
1 parent
bf88ce4f4d
commit
48306f3719
18 files changed
+326
-271
No files matched your search
+2
-1
@@ -1,7 +1,8 @@
|
||||
/// Local binary package building
|
||||
/// Directly calling 'debian/rules' in current context
|
||||
use crate::context::{Context, ContextCommand, LineSink};
|
||||
use crate::context::{Context, ContextCommand};
|
||||
use crate::deb::{BuildProfiler, Phase, enter_phase, find_dsc_file};
|
||||
use crate::exec::LineSink;
|
||||
use crate::logfmt::QuiltClassifier;
|
||||
use crate::report::BuildView;
|
||||
use log::warn;
|
||||
|
||||
+2
-2
@@ -302,7 +302,7 @@ impl BuildView for RecordLogView<'_> {
|
||||
self.inner.byte_progress(label, pos, total);
|
||||
}
|
||||
|
||||
fn sink(&self) -> Option<Arc<dyn crate::context::LineSink>> {
|
||||
fn sink(&self) -> Option<Arc<dyn crate::exec::LineSink>> {
|
||||
Some(self.log.clone())
|
||||
}
|
||||
|
||||
@@ -2119,8 +2119,8 @@ mod tests {
|
||||
/// build.log and on the writers (the terminal, in production).
|
||||
#[test]
|
||||
fn record_log_view_shows_raw_output_when_the_view_has_no_sink() {
|
||||
use crate::context::{LineSink, Stream};
|
||||
use crate::deb::session::record_fixtures::SharedWriter;
|
||||
use crate::exec::{LineSink, Stream};
|
||||
|
||||
let (root, _tarball) = sessions_fixture();
|
||||
let identity = test_identity();
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ use std::time::Duration;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
use crate::context::{LineSink, Stream};
|
||||
use crate::exec::{LineSink, Stream};
|
||||
|
||||
/// Manifest schema version: a record recorded by another schema is
|
||||
/// ignored (and eventually pruned) rather than forked.
|
||||
|
||||
Reference in new issue
Block a user