Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always use label of LinkableGraph for traversal
Summary: D65716309 added an alias for a cpp_library as a dep instead of a cpp_library directly and that broke `haskell_ghci` rules with the following error: ``` Error running analysis for `fbcode//common/hs/thrift/exactprint:ghci (cfg:linux-x86_64-fbcode-platform010-clang17-asan-ubsan-dev#f0bd86d3824be5aa)` Caused by: Traceback (most recent call last): File <builtin>, in <module> * fbcode/buck2/prelude/haskell/haskell_ghci.bzl:691, in haskell_ghci_impl omnibus_data = _build_haskell_omnibus_so(ctx) * fbcode/buck2/prelude/haskell/haskell_ghci.bzl:191, in _build_haskell_omnibus_so all_nodes_to_exclude = depth_first_traversal( * fbcode/buck2/prelude/utils/graph_utils.bzl:186, in depth_first_traversal return depth_first_traversal_by(graph_nodes, roots, lookup) * fbcode/buck2/prelude/utils/graph_utils.bzl:237, in depth_first_traversal_by fail("Expected node {} in graph nodes".format(node_formatter(node))) error: fail: Expected node fbcode//tools/build/sanitizers:fbcode-sanitizer-cpp (cfg:linux-x86_64-fbcode-platform010-clang17-asan-ubsan-dev#f0bd86d3824be5aa) in graph nodes --> fbcode/buck2/prelude/utils/graph_utils.bzl:237:13 | 237 | fail("Expected node {} in graph nodes".format(node_formatter(node))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ``` The issue is that this graph traversal code confuses labels encoded in LinkableGraph objects (which would use the label of the aliased target) with labels of deps (which would use the label of the alias directly). Fix this by ensuring that this code consistently looks at labels of LinkableGraph objects. Reviewed By: iguridi Differential Revision: D65989756 fbshipit-source-id: 2fcc30fad197bfdf0f85975ab82f2da57567a2d4
- Loading branch information