Skip to content

Commit 470ff97

Browse files
ty gemini
Topic: wanda-deps Signed-off-by: andrew <andrew@anyscale.com>
1 parent d7807b5 commit 470ff97

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

wanda/deps.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ func BuildDepGraph(specPath string, lookup lookupFunc) (*DepGraph, error) {
6060
return nil, fmt.Errorf("abs path for root: %w", err)
6161
}
6262
for name, rs := range g.specs {
63-
rsAbs, _ := filepath.Abs(rs.Path)
63+
rsAbs, err := filepath.Abs(rs.Path)
64+
if err != nil {
65+
return nil, fmt.Errorf("abs path for spec %q: %w", rs.Path, err)
66+
}
6467
if rsAbs == absPath {
6568
g.root = name
6669
break
@@ -145,9 +148,10 @@ func (g *DepGraph) topoSort() error {
145148
}
146149

147150
var order []string
148-
for len(queue) > 0 {
149-
current := queue[0]
150-
queue = queue[1:]
151+
head := 0
152+
for head < len(queue) {
153+
current := queue[head]
154+
head++
151155
order = append(order, current)
152156

153157
for _, dependent := range dependents[current] {

0 commit comments

Comments
 (0)