Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add link-group-mappings subtarget for shared library file to generate…
… the summary for the specified link group. Summary: Currently we have a subtarget that prints dependencies of link groups: ``` christylee@devbig394:~/fbsource/fbcode(47c0c0319)$ buck2 build @//mode/opt-lg tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:main_bin[link-group-mappings] --show-output Buck UI: https://www.internalfb.com/buck2/be198590-6945-4e63-8faa-bfe68322ec9a Network: Up: 0B Down: 0B Jobs completed: 4. Time elapsed: 0.0s. BUILD SUCCEEDED fbcode//tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:main_bin[link-group-mappings] buck-out/v2/gen/fbcode/c6f87ea505222064/tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test/__main_bin__/main_bin.link_group_map.json christylee@devbig394:~/fbsource(87742e131|remote/master)$ cat buck-out/v2/gen/fbcode/c6f87ea505222064/tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test/__main_bin__/main_bin.link_group_map.json | jq { "NO_MATCH": [ "fbcode//common/init:kill" ], "shared_lib_2": [ "fbcode//tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:D" ], "shared_lib_1": [ "fbcode//tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:A", "fbcode//third-party-buck/platform010/build/libgcc:stdc++-legacy", "fbcode//third-party-buck/platform010/build/libgcc:stdc++", "fbcode//third-party-buck/platform010/build/libgcc:gcc_s", "fbcode//third-party-buck/platform010/build/libgcc:atomic", "fbcode//third-party-buck/platform010/build/openmp:headers", "fbcode//third-party-buck/platform010/build/glibc:pthread", "fbcode//third-party-buck/platform010/build/glibc:m", "fbcode//third-party-buck/platform010/build/glibc:mvec", "fbcode//third-party-buck/platform010/build/glibc:c", "fbcode//tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:C" ] } ``` This gets unwieldy when we have a sufficiently large number of link groups. This diff creates a subtarget for each link group shared library that prints the dependencies that compose of that shared library. We want something that looks like this: ``` buck2 build @//mode/opt-lg tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:main_bin[shared-libraries][libshared_lib_2.so][link-group-mappings] { "shared_lib_2": [ "fbcode//tools/build/test/cpp/link_groups/cpp_rule_link_group_basic_test:D" ], } ``` Reviewed By: christycylee Differential Revision: D61422475 fbshipit-source-id: 4bebf87b304b398177adfe5e473874c706c12315
- Loading branch information