pub struct JobTemplate {
pub command: Vec<String>,
pub environment: BTreeMap<String, String>,
pub deadline: Option<Duration>,
pub may_write_cache: bool,
}Expand description
How the queue turns a speculative state into a executor::Job.
The queue knows which tree to test; it does not know what “test”
means for a repository, and inventing a default command would make
the wrong one silent. The default template has no command, which
every real executor answers with executor::Verdict::Errored –
loud, and never mistaken for a change that failed.
A template deliberately cannot name a working directory (D18).
Every member of a batch is tested against a different speculative
state, so one directory shared by the batch would test the last
state repeatedly – well-formed, index-aligned, and wrong. The jobs
this builds therefore leave executor::Job::directory unset,
which asks the executor to materialize executor::Job::subject
instead, the way crate::worktree::WorktreeRunner does for a git
state. It is an invariant of the train rather than a knob, because
there is no setting of it that would be right.
Fields§
§command: Vec<String>The command, as argv.
environment: BTreeMap<String, String>Exactly what the child sees.
deadline: Option<Duration>Wall-clock ceiling per job. None uses
executor::DEFAULT_DEADLINE.
may_write_cache: boolWhether these jobs may write a shared build cache.
Implementations§
Source§impl JobTemplate
impl JobTemplate
Sourcepub fn job_for(&self, change: &Change, subject: ContentHash) -> Job
pub fn job_for(&self, change: &Change, subject: ContentHash) -> Job
The job testing change applied on the state named by subject.
The subject is supplied rather than computed because only the
Speculator knows how its states are named; see
Speculator::subject.
Trait Implementations§
Source§impl Clone for JobTemplate
impl Clone for JobTemplate
Source§fn clone(&self) -> JobTemplate
fn clone(&self) -> JobTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more