juxt / mach

A remake of make (in ClojureScript)
246 stars 21 forks source link

execution of dependent tasks is asynchronous #41

Closed stijnopheide closed 7 years ago

stijnopheide commented 7 years ago

It looks like dependent tasks are executed asynchronously, which violates the ordering of dependencies.

Minimal example

Machfile.edn

{
  task1 {
    product "task1.txt"
    novelty (not (mach.core/file-exists? product))
    produce #$ ["sleep" "5" "&&" "echo" "'test'" ">" product]
  }

  task2 {
    product "task2.txt"
    novelty (not (mach.core/file-exists? product))
    depends [task1]
    produce #$ ["sleep" "2" "&&" "cp" "task1.txt" "task2.txt"]
  }
}

Execute task2

$ mach task2

Output

$ sleep 5 && echo 'test' > task1.txt
$ sleep 2 && cp task1.txt task2.txt
cp: task1.txt: No such file or directory
Writing task2.txt
Writing task1.txt
jonpither commented 7 years ago

Thanks for raising, and thanks for the PR