diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-09-02 15:23:22 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-09-02 17:36:30 +0200 |
commit | 26d63c785290b42e750bd4d1755f445cccfac3c1 (patch) | |
tree | 9888093aaa593eaed27dd5d2371056c0e7d9ade3 /src/executor.rs | |
parent | 1c3dfe3ac75698ee0dfc90ae909e0a0338fff1fb (diff) | |
download | rebel-26d63c785290b42e750bd4d1755f445cccfac3c1.tar rebel-26d63c785290b42e750bd4d1755f445cccfac3c1.zip |
executor: compute inherit chain for each task, pass to runner
Diffstat (limited to 'src/executor.rs')
-rw-r--r-- | src/executor.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/executor.rs b/src/executor.rs index 710d70a..7aa749f 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -46,6 +46,7 @@ impl<'a> TaskInput<'a> { #[derive(Clone, Debug, Deserialize, Serialize)] struct TaskOutput { pub id: TaskRef, + pub inherit: Vec<InputHash>, pub depends: HashMap<OutputHash, InputHash>, pub input_hash: InputHash, pub output_hash: OutputHash, @@ -136,6 +137,15 @@ impl<'a> Executor<'a> { let task_def = self.tasks.get(&task_ref.id).expect("Invalid TaskRef"); let task_deps = self.task_deps_with_inputs(&task_def); + let inherit = if let Some(inherit_task) = &task_def.inherit { + let inherit_output = &self.tasks_done[inherit_task]; + let mut inherit = inherit_output.inherit.clone(); + inherit.push(inherit_output.input_hash); + inherit + } else { + Vec::new() + }; + let input_hash = TaskInput { id: &task_ref, depends: &task_deps, @@ -153,6 +163,7 @@ impl<'a> Executor<'a> { let task = runner::Task { id: task_ref.clone(), run: run.clone(), + inherit: inherit.clone(), depends: self.task_deps_with_actions(&task_def), env: self.env.clone(), }; @@ -163,6 +174,7 @@ impl<'a> Executor<'a> { let output = TaskOutput { id: task_ref.clone(), + inherit, depends: task_deps, input_hash, output_hash, |