Skip to content

Commit d86f913

Browse files
authored
[3.0][toolkit] Optimized processing time of prebuilt specs (microsoft#14705)
1 parent 8c91911 commit d86f913

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

toolkit/tools/scheduler/schedulerutils/implicitprovides.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func InjectMissingImplicitProvides(res *BuildResult, pkgGraph *pkggraph.PkgGraph
3838
}
3939

4040
for provide, nodes := range provideToNodes {
41-
err = replaceNodesWithProvides(res, pkgGraph, provide, nodes, rpmFile)
41+
err = replaceNodesWithProvides(pkgGraph, provide, nodes, rpmFile)
4242
if err != nil {
4343
return
4444
}
@@ -47,13 +47,16 @@ func InjectMissingImplicitProvides(res *BuildResult, pkgGraph *pkggraph.PkgGraph
4747
}
4848
}
4949

50-
// Make sure the graph is still a directed acyclic graph (DAG) after manipulating it.
51-
err = pkgGraph.MakeDAG()
50+
if didInjectAny {
51+
// Make sure the graph is still a directed acyclic graph (DAG) after manipulating it.
52+
err = pkgGraph.MakeDAG()
53+
}
54+
5255
return
5356
}
5457

5558
// replaceNodesWithProvides will replace a slice of nodes with a new node with the given provides in the graph.
56-
func replaceNodesWithProvides(res *BuildResult, pkgGraph *pkggraph.PkgGraph, provides *pkgjson.PackageVer, nodes []*pkggraph.PkgNode, rpmFileProviding string) (err error) {
59+
func replaceNodesWithProvides(pkgGraph *pkggraph.PkgGraph, provides *pkgjson.PackageVer, nodes []*pkggraph.PkgNode, rpmFileProviding string) (err error) {
5760
var parentNode *pkggraph.PkgNode
5861

5962
// Find a local run node that is backed by the same rpm as the one providing the implicit provide.

0 commit comments

Comments
 (0)