-
Notifications
You must be signed in to change notification settings - Fork 374
[Nexthop] Add missing cmake dependencies to match BUCK build configuration #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+882
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
7ebee67 to
b106e56
Compare
|
@KevinYakar has imported this pull request. If you are a Meta employee, you can view this in D91347206. |
|
@KevinYakar merged this pull request in 9c72b3b. |
benoit-nexthop
added a commit
to nexthop-ai/fboss
that referenced
this pull request
Jan 24, 2026
The BUCK build has a single `fboss-error` target containing:
- `FbossError.h`
- `FbossHwUpdateError.h`
- `SysError.h`
The cmake build previously had two separate targets:
- `error` (only `FbossError.h`)
- `fboss_error` (`FbossError.h` and `SysError.h`)
This caused divergence between the two build systems.
Changes made:
1. Remove the `error` target from `cmake/Agent.cmake`
2. Update `fboss_error` to include all three headers to match BUCK:
- `FbossError.h`
- `FbossHwUpdateError.h` (was missing)
- `SysError.h`
3. Update `fboss_error` dependencies to match BUCK exactly:
- `fboss_cpp2` (matches `//fboss/agent/if:fboss-cpp2-types`)
- `Folly::folly` (matches `//folly:conv` and `//folly/logging:logging`)
- Remove `fboss_types` (not in BUCK dependencies)
4. Replace all 23 instances of `error` dependency with `fboss_error`
across 16 cmake files
5. Add missing `fboss_error` dependency to `external_phy` target
(required in the BUCK file but was missing in cmake)
Additionally, two more fixes had to be fixed to address all the
remaining issue with `system_scale_test_utils` found by the script,
and those were resolved once again by matching BUCK files:
- Remove bundled source files (`PortFlapHelper.cpp`, `MacLearningFloodHelper.cpp`)
- Add dependencies on existing `port_flap_helper` and `mac_learning_flood_helper`
targets (defined in `AgentTestUtils.cmake`)
Oh and a few more errors that sneaked into the code more recently and
that I missed in facebook#833 because I was working off a fork a few days old:
1. In `cmake/AgentState.cmake`, the `state` library was missing a dependency
on `agent_features` (from Buck dep: `//fboss/agent:agent_features`)
2. In `cmake/fsdb/FsdbIf.cmake`, the `thriftpath_lib` library was missing a
dependency on `fsdb_utils` (from Buck dep: `//fboss/fsdb/common:utils`)
3. In `cmake/fsdb/FsdbTests.cmake`, the `thriftpath_test_cpp2` library was
missing a dependency on `common_cpp2` (from Buck dep: `//fboss/agent/if:common`)
Bonus: add duplicate cmake target detection to `buck_cmake_dep_checker.py`,
because while fixing that last error I inadvertently made the mistake of
creating a duplicate rule in a cmake file that was defined in another.
Now the script doesn't report any errors anymore and could potentially
be used in CI to ensure no further differences between the BUCK build
and the cmake build are introduced.
2 tasks
benoit-nexthop
added a commit
to nexthop-ai/fboss
that referenced
this pull request
Jan 24, 2026
The BUCK build has a single `fboss-error` target containing:
- `FbossError.h`
- `FbossHwUpdateError.h`
- `SysError.h`
The cmake build previously had two separate targets:
- `error` (only `FbossError.h`)
- `fboss_error` (`FbossError.h` and `SysError.h`)
This caused divergence between the two build systems.
Changes made:
1. Remove the `error` target from `cmake/Agent.cmake`
2. Update `fboss_error` to include all three headers to match BUCK:
- `FbossError.h`
- `FbossHwUpdateError.h` (was missing)
- `SysError.h`
3. Update `fboss_error` dependencies to match BUCK exactly:
- `fboss_cpp2` (matches `//fboss/agent/if:fboss-cpp2-types`)
- `Folly::folly` (matches `//folly:conv` and `//folly/logging:logging`)
- Remove `fboss_types` (not in BUCK dependencies)
- Plot twist: add`switch_config_cpp2` dependency to `logging_util` target.
This was previously provided transitively via `fboss_error` -> `fboss_types`
-> `switch_config_cpp2`, but removing `fboss_types` from `fboss_error`
broke that chain. The `logging_util` target directly includes
`switch_config_types.h` so it needs to declare this dependency explicitly.
4. Replace all 23 instances of `error` dependency with `fboss_error`
across 16 cmake files
5. Add missing `fboss_error` dependency to `external_phy` target
(required in the BUCK file but was missing in cmake)
Additionally, two more fixes had to be fixed to address all the
remaining issue with `system_scale_test_utils` found by the script,
and those were resolved once again by matching BUCK files:
- Remove bundled source files (`PortFlapHelper.cpp`, `MacLearningFloodHelper.cpp`)
- Add dependencies on existing `port_flap_helper` and `mac_learning_flood_helper`
targets (defined in `AgentTestUtils.cmake`)
Oh and a few more errors that sneaked into the code more recently and
that I missed in facebook#833 because I was working off a fork a few days old:
1. In `cmake/AgentState.cmake`, the `state` library was missing a dependency
on `agent_features` (from Buck dep: `//fboss/agent:agent_features`)
2. In `cmake/fsdb/FsdbIf.cmake`, the `thriftpath_lib` library was missing a
dependency on `fsdb_utils` (from Buck dep: `//fboss/fsdb/common:utils`)
3. In `cmake/fsdb/FsdbTests.cmake`, the `thriftpath_test_cpp2` library was
missing a dependency on `common_cpp2` (from Buck dep: `//fboss/agent/if:common`)
Bonus: add duplicate cmake target detection to `buck_cmake_dep_checker.py`,
because while fixing that last error I inadvertently made the mistake of
creating a duplicate rule in a cmake file that was defined in another.
Now the script doesn't report any errors anymore and could potentially
be used in CI to ensure no further differences between the BUCK build
and the cmake build are introduced.
benoit-nexthop
added a commit
to nexthop-ai/fboss
that referenced
this pull request
Jan 24, 2026
The BUCK build has a single `fboss-error` target containing:
- `FbossError.h`
- `FbossHwUpdateError.h`
- `SysError.h`
The cmake build previously had two separate targets:
- `error` (only `FbossError.h`)
- `fboss_error` (`FbossError.h` and `SysError.h`)
This caused divergence between the two build systems.
Changes made:
1. Remove the `error` target from `cmake/Agent.cmake`
2. Update `fboss_error` to include all three headers to match BUCK:
- `FbossError.h`
- `FbossHwUpdateError.h` (was missing)
- `SysError.h`
3. Update `fboss_error` dependencies to match BUCK exactly:
- `fboss_cpp2` (matches `//fboss/agent/if:fboss-cpp2-types`)
- `Folly::folly` (matches `//folly:conv` and `//folly/logging:logging`)
- Remove `fboss_types` (not in BUCK dependencies)
- Plot twist: add`switch_config_cpp2` dependency to `logging_util` target.
This was previously provided transitively via `fboss_error` -> `fboss_types`
-> `switch_config_cpp2`, but removing `fboss_types` from `fboss_error`
broke that chain. The `logging_util` target directly includes
`switch_config_types.h` so it needs to declare this dependency explicitly.
4. Replace all 23 instances of `error` dependency with `fboss_error`
across 16 cmake files
5. Add missing `fboss_error` dependency to `external_phy` target
(required in the BUCK file but was missing in cmake)
Additionally, two more fixes had to be fixed to address all the
remaining issue with `system_scale_test_utils` found by the script,
and those were resolved once again by matching BUCK files:
- Remove bundled source files (`PortFlapHelper.cpp`, `MacLearningFloodHelper.cpp`)
- Add dependencies on existing `port_flap_helper` and `mac_learning_flood_helper`
targets (defined in `AgentTestUtils.cmake`)
Oh and a few more errors that sneaked into the code more recently and
that I missed in facebook#833 because I was working off a fork a few days old:
1. In `cmake/AgentState.cmake`, the `state` library was missing a dependency
on `agent_features` (from Buck dep: `//fboss/agent:agent_features`)
2. In `cmake/fsdb/FsdbIf.cmake`, the `thriftpath_lib` library was missing a
dependency on `fsdb_utils` (from Buck dep: `//fboss/fsdb/common:utils`)
3. In `cmake/fsdb/FsdbTests.cmake`, the `thriftpath_test_cpp2` library was
missing a dependency on `common_cpp2` (from Buck dep: `//fboss/agent/if:common`)
Bonus: add duplicate cmake target detection to `buck_cmake_dep_checker.py`,
because while fixing that last error I inadvertently made the mistake of
creating a duplicate rule in a cmake file that was defined in another.
Also fix the tool to handle thrift sub-targets. Buck thrift_library generates
sub-targets like `//path:name-cpp2-types`, `//path:name-cpp2-services`, etc.
The tool now maps these to the corresponding cmake thrift target, which
uncovered 9 additional pre-existing missing dependencies that are now fixed:
- Add `switch_config_cpp2` to `logging_util` (includes `switch_config_types.h`)
- Add `ctrl_cpp2` to `label_forwarding_action` (includes `ctrl_types.h`)
- Add `agent_hw_test_ctrl_cpp2` to `aqm_test_utils`
- Add `data_corral_service_cpp2`, `fan_service_cpp2`, `rackmon_cpp2` to `fboss2_lib`
- Add `fboss_common_cpp2` to `product_info`
- Add `fan_service_cpp2` to `cross_config_validator`
- Add `fan_service_cpp2` to `fan_service_config_validator`
- Add `transceiver_cpp2` to `qsfp_stats`
Now the script doesn't report any errors anymore and could potentially
be used in CI to ensure no further differences between the BUCK build
and the cmake build are introduced.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
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.pytool.This commit fixes all but 11 of the dependencies problems found by the tool. The remaining 11 will be fixed in a subsequent PR where a bit of restructuring is needed in the cmake files to match the BUCK files more closely.
Fixes in cmake/Agent.cmake:
setup_thrift: Added thrift_method_rate_limit fboss/agent/BUCK has
//fboss/lib:thrift_method_rate_limitin exported_deps for setup_thriftutils: Added hw_switch_fb303_stats fboss/agent/BUCK has
//fboss/agent/hw:hw_switch_fb303_statsin exported_deps for utilsstats: Added common_utils fboss/agent/BUCK has
//fboss/lib:common_utilsin exported_deps for statsecmp_resource_manager: Added ref_map, stats, and utils fboss/agent/BUCK has
//fboss/lib:ref_map,:stats, and:utilsin exported_deps for ecmp_resource_managerplatform_base: Added utils, product_info, and fboss_event_base fboss/agent/BUCK has
:utils,//fboss/lib/platforms:product-info, and:fboss_event_basein exported_deps for platform_basehw_switch_handler: Added fboss_event_base fboss/agent/BUCK has
:fboss_event_basein exported_deps for hw_switch_handlerswitchinfo_utils: Added fboss_error and load_agent_config fboss/agent/BUCK has
:fboss-errorand:load_agent_configin exported_deps for switchinfo_utilscore: Added packet_factory to core_libs variable fboss/agent/BUCK has
//fboss/agent/packet:packet_factoryin deps for corefboss_event_base: Added agent_features fboss/agent/BUCK has
:agent_featuresin exported_deps for fboss_event_baseagent_netwhoami: Added common_file_utils fboss/agent/BUCK has
//fboss/lib:common_file_utilsin exported_deps for agent_netwhoamiFixes in cmake/AgentHw.cmake:
hw_fb303_stats: Added error fboss/agent/hw/BUCK has
//fboss/agent:fboss-errorin exported_deps for hw_fb303_statshw_port_fb303_stats: Added hw_fb303_stats and fboss_types fboss/agent/hw/BUCK has
:hw_fb303_statsand//fboss/agent:fboss-typesin exported_deps for hw_port_fb303_statsFixes in cmake/AgentHwMock.cmake:
//fboss/agent:handlerin exported_deps for mockFixes in cmake/AgentHwSaiHwTest.cmake:
//fboss/agent:hw_switchin exported_deps for agent_hw_test_thrift_handlerFixes in cmake/AgentHwSwitchAsics.cmake:
//fboss/agent:agent_features,//fboss/agent:fboss-error, and//fboss/agent:fboss-typesin exported_deps for switch_asicsFixes in cmake/AgentHwTest.cmake:
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_serverin exported_deps for config_factoryhw_packet_utils: Added agent_test_utils fboss/agent/hw/test/BUCK has
//fboss/agent/test:utilsin exported_deps for hw_packet_utilshw_copp_utils: Added copp_test_utils and hw_packet_utils fboss/agent/hw/test/BUCK has
//fboss/agent/test/utils:copp_test_utilsand:hw_packet_utilsin exported_deps for hw_copp_utilshw_link_state_toggler: Added test_ensemble_if fboss/agent/test/BUCK has
:test_ensemble_ifin exported_deps for linkstate_togglerload_balancer_utils: Added load_balancer_test_utils fboss/agent/hw/test/BUCK has
//fboss/agent/test/utils:load_balancer_test_utilsin exported_deps for load_balancer_utilsFixes in cmake/AgentLldp.cmake:
//fboss/agent:agent_featuresand//fboss/thrift_cow/storage:cow_storagein exported_deps for lldpFixes in cmake/AgentPacket.cmake:
//fboss/agent:hw_switchin deps for packet_factoryFixes in cmake/AgentPlatformsCommon.cmake:
//fboss/lib/platforms:platform_modein exported_deps for platform_mapping_utilsFixes in cmake/AgentPlatformsCommonGalaxy.cmake:
//fboss/agent:utilsin exported_deps for galaxy_platform_mappingFixes in cmake/AgentPlatformsCommonMinipack.cmake:
//fboss/lib/platforms:platform_modein exported_deps for minipack_platform_mappingFixes in cmake/AgentPlatformsCommonUtils.cmake:
//fboss/qsfp_service/platforms/wedge:wedge-transceiverin exported_deps for wedge-led-utilsFixes in cmake/AgentRib.cmake:
standalone_rib: Added fboss_event_base and utils fboss/agent/rib/BUCK has
//fboss/agent:fboss_event_baseand//fboss/agent:utilsin exported_deps for standalone_ribnetwork_to_route_map: Added state fboss/agent/rib/BUCK has
//fboss/agent/state:statein exported_deps for network_to_route_mapFixes in cmake/AgentState.cmake:
state: Added address_utils fboss/agent/state/BUCK has
//fboss/agent:address_utilsin exported_deps for statestate_utils: Added hwswitch_matcher and state fboss/agent/state/BUCK has
:stateand//fboss/agent:hwswitch_matcherin exported_deps for state_utilsFixes in cmake/AgentTest.cmake:
agent_test_utils: Added route_distribution_gen fboss/agent/test/BUCK has
:route_distribution_genin exported_deps for utilsmultinode_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_utilsin exported_deps for multinode_testsagent_ensemble: Added sw_agent_initializer fboss/agent/test/BUCK has
//fboss/agent:sw_agent_initializerin exported_deps for agent_ensemblelinkstate_toggler: Added test_ensemble_if fboss/agent/test/BUCK has
:test_ensemble_ifin exported_deps for linkstate_togglersystem_scale_test_utils: Added trap_packet_utils fboss/agent/test/utils/BUCK has
:trap_packet_utilsin exported_deps for system_scale_test_utilsFixes in cmake/AgentTestAgentHwTests.cmake:
//fboss/agent/test/utils:load_balancer_test_runner_hin exported_deps for agent_hw_test_srcFixes in cmake/AgentTestLinkTests.cmake:
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_utilsin exported_deps for link_testsagent_ensemble_link_tests: Added trap_packet_utils and agent_test_utils fboss/agent/test/link_tests/BUCK has
//fboss/agent/test/utils:trap_packet_utilsand//fboss/agent/test:utilsin exported_deps for agent_ensemble_link_testsFixes in cmake/AgentTestUtils.cmake:
traffic_policy_utils: Added copp_test_utils fboss/agent/test/utils/BUCK has
:copp_test_utilsin exported_deps for traffic_policy_utilsqos_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_utilsin exported_deps for qos_test_utilsl2learn_observer_util: Added agent_ensemble fboss/agent/test/utils/BUCK has
//fboss/agent/test:agent_ensemblein exported_deps for l2learn_observer_utilmac_test_utils: Added core fboss/agent/test/utils/BUCK has
//fboss/agent:corein exported_deps for mac_test_utilspfc_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:resourcelibutilin exported_deps for pfc_test_utilsFixes in cmake/LedService.cmake:
//fboss/lib/fpga:wedge400_fpgaand//fboss/lib:common_port_utilsin exported_deps for led_managerFixes in cmake/Lib.cmake:
common_thrift_utils: Added thrift_service_client fboss/lib/BUCK has
//fboss/lib/thrift_service_client:thrift-service-clientin exported_deps for common_thrift_utilscommon_utils: Added common_file_utils fboss/lib/BUCK has
:common_file_utilsin exported_deps for common_utilsFixes in cmake/LibFpga.cmake:
fpga_multi_pim_container: Added fpga_device and qsfp_stats fboss/lib/fpga/BUCK has
:fpga_deviceand//fboss/qsfp_service:statsin exported_deps for multi_pim_containerfb_fpga_i2c: Added i2c_ctrl and i2_api fboss/lib/fpga/BUCK has
//fboss/lib/i2c:i2c_ctrland//fboss/lib/usb:i2-apiin exported_deps for fb_fpga_i2cwedge400_i2c: Added i2_api fboss/lib/fpga/BUCK has
//fboss/lib/usb:i2-apiin exported_deps for wedge400_i2cFixes in cmake/LibI2c.cmake:
//fboss/agent:utilsin exported_deps for i2c_ctrlFixes in cmake/LibPhy.cmake:
//fboss/mdio:mdio,//fboss/lib:alert_logger, and//fboss/agent:fboss-typesin exported_deps for external_phyFixes in cmake/PlatformBspTests.cmake:
//fboss/platform/platform_manager:i2c_explorerin exported_deps for utilsFixes in cmake/PlatformPlatformChecks.cmake:
//fboss/platform/config_lib:config_libin exported_deps for platform_checkFixes in cmake/PlatformPlatformManager.cmake:
platform_manager_i2c_explorer: Added platform_fs_utils fboss/platform/platform_manager/BUCK has
//fboss/platform/helpers:platform_fs_utilsin exported_deps for i2c_explorerplatform_manager_presence_checker: Added platform_fs_utils fboss/platform/platform_manager/BUCK has
//fboss/platform/helpers:platform_fs_utilsin exported_deps for presence_checkerFixes 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
qsfp_stats: Added fboss_types fboss/qsfp_service/BUCK has
//fboss/agent:fboss-typesin exported_deps for statsqsfp_bsp_core: Added gpiod_line and i2_api fboss/lib/bsp/BUCK has
//fboss/lib:gpiod_lineand//fboss/lib/usb:i2-apiin exported_deps for bsp_coretransceiver_validator: Added alert_logger fboss/qsfp_service/BUCK has
//fboss/lib:alert_loggerin exported_deps for transceiver_validatorFixes in cmake/QsfpServiceTestHwTest.cmake:
//fboss/agent/platforms/common:platform_mappingin exported_deps for hw_transceiver_utilsFixes in cmake/ThriftCowVisitors.cmake:
//fboss/thrift_cow/nodes:serializerin exported_deps for visitorsFixes in cmake/fsdb/FsdbClient.cmake:
//fboss/fsdb/common:flagsand//fboss/lib/thrift_service_client:thrift-service-clientin exported_deps for fsdb_sub_managerFixes in cmake/fsdb/FsdbIf.cmake:
//fboss/fsdb/if:fsdb_commonin deps for fsdb_modelFixes in cmake/fsdb/FsdbOperInstantiations.cmake:
:fsdb_cow_state_sub_managerin exported_depsFixes in cmake/fsdb/FsdbServer.cmake:
//fboss/lib/restart_tracker:restart_time_trackerin exported_deps for fsdb_serverFixes in cmake/fsdb/FsdbTests.cmake:
fsdb_test_subscriber: Changed fsdb_model_cpp2 to fsdb_model fboss/fsdb/tests/utils/BUCK has
//fboss/fsdb/if:fsdb_modelin exported_deps for fsdb_test_subscriber (fsdb_model includes both cpp2 types and thriftpath)fsdb_test_clients: Changed fsdb_model_cpp2 to fsdb_model fboss/fsdb/tests/client/BUCK has
//fboss/fsdb/if:fsdb_modelin exported_deps for fsdb_test_clientsNew tool added:
tools/buck_cmake_dep_checker.py- A tool to detect missing dependencies between Buck and cmake build systems by:Test Plan
The cmake build still succeeds, even in a heavily parallel build (
make -j305).