summaryrefslogtreecommitdiffstats
path: root/crates/driver/src/driver.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-12 19:34:13 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-13 20:07:55 +0200
commit6f11f3f247d8949401cd0afb676198b439053740 (patch)
treef3d244a97885e22f5a678f937ad44789aa5fb0d5 /crates/driver/src/driver.rs
parent35e0cd907a89b751637f71ce910950a8a8865fe0 (diff)
downloadrebel-6f11f3f247d8949401cd0afb676198b439053740.tar
rebel-6f11f3f247d8949401cd0afb676198b439053740.zip
Replace 'inherit' recipe field with 'parent'
All occurrences of 'inherit' in the code are replaced with 'parent' or 'ancestors'.
Diffstat (limited to 'crates/driver/src/driver.rs')
-rw-r--r--crates/driver/src/driver.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/crates/driver/src/driver.rs b/crates/driver/src/driver.rs
index 28c8578..212f4cf 100644
--- a/crates/driver/src/driver.rs
+++ b/crates/driver/src/driver.rs
@@ -37,7 +37,7 @@ impl<'ctx> CompletionState<'ctx> {
}
}
- // Treats both "depends" and "inherit" as dependencies
+ // Treats both "depends" and "parent" as dependencies
fn deps_satisfied(&self, task_ref: &TaskRef) -> bool {
resolve::get_dependent_tasks(self.ctx, task_ref)
.map_err(|_| Error::new(format!("invalid dependency for {}", task_ref)))
@@ -103,18 +103,17 @@ impl<'ctx> CompletionState<'ctx> {
Ok(fetch_deps.chain(build_deps).chain(host_deps).collect())
}
- fn task_inherit_chain(&self, task_ref: &TaskRef<'ctx>) -> Vec<LayerHash> {
- let inherit = match self
+ fn task_ancestors(&self, task_ref: &TaskRef<'ctx>) -> Vec<LayerHash> {
+ let Some(parent) = self
.ctx
- .get_inherit_depend(task_ref)
- .expect("invalid inherit depends")
- {
- Some(inherit) => inherit,
- None => return vec![],
+ .get_parent_depend(task_ref)
+ .expect("invalid parent depends")
+ else {
+ return vec![];
};
- let mut chain = self.task_inherit_chain(&inherit);
- if let Some(layer) = self.tasks_done[&inherit].layer {
+ let mut chain = self.task_ancestors(&parent);
+ if let Some(layer) = self.tasks_done[&parent].layer {
chain.push(layer);
}
chain
@@ -314,7 +313,7 @@ impl<'ctx> Driver<'ctx> {
})
.collect();
- let inherit_chain = self.state.task_inherit_chain(task_ref);
+ let ancestors = self.state.task_ancestors(task_ref);
let mut run = Self::task_setup(task_ref);
run.push(&task_def.action.run);
@@ -331,7 +330,7 @@ impl<'ctx> Driver<'ctx> {
command,
workdir: paths::TASK_WORKDIR.to_string(),
rootfs: rootfs.0,
- inherit: inherit_chain,
+ ancestors,
depends: task_deps,
outputs: task_output,
pins: HashMap::from([rootfs.clone()]),