Skip to content

Commit 7ebee67

Browse files
Add missing cmake dependencies to match BUCK build configuration
This commit adds missing dependencies to cmake targets that were present in the corresponding BUCK targets but missing in cmake. These dependencies were detected using the new `buck_cmake_dep_checker.py` tool. This commit fixes all but 11 of the dependencies problems found by the tool. The remaining 11 will be fixed in a subsequent change where a bit of restructuring is needed in the cmake files to match the BUCK files more closely. ## Fixes in cmake/Agent.cmake: 1. setup_thrift: Added thrift_method_rate_limit fboss/agent/BUCK has `//fboss/lib:thrift_method_rate_limit` in exported_deps for setup_thrift 2. utils: Added hw_switch_fb303_stats fboss/agent/BUCK has `//fboss/agent/hw:hw_switch_fb303_stats` in exported_deps for utils 3. stats: Added common_utils fboss/agent/BUCK has `//fboss/lib:common_utils` in exported_deps for stats 4. ecmp_resource_manager: Added ref_map, stats, and utils fboss/agent/BUCK has `//fboss/lib:ref_map`, `:stats`, and `:utils` in exported_deps for ecmp_resource_manager 5. platform_base: Added utils, product_info, and fboss_event_base fboss/agent/BUCK has `:utils`, `//fboss/lib/platforms:product-info`, and `:fboss_event_base` in exported_deps for platform_base 6. hw_switch_handler: Added fboss_event_base fboss/agent/BUCK has `:fboss_event_base` in exported_deps for hw_switch_handler 7. switchinfo_utils: Added fboss_error and load_agent_config fboss/agent/BUCK has `:fboss-error` and `:load_agent_config` in exported_deps for switchinfo_utils 8. core: Added packet_factory to core_libs variable fboss/agent/BUCK has `//fboss/agent/packet:packet_factory` in deps for core 9. fboss_event_base: Added agent_features fboss/agent/BUCK has `:agent_features` in exported_deps for fboss_event_base 10. agent_netwhoami: Added common_file_utils fboss/agent/BUCK has `//fboss/lib:common_file_utils` in exported_deps for agent_netwhoami ## Fixes in cmake/AgentHw.cmake: 11. hw_fb303_stats: Added error fboss/agent/hw/BUCK has `//fboss/agent:fboss-error` in exported_deps for hw_fb303_stats 12. hw_port_fb303_stats: Added hw_fb303_stats and fboss_types fboss/agent/hw/BUCK has `:hw_fb303_stats` and `//fboss/agent:fboss-types` in exported_deps for hw_port_fb303_stats ## Fixes in cmake/AgentHwMock.cmake: 13. hw_mock: Added handler fboss/agent/hw/mock/BUCK has `//fboss/agent:handler` in exported_deps for mock ## Fixes in cmake/AgentHwSaiHwTest.cmake: 14. agent_hw_test_thrift_handler: Added hw_switch fboss/agent/hw/bcm/tests/BUCK has `//fboss/agent:hw_switch` in exported_deps for agent_hw_test_thrift_handler ## Fixes in cmake/AgentHwSwitchAsics.cmake: 15. switch_asics: Added agent_features, error, and fboss_types fboss/agent/hw/switch_asics/BUCK has `//fboss/agent:agent_features`, `//fboss/agent:fboss-error`, and `//fboss/agent:fboss-types` in exported_deps for switch_asics ## Fixes in cmake/AgentHwTest.cmake: 16. config_factory: Added acl_test_utils, split_agent_thrift_syncer, multiswitch_test_server fboss/agent/hw/test/BUCK has `//fboss/agent/test/utils:acl_test_utils`, `//fboss/agent:split_agent_thrift_syncer`, and `//fboss/agent/test:multiswitch_test_server` in exported_deps for config_factory 17. hw_packet_utils: Added agent_test_utils fboss/agent/hw/test/BUCK has `//fboss/agent/test:utils` in exported_deps for hw_packet_utils 18. hw_copp_utils: Added copp_test_utils and hw_packet_utils fboss/agent/hw/test/BUCK has `//fboss/agent/test/utils:copp_test_utils` and `:hw_packet_utils` in exported_deps for hw_copp_utils 19. hw_link_state_toggler: Added test_ensemble_if fboss/agent/test/BUCK has `:test_ensemble_if` in exported_deps for linkstate_toggler 20. load_balancer_utils: Added load_balancer_test_utils fboss/agent/hw/test/BUCK has `//fboss/agent/test/utils:load_balancer_test_utils` in exported_deps for load_balancer_utils ## Fixes in cmake/AgentLldp.cmake: 21. lldp: Added agent_features and cow_storage fboss/agent/lldp/BUCK has `//fboss/agent:agent_features` and `//fboss/thrift_cow/storage:cow_storage` in exported_deps for lldp ## Fixes in cmake/AgentPacket.cmake: 22. packet_factory: Added hw_switch fboss/agent/packet/BUCK has `//fboss/agent:hw_switch` in deps for packet_factory ## Fixes in cmake/AgentPlatformsCommon.cmake: 23. platform_mapping_utils: Added platform_mode fboss/agent/platforms/common/BUCK has `//fboss/lib/platforms:platform_mode` in exported_deps for platform_mapping_utils ## Fixes in cmake/AgentPlatformsCommonGalaxy.cmake: 24. galaxy_platform_mapping: Added utils fboss/agent/platforms/common/galaxy/BUCK has `//fboss/agent:utils` in exported_deps for galaxy_platform_mapping ## Fixes in cmake/AgentPlatformsCommonMinipack.cmake: 25. minipack_platform_mapping: Added platform_mode fboss/agent/platforms/common/minipack/BUCK has `//fboss/lib/platforms:platform_mode` in exported_deps for minipack_platform_mapping ## Fixes in cmake/AgentPlatformsCommonUtils.cmake: 26. wedge_led_utils: Added wedge_transceiver fboss/agent/platforms/common/utils/BUCK has `//fboss/qsfp_service/platforms/wedge:wedge-transceiver` in exported_deps for wedge-led-utils ## Fixes in cmake/AgentRib.cmake: 27. standalone_rib: Added fboss_event_base and utils fboss/agent/rib/BUCK has `//fboss/agent:fboss_event_base` and `//fboss/agent:utils` in exported_deps for standalone_rib 28. network_to_route_map: Added state fboss/agent/rib/BUCK has `//fboss/agent/state:state` in exported_deps for network_to_route_map ## Fixes in cmake/AgentState.cmake: 29. state: Added address_utils fboss/agent/state/BUCK has `//fboss/agent:address_utils` in exported_deps for state 30. state_utils: Added hwswitch_matcher and state fboss/agent/state/BUCK has `:state` and `//fboss/agent:hwswitch_matcher` in exported_deps for state_utils ## Fixes in cmake/AgentTest.cmake: 31. agent_test_utils: Added route_distribution_gen fboss/agent/test/BUCK has `:route_distribution_gen` in exported_deps for utils 32. multinode_tests: Added agent_test_utils, hw_copp_utils, hw_packet_utils, load_balancer_utils fboss/agent/test/BUCK has `:utils`, `//fboss/agent/hw/test:hw_copp_utils`, `//fboss/agent/hw/test:hw_packet_utils`, and `//fboss/agent/hw/test:load_balancer_utils` in exported_deps for multinode_tests 33. agent_ensemble: Added sw_agent_initializer fboss/agent/test/BUCK has `//fboss/agent:sw_agent_initializer` in exported_deps for agent_ensemble 34. linkstate_toggler: Added test_ensemble_if fboss/agent/test/BUCK has `:test_ensemble_if` in exported_deps for linkstate_toggler 35. system_scale_test_utils: Added trap_packet_utils fboss/agent/test/utils/BUCK has `:trap_packet_utils` in exported_deps for system_scale_test_utils ## Fixes in cmake/AgentTestAgentHwTests.cmake: 36. agent_hw_test_src: Added load_balancer_test_runner_h fboss/agent/test/agent_hw_tests/BUCK has `//fboss/agent/test/utils:load_balancer_test_runner_h` in exported_deps for agent_hw_test_src ## Fixes in cmake/AgentTestLinkTests.cmake: 37. link_tests: Added trap_packet_utils, hw_qos_utils, hw_test_fabric_utils fboss/agent/test/link_tests/BUCK has `//fboss/agent/test/utils:trap_packet_utils`, `//fboss/agent/hw/test:hw_qos_utils`, and `//fboss/agent/hw/test:hw_test_fabric_utils` in exported_deps for link_tests 38. agent_ensemble_link_tests: Added trap_packet_utils and agent_test_utils fboss/agent/test/link_tests/BUCK has `//fboss/agent/test/utils:trap_packet_utils` and `//fboss/agent/test:utils` in exported_deps for agent_ensemble_link_tests ## Fixes in cmake/AgentTestUtils.cmake: 39. traffic_policy_utils: Added copp_test_utils fboss/agent/test/utils/BUCK has `:copp_test_utils` in exported_deps for traffic_policy_utils 40. qos_test_utils: Added voq_test_utils, resourcelibutil, and pkt_test_utils fboss/agent/test/utils/BUCK has `:voq_test_utils`, `//fboss/agent/test:resourcelibutil`, and `:pkt_test_utils` in exported_deps for qos_test_utils 41. l2learn_observer_util: Added agent_ensemble fboss/agent/test/utils/BUCK has `//fboss/agent/test:agent_ensemble` in exported_deps for l2learn_observer_util 42. mac_test_utils: Added core fboss/agent/test/utils/BUCK has `//fboss/agent:core` in exported_deps for mac_test_utils 43. pfc_test_utils: Added test_ensemble_if, agent_ensemble, and resourcelibutil fboss/agent/test/utils/BUCK has `//fboss/agent/test:test_ensemble_if`, `//fboss/agent/test:agent_ensemble`, and `//fboss/agent/test:resourcelibutil` in exported_deps for pfc_test_utils ## Fixes in cmake/LedService.cmake: 44. led_manager_lib: Added wedge400_fpga and common_port_utils fboss/led_service/BUCK has `//fboss/lib/fpga:wedge400_fpga` and `//fboss/lib:common_port_utils` in exported_deps for led_manager ## Fixes in cmake/Lib.cmake: 45. common_thrift_utils: Added thrift_service_client fboss/lib/BUCK has `//fboss/lib/thrift_service_client:thrift-service-client` in exported_deps for common_thrift_utils 46. common_utils: Added common_file_utils fboss/lib/BUCK has `:common_file_utils` in exported_deps for common_utils ## Fixes in cmake/LibFpga.cmake: 47. fpga_multi_pim_container: Added fpga_device and qsfp_stats fboss/lib/fpga/BUCK has `:fpga_device` and `//fboss/qsfp_service:stats` in exported_deps for multi_pim_container 48. fb_fpga_i2c: Added i2c_ctrl and i2_api fboss/lib/fpga/BUCK has `//fboss/lib/i2c:i2c_ctrl` and `//fboss/lib/usb:i2-api` in exported_deps for fb_fpga_i2c 49. wedge400_i2c: Added i2_api fboss/lib/fpga/BUCK has `//fboss/lib/usb:i2-api` in exported_deps for wedge400_i2c ## Fixes in cmake/LibI2c.cmake: 50. i2c_ctrl: Added utils fboss/lib/i2c/BUCK has `//fboss/agent:utils` in exported_deps for i2c_ctrl ## Fixes in cmake/LibPhy.cmake: 51. external_phy: Added mdio, alert_logger, and fboss_types fboss/lib/phy/BUCK has `//fboss/mdio:mdio`, `//fboss/lib:alert_logger`, and `//fboss/agent:fboss-types` in exported_deps for external_phy ## Fixes in cmake/PlatformBspTests.cmake: 52. bsp_test_utils: Added platform_manager_i2c_explorer fboss/platform/bsp_tests/BUCK has `//fboss/platform/platform_manager:i2c_explorer` in exported_deps for utils ## Fixes in cmake/PlatformPlatformChecks.cmake: 53. platform_check: Added platform_config_lib fboss/platform/platform_checks/BUCK has `//fboss/platform/config_lib:config_lib` in exported_deps for platform_check ## Fixes in cmake/PlatformPlatformManager.cmake: 54. platform_manager_i2c_explorer: Added platform_fs_utils fboss/platform/platform_manager/BUCK has `//fboss/platform/helpers:platform_fs_utils` in exported_deps for i2c_explorer 55. platform_manager_presence_checker: Added platform_fs_utils fboss/platform/platform_manager/BUCK has `//fboss/platform/helpers:platform_fs_utils` in exported_deps for presence_checker ## Fixes in cmake/QsfpService.cmake: 56-72. Added bsp_platform_mapping to 17 BSP targets: meru400bfu_bsp, meru400bia_bsp, meru400biu_bsp, meru800bia_bsp, meru800bfa_bsp, montblanc_bsp, icecube800bc_bsp, icetea800bc_bsp, minipack3n_bsp, morgan800cc_bsp, janga800bic_bsp, tahan800bc_bsp, tahansb800bc_bsp, nh4010_bsp, wedge800bact_bsp, wedge800cact_bsp, ladakh800bcls_bsp All these targets in fboss/lib/bsp/*/BUCK have `//fboss/lib/bsp:bsp_platform_mapping_lib` in exported_deps (example: fboss/lib/bsp/meru400bfu/BUCK has this for meru400bfu_bsp) 73. qsfp_stats: Added fboss_types fboss/qsfp_service/BUCK has `//fboss/agent:fboss-types` in exported_deps for stats 74. qsfp_bsp_core: Added gpiod_line and i2_api fboss/lib/bsp/BUCK has `//fboss/lib:gpiod_line` and `//fboss/lib/usb:i2-api` in exported_deps for bsp_core 75. transceiver_validator: Added alert_logger fboss/qsfp_service/BUCK has `//fboss/lib:alert_logger` in exported_deps for transceiver_validator ## Fixes in cmake/QsfpServiceTestHwTest.cmake: 76. hw_transceiver_utils: Added platform_mapping fboss/qsfp_service/test/hw_test/BUCK has `//fboss/agent/platforms/common:platform_mapping` in exported_deps for hw_transceiver_utils ## Fixes in cmake/ThriftCowVisitors.cmake: 77. thrift_cow_visitors: Added thrift_cow_serializer fboss/thrift_cow/visitors/BUCK has `//fboss/thrift_cow/nodes:serializer` in exported_deps for visitors ## Fixes in cmake/fsdb/FsdbClient.cmake: 78. fsdb_sub_mgr: Added fsdb_flags and thrift_service_client fboss/fsdb/client/BUCK has `//fboss/fsdb/common:flags` and `//fboss/lib/thrift_service_client:thrift-service-client` in exported_deps for fsdb_sub_manager ## Fixes in cmake/fsdb/FsdbIf.cmake: 79. fsdb_model_cpp2: Added fsdb_common_cpp2 to DEPENDS fboss/fsdb/if/oss/BUCK has `//fboss/fsdb/if:fsdb_common` in deps for fsdb_model ## Fixes in cmake/fsdb/FsdbOperInstantiations.cmake: 80. fsdb_cow_stats_sub_mgr: Added fsdb_cow_state_sub_mgr fboss/fsdb/client/BUCK (fsdb_cow_stats_sub_manager target) has `:fsdb_cow_state_sub_manager` in exported_deps ## Fixes in cmake/fsdb/FsdbServer.cmake: 81. fsdb_server: Added restart_time_tracker fboss/fsdb/server/BUCK has `//fboss/lib/restart_tracker:restart_time_tracker` in exported_deps for fsdb_server ## Fixes in cmake/fsdb/FsdbTests.cmake: 82. fsdb_test_subscriber: Changed fsdb_model_cpp2 to fsdb_model fboss/fsdb/tests/utils/BUCK has `//fboss/fsdb/if:fsdb_model` in exported_deps for fsdb_test_subscriber (fsdb_model includes both cpp2 types and thriftpath) 83. fsdb_test_clients: Changed fsdb_model_cpp2 to fsdb_model fboss/fsdb/tests/client/BUCK has `//fboss/fsdb/if:fsdb_model` in exported_deps for fsdb_test_clients ## New tool added: `tools/buck_cmake_dep_checker.py` - A tool to detect missing dependencies between Buck and cmake build systems by: - Parsing BUCK and cmake files to extract targets and their dependencies - Matching cmake targets to Buck targets based on source file overlap - Identifying dependencies present in Buck but missing in cmake - Supporting cmake variable expansion and transitive dependency analysis
1 parent d08c9e3 commit 7ebee67

