Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OOM with somepath due to infinite loop.
This only happens when a `from` target is in the cycle, and the infinite loop occurs when we traverse a parent-edge loop. If the `from` target is not in the cycle, a parent-edge loop is never created because the parent-edges are already set. **Fix:** Prevent parent-edges from being created from `from` targets to another `from` target, the idea here is that parents of a `from` target are not relevant to `somepath`. **Implications:** In the case where `from` targets are dependencies of each other, the path going through other `from` targets will not be considered since all `from` targets are treated as "root" level targets. For example: `somepath(//foo:a + //foo:transitive_dep_of_a, //foo:transitive_dep_of_both)` where this code will now only output the path from `//foo:transitive_dep_of_a -> //foo:transitive_dep_of_both` and never `//foo:a -> //foo:transitive_dep_of_a -> //foo:transitive_dep_of_both`. PiperOrigin-RevId: 447410138
- Loading branch information