func isOOD(tgt *Tgt, level int, seen map[string]*Tgt) (bool, error) {
indent := strings.Repeat(". ", level)
tracef(CDebug, "ood: %s%s checking", indent, tgt)
- ood, cached := OODCache[tgt.a]
+ ood, cached := OODCache[tgt.rel]
if cached {
tracef(CDebug, "ood: %s%s -> cached: %v", indent, tgt, ood)
return ood, nil
}
- depInfo := DepInfoCache[tgt.Dep()]
+ depInfo := DepInfoCache[tgt.rel]
var err error
if depInfo == nil {
depInfo, err = depRead(tgt)
ood = true
tracef(CDebug, "ood: %s%s -> no dep: %s", indent, tgt, tgt.Dep())
}
- OODCache[tgt.a] = ood
+ OODCache[tgt.rel] = ood
return ood, nil
}
if err != nil {
return true, TgtError{tgt, ErrLine(err)}
}
}
- DepInfoCache[tgt.Dep()] = depInfo
+ if DepInfoCache != nil {
+ DepInfoCache[tgt.rel] = depInfo
+ }
}
if depInfo.build == BuildUUID {
tracef(CDebug, "ood: %s%s -> already built", indent, tgt)
- OODCache[tgt.a] = false
+ OODCache[tgt.rel] = false
return false, nil
}
if !FileExists(tgt.a) {
tracef(CDebug, "ood: %s%s -> non-existent", indent, tgt)
- OODCache[tgt.a] = true
+ OODCache[tgt.rel] = true
return true, nil
}
for _, dep := range depInfo.ifchanges {
tracef(CDebug, "ood: %s%s -> %s: checking", indent, tgt, dep.tgt)
- ood, cached = OODCache[dep.tgt.a]
+ ood, cached = OODCache[dep.tgt.rel]
if cached {
tracef(CDebug, "ood: %s%s -> %s: cached: %v", indent, tgt, dep.tgt, ood)
if ood {
if errors.Is(err, fs.ErrNotExist) {
tracef(CDebug, "ood: %s%s -> %s: not exists", indent, tgt, dep.tgt)
ood = true
- OODCache[dep.tgt.a] = ood
+ OODCache[dep.tgt.rel] = ood
goto Done
}
return ood, TgtError{tgt, ErrLine(err)}
if inode.Size != dep.inode.Size {
tracef(CDebug, "ood: %s%s -> %s: size differs", indent, tgt, dep.tgt)
ood = true
- OODCache[dep.tgt.a] = ood
+ OODCache[dep.tgt.rel] = ood
goto Done
}
if InodeTrust != InodeTrustNone && inode.Equals(dep.inode) {
if dep.hash != hsh {
tracef(CDebug, "ood: %s%s -> %s: hash differs", indent, tgt, dep.tgt)
ood = true
- OODCache[dep.tgt.a] = ood
+ OODCache[dep.tgt.rel] = ood
goto Done
}
tracef(CDebug, "ood: %s%s -> %s: same hash", indent, tgt, dep.tgt)
}
- if dep.tgt.a == tgt.a {
+ if dep.tgt.rel == tgt.rel {
tracef(CDebug, "ood: %s%s -> %s: same target", indent, tgt, dep.tgt)
continue
}
if isSrc(dep.tgt) {
tracef(CDebug, "ood: %s%s -> %s: is source", indent, tgt, dep.tgt)
- OODCache[dep.tgt.a] = false
+ OODCache[dep.tgt.rel] = false
continue
}
- if _, ok := seen[dep.tgt.a]; ok {
+ if _, ok := seen[dep.tgt.rel]; ok {
tracef(CDebug, "ood: %s%s -> %s: was always built", indent, tgt, dep.tgt)
- OODCache[dep.tgt.a] = false
+ OODCache[dep.tgt.rel] = false
continue
}
Done:
tracef(CDebug, "ood: %s%s: %v", indent, tgt, ood)
- OODCache[tgt.a] = ood
+ OODCache[tgt.rel] = ood
return ood, nil
}