Files
Xi Ge 9ab641fa58 Handle dependency cycles when computing target depths. rdar://193266997
If the build server reports a dependency cycle, the worklist in
targetDepthsAndDependents kept pushing targets around the cycle forever. It
spun the BuildServerManager actor at 100% CPU, grew memory without bound,
and finally aborted with a retain-count overflow.

Walk the targets in topological order instead. When the walk gets stuck on
a cycle, break it at the target where the cycle is entered and ignore the
edges that lead back into it. Every edge is considered once, so this
finishes on any graph, and targets in or below a cycle still get depths
that put them after the targets that depend on them.
2026-12-02 13:09:30 -08:00
..