Fix ordering of tasks

Correct the execution order of deep dependency trees.
Fixes #28.
This commit is contained in:
Morten Lied Johansen
2019-11-04 22:10:41 +01:00
parent f32039e0f3
commit f745ed4ee3
3 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -472,7 +472,7 @@ class TaskScript(BaseAction):
# Remove duplicates from the list.
_actions = []
for action in actions:
for action in reversed(actions):
if action not in _actions:
_actions.append(action)
actions = _actions
+12
View File
@@ -0,0 +1,12 @@
build: build/stage
build/stage: fetch
echo Building stage
fetch: fetch/consul fetch/s6-overlay
fetch/consul:
echo Fetching consul
fetch/s6-overlay:
echo Fetching S6
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bats
export BAKEFILE=ordering.Bakefile
@test "dependencies are resolved correctly" {
run bake
[[ "${status}" -eq 0 ]]
[[ "${lines[0]}" == *"build…"* ]]
[[ "${lines[1]}" == *"fetch/consul, fetch/s6-overlay, fetch, & build/stage."* ]]
}