35 files changed

+882
-3
lines changed

cmake/Agent.cmake

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_library(setup_thrift
1010

1111
target_link_libraries(setup_thrift
1212
load_agent_config
13+
thrift_method_rate_limit
1314
Folly::folly
1415
FBThrift::thriftcpp2
1516
)
@@ -52,6 +53,7 @@ add_library(hw_switch_handler
5253
)
5354

5455
target_link_libraries(hw_switch_handler
56+
fboss_event_base
5557
load_agent_config
5658
switch_config_cpp2
5759
utils
@@ -96,6 +98,8 @@ target_link_libraries(switchinfo_utils
9698
ctrl_cpp2
9799
fboss_types
98100
agent_config_cpp2
101+
fboss_error
102+
load_agent_config
99103
)
100104

101105
add_library(dsfnode_utils
@@ -146,6 +150,7 @@ target_link_libraries(utils
146150
asic_utils
147151
error
148152
ctrl_cpp2
153+
hw_switch_fb303_stats
149154
load_agent_config
150155
state
151156
switchid_scope_resolver
@@ -174,6 +179,7 @@ add_library(stats
174179
target_link_libraries(stats
175180
fboss_types
176181
agent_stats_cpp2
182+
common_utils
177183
state
178184
Folly::folly
179185
)
@@ -218,7 +224,10 @@ add_library(ecmp_resource_manager
218224

219225
target_link_libraries(ecmp_resource_manager
220226
fib_helpers
227+
ref_map
221228
state
229+
stats
230+
utils
222231
Folly::folly
223232
)
224233

@@ -370,6 +379,7 @@ set(core_libs
370379
lldp
371380
multiswitch_ctrl_cpp2
372381
packet
382+
packet_factory
373383
product_info
374384
platform_base
375385
restart_time_tracker
@@ -475,6 +485,7 @@ add_library(fboss_event_base
475485
)
476486

477487
target_link_libraries(fboss_event_base
488+
agent_features
478489
Folly::folly
479490
)
480491

@@ -504,12 +515,15 @@ target_link_libraries(platform_base
504515
agent_dir_util
505516
ctrl_cpp2
506517
error
518+
fboss_event_base
507519
fboss_types
508520
Folly::folly
509521
load_agent_config
510522
platform_mapping
523+
product_info
511524
switchid_scope_resolver
512525
switchinfo_utils
526+
utils
513527
)
514528

515529
add_library(hw_switch
@@ -828,7 +842,9 @@ add_library(agent_netwhoami
828842
fboss/agent/oss/AgentNetWhoAmI.cpp
829843
)
830844

831-
target_link_libraries(agent_netwhoami)
845+
target_link_libraries(agent_netwhoami
846+
common_file_utils
847+
)
832848

833849
add_library(agent_features
834850
fboss/agent/AgentFeatures.cpp

cmake/AgentHw.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,18 @@ target_link_libraries(hw_switch_fb303_stats
8484

8585
target_link_libraries(hw_fb303_stats
8686
counter_utils
87+
error
8788
fb303::fb303
8889
Folly::folly
8990
switch_config_cpp2
9091
)
9192

9293
target_link_libraries(hw_port_fb303_stats
9394
counter_utils
95+
fboss_types
9496
FBThrift::thriftcpp2
9597
hardware_stats_cpp2
98+
hw_fb303_stats
9699
Folly::folly
97100
)
98101

cmake/AgentHwMock.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_library(hw_mock
2222

2323
target_link_libraries(hw_mock
2424
core
25+
handler
2526
pkt
2627
Folly::folly
2728
${GTEST}

cmake/AgentHwSaiHwTest.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ add_library(agent_hw_test_thrift_handler
191191
)
192192

193193
target_link_libraries(agent_hw_test_thrift_handler
194+
hw_switch
194195
sai_switch # //fboss/agent/hw/sai/switch:sai_switch
195196
acl_test_utils
196197
agent_hw_test_ctrl_cpp2

cmake/AgentHwSwitchAsics.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ add_library(switch_asics
3131
)
3232

3333
target_link_libraries(switch_asics
34+
agent_features
35+
error
3436
fboss_cpp2
37+
fboss_types
3538
phy_cpp2
3639
switch_config_cpp2
3740
version_util

cmake/AgentHwTest.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_library(config_factory
1717
)
1818

1919
target_link_libraries(config_factory
20+
acl_test_utils
2021
config_utils
2122
fboss_types
2223
hw_switch
@@ -26,6 +27,8 @@ target_link_libraries(config_factory
2627
fboss_config_utils
2728
port_test_utils
2829
linkstate_toggler
30+
split_agent_thrift_syncer
31+
multiswitch_test_server
2932
)
3033

3134
add_library(hw_test_main
@@ -47,6 +50,7 @@ add_library(hw_packet_utils
4750
)
4851

4952
target_link_libraries(hw_packet_utils
53+
agent_test_utils
5054
hw_switch_ensemble
5155
packet_factory
5256
packet_snooper
@@ -77,6 +81,8 @@ add_library(hw_copp_utils
7781
)
7882

7983
target_link_libraries(hw_copp_utils
84+
copp_test_utils
85+
hw_packet_utils
8086
hw_test_acl_utils
8187
switch_asics
8288
packet_factory
@@ -136,6 +142,7 @@ target_link_libraries(hw_link_state_toggler
136142
core
137143
switch_config_cpp2
138144
state
145+
test_ensemble_if
139146
Folly::folly
140147
)
141148

@@ -174,6 +181,7 @@ add_library(load_balancer_utils
174181
target_link_libraries(load_balancer_utils
175182
fboss_types
176183
hw_switch
184+
load_balancer_test_utils
177185
platform_base
178186
switch_asics
179187
state

cmake/AgentLldp.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ add_library(lldp
1818
)
1919

2020
target_link_libraries(lldp
21+
agent_features
22+
cow_storage
2123
fboss_types
2224
lldp_structs_cpp2
2325
Folly::folly

cmake/AgentPacket.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ add_library(packet_factory
5858
)
5959

6060
target_link_libraries(packet_factory
61+
hw_switch
6162
packet
6263
ctrl_cpp2
6364
switch_config_cpp2

cmake/AgentPlatformsCommon.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ target_link_libraries(platform_mapping_utils
5454
tahansb800bc_platform_mapping
5555
wedge800cact_platform_mapping
5656
ladakh800bcls_platform_mapping
57+
platform_mode
5758
${RE2}
5859
)

cmake/AgentPlatformsCommonGalaxy.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ add_library(galaxy_platform_mapping
1212

1313
target_link_libraries(galaxy_platform_mapping
1414
platform_mapping
15+
utils
1516
Folly::folly
1617
)

0 commit comments

Comments
 (0)