summaryrefslogtreecommitdiffstats
path: root/src/executor.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-10-24 21:40:53 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-10-24 21:40:53 +0200
commit152272df6e28af35b13d393ec30b8fd3a333bccf (patch)
treee8e89790a858d303b80c0815391acb9bf7ea173a /src/executor.rs
parent4604ddfb40c10d8f33fa2993c2c3c84bbe993e55 (diff)
downloadrebel-152272df6e28af35b13d393ec30b8fd3a333bccf.tar
rebel-152272df6e28af35b13d393ec30b8fd3a333bccf.zip
Move definition of Dependency into runner module
runner::TaskInput does not contain the dependency hashes anymore, this is handled internally in the runner module now. Unfortunately this also means that we can't use this struct directly for the InputHash anymore, but overall this reduces the complexity of the interface between runner and executor.
Diffstat (limited to 'src/executor.rs')
-rw-r--r--src/executor.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/executor.rs b/src/executor.rs
index 39e262d..10bb57f 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -66,13 +66,13 @@ impl<'ctx> Executor<'ctx> {
.all(|dep| self.tasks_done.contains_key(&dep))
}
- fn fetch_deps(&self, task: &TaskRef<'ctx>) -> Result<Vec<Dependency>> {
+ fn fetch_deps(&self, task: &TaskRef<'ctx>) -> Result<Vec<runner::Dependency>> {
let task_def = &self.ctx[task.id];
task_def
.fetch
.iter()
.map(|Fetch { name, sha256 }| {
- Ok(Dependency::Fetch {
+ Ok(runner::Dependency::Fetch {
name: self.tpl.eval_raw(name, &task.args).with_context(|| {
format!("Failed to evaluate fetch filename for task {}", task)
})?,
@@ -82,7 +82,7 @@ impl<'ctx> Executor<'ctx> {
.collect()
}
- fn task_deps(&self, task: &TaskRef<'ctx>) -> Result<HashMap<DependencyHash, Dependency>> {
+ fn task_deps(&self, task: &TaskRef<'ctx>) -> Result<HashSet<runner::Dependency>> {
Ok(self
.fetch_deps(task)?
.into_iter()
@@ -96,7 +96,7 @@ impl<'ctx> Executor<'ctx> {
.expect("invalid runtime depends of build_depends")
.into_iter()
.filter_map(|dep| self.tasks_done[&dep.task].outputs.get(dep.output))
- .map(|&output| Dependency::Task {
+ .map(|&output| runner::Dependency::Task {
output,
path: "".to_string(),
}),
@@ -111,12 +111,11 @@ impl<'ctx> Executor<'ctx> {
.expect("invalid runtime depends of host_depends")
.into_iter()
.filter_map(|dep| self.tasks_done[&dep.task].outputs.get(dep.output))
- .map(|&output| Dependency::Task {
+ .map(|&output| runner::Dependency::Task {
output,
path: paths::abs(paths::TASK_SYSROOT),
}),
)
- .map(|dep| (dep.dependency_hash(), dep))
.collect())
}