Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cc_shared_library to take into account unused CcInfos
In f9008f6 cc_shared_library was fixed to make sure that indirect top level deps were wrapped in "alwayslink" and not dropped by the linker. The loop which finds them didn't check for previously visited nodes under the assumption that it'd be quick to exit because a top level dep containing code would be found a few levels into the dependencies. This causes the code to hang in builds where there are custom C++ rules that do not propagate all the CcInfos from their deps. The code works using the structure of the graph recreated by the aspect, if it sees a target providing a dependency which isn't part of the static linker inputs, it assumes that it's an empty top level dependency and therefore we have to keep crawling up the graph to find the library that needs to be whole-archived. What was happening though was that the custom C++ rule cut off that dependency (even though it had code to link) and didn't make it part of the CcInfo it provided. The code would go many levels down and would revisit the same nodes over and over. RELNOTES:none PiperOrigin-RevId: 521717764 Change-Id: I0935ceb53572d6000d86cde518a6759b95c956a5
- Loading branch information