diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-11-17 01:02:58 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-11-17 01:02:58 +0100 |
commit | e475a15a74842bcf86294e7fafe3c97d0dae2127 (patch) | |
tree | 7e16cc341ef4d0e58980e2a2aab5fb817f2d2aaf | |
parent | 1ad4750948ab49900b1b6ff5b455c11ebe7470eb (diff) | |
download | rebel-e475a15a74842bcf86294e7fafe3c97d0dae2127.tar rebel-e475a15a74842bcf86294e7fafe3c97d0dae2127.zip |
driver: pass force_run flag to runner
-rw-r--r-- | crates/common/src/types.rs | 1 | ||||
-rw-r--r-- | crates/driver/src/driver.rs | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/crates/common/src/types.rs b/crates/common/src/types.rs index 222c79f..32b9182 100644 --- a/crates/common/src/types.rs +++ b/crates/common/src/types.rs @@ -43,6 +43,7 @@ pub struct Task { pub depends: HashSet<Dependency>, pub outputs: HashMap<String, String>, pub pins: HashMap<ArchiveHash, String>, + pub force_run: bool, } #[derive(Clone, Debug, Deserialize, Serialize, Default)] diff --git a/crates/driver/src/driver.rs b/crates/driver/src/driver.rs index 43820a2..dfdd6e9 100644 --- a/crates/driver/src/driver.rs +++ b/crates/driver/src/driver.rs @@ -148,6 +148,7 @@ enum SpawnResult { #[derive(Debug)] pub struct Driver<'ctx> { rdeps: HashMap<TaskRef<'ctx>, Vec<TaskRef<'ctx>>>, + force_run: HashSet<TaskRef<'ctx>>, tasks_blocked: HashSet<TaskRef<'ctx>>, tasks_runnable: Vec<TaskRef<'ctx>>, tasks_running: HashMap<RawFd, (UnixStream, TaskRef<'ctx>)>, @@ -158,10 +159,11 @@ impl<'ctx> Driver<'ctx> { pub fn new( ctx: &'ctx Context, taskset: HashSet<TaskRef<'ctx>>, - _force_run: HashSet<TaskRef<'ctx>>, + force_run: HashSet<TaskRef<'ctx>>, ) -> Result<Self> { let mut driver = Driver { rdeps: Default::default(), + force_run, tasks_blocked: Default::default(), tasks_runnable: Default::default(), tasks_running: Default::default(), @@ -318,6 +320,7 @@ impl<'ctx> Driver<'ctx> { depends: task_deps, outputs: task_output, pins: HashMap::from([rootfs.clone()]), + force_run: self.force_run.contains(task_ref), }; Ok(SpawnResult::Spawned(runner.spawn(&task))) |