Commit 9b01fe07 authored by Drew's avatar Drew

Fix a bug in pruneDependencyGraph related to import names

We should always look for a task by searching in the relevant package,
not by checking against the task's name.
parent 8c5cbcb6
Pipeline #895 passed with stage
......@@ -159,7 +159,7 @@ final public class Package {
if let dependencies = task["dependencies"]?.vector {
for next in dependencies {
guard let depName = next.string else { fatalError("Non-string dependency \(next)")}
guard let nextTask = tasks[depName] else { fatalError("Can't find so-called task \(depName)")}
guard let nextTask = task.package.tasks[depName] else { fatalError("Can't find so-called task \(depName)")}
let nextGraph = prunedDependencyGraph(nextTask)
for nextItem in nextGraph {
let filteredTasks = pruned.filter() {$0.qualifiedName == nextItem.qualifiedName}
......
......@@ -3,8 +3,11 @@
:import ["c.atpkg"]
:tasks {
:foo {
}
:default {
:dependencies ["c.default"]
:dependencies ["c.default" "foo"]
:name "b_default"
}
}
......
......@@ -161,5 +161,9 @@ class PackageTests: Test {
fatalError("No default task in c")
}
try test.assert(c_default_qualified["name"]?.string == "c_default")
//check package dependency graph
let _ = package.prunedDependencyGraph(a_default_unqualified)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment