1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Borrowed parameter bundles for the Ninja execution helpers.
//!
//! Separated from `process::mod` so that module stays under the repository's
//! 400-line ceiling. These are data, not behaviour: the request types describe
//! what an invocation needs; `mod` holds the functions that act on them.
use super::{BuildTargets, CommandEnv, StderrMode};
use crate::cli::Cli;
use std::path::Path;
/// Borrowed parameter bundle for `ninja` build execution helpers.
#[derive(Clone, Copy)]
pub struct NinjaBuildRequest<'a> {
/// Ninja executable to invoke.
pub program: &'a Path,
/// Parsed CLI settings supplying the working directory and job count.
pub cli: &'a Cli,
/// Generated build file passed with `-f`.
pub build_file: &'a Path,
/// Targets appended after the base flags.
pub targets: &'a BuildTargets<'a>,
/// Environment overrides applied to the child process. Use
/// [`CommandEnv::inherit`] to leave the parent environment in place.
pub env: &'a CommandEnv,
/// Policy routing the child's standard streams. [`StderrMode::Suppress`]
/// keeps JSON diagnostics machine-readable by draining both streams.
pub stderr_mode: StderrMode,
}
/// Borrowed parameter bundle for `ninja -t` tool execution helpers.
#[derive(Clone, Copy)]
pub struct NinjaToolRequest<'a> {
/// Ninja executable to invoke.
pub program: &'a Path,
/// Parsed CLI settings.
pub cli: &'a Cli,
/// Generated build file passed with `-f`.
pub build_file: &'a Path,
/// Tool name passed to `ninja -t`.
pub tool: &'a str,
/// Environment overrides applied to the child process.
pub env: &'a CommandEnv,
/// Policy routing the child's standard streams. [`StderrMode::Suppress`]
/// keeps JSON diagnostics machine-readable by draining both streams.
pub stderr_mode: StderrMode,
}