summaryrefslogtreecommitdiffstats
path: root/crates/runner/src/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/runner/src/task.rs')
-rw-r--r--crates/runner/src/task.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/runner/src/task.rs b/crates/runner/src/task.rs
index a909d22..47fa9e4 100644
--- a/crates/runner/src/task.rs
+++ b/crates/runner/src/task.rs
@@ -44,12 +44,14 @@ fn input_hash(task: &Task) -> InputHash {
#[derive(Debug, Serialize)]
struct HashInput<'a> {
pub command: &'a str,
+ pub workdir: &'a str,
pub inherit: &'a [LayerHash],
pub depends: HashMap<DependencyHash, &'a Dependency>,
pub outputs: &'a HashMap<String, String>,
}
let input = HashInput {
command: &task.command,
+ workdir: &task.workdir,
inherit: &task.inherit,
depends: task
.depends
@@ -83,7 +85,7 @@ fn init_task(input_hash: &InputHash, task: &Task) -> Result<fs::Mount> {
std::fs::write(&runfile, &task.command)
.with_context(|| format!("Failed to write {}", runfile))?;
- let mount_target = paths::join(&[&task_tmp_dir, paths::TASK_WORKDIR]);
+ let mount_target = paths::join(&[&task_tmp_dir, &task.workdir]);
let mount = if task.inherit.is_empty() {
fs::mount(task_layer_dir, &mount_target, None, MsFlags::MS_BIND, None)
.with_context(|| format!("Failed to bind mount to {:?}", mount_target))?