Skip to content

Commit 61b5ab6

Browse files
induvsureshmeta-codesync[bot]
authored andcommitted
Vendor openr IDL + NetworkUtil, OSS build fixes
Summary: Vendors a minimal openr slice into `public_tld/openr/` so the OSS build can drop the `openr` getdeps dependency entirely. Carries forward magic_enum, fmt, and other OSS build fixes. Does NOT include `#ifndef IS_OSS` gates for hiding `NetlinkWrapper` — that is handled architecturally by D105648380 (augmentation pattern moving `NetlinkWrapper` into `BgpServiceBB`). **Vendored openr files** (`public_tld/openr/`, see `PROVENANCE.md` for full notes and removal trigger): - `if/Network.thrift` — verbatim copy - `if/Platform.thrift` — copy with two adaptations: removed `include "fb303/thrift/fb303_core.thrift"` and the `extends fb303_core.BaseService` clause on `FibService`. BGP++ uses `FibService` only as a client and never calls `BaseService` methods. - `common/NetworkUtil.{h,cpp}` — copy with adaptations: removed unused `Constants.h`, `OpenrCtrl_types.h`, `Types_types.h` includes; replaced `throw thrift::OpenrError(...)` with `throw std::runtime_error(...)`. - `monitor/SystemMetrics.{h,cpp}` — pre-existing vendor (untouched here). **`public_tld/CMakeLists.txt` changes:** - Dropped `find_path(OPENR_INCLUDE_DIR ...)` and the four `find_library(OPENR_*)` calls. - Added `add_fbthrift_cpp_library` for vendored `Network.thrift` and `Platform.thrift` (mirroring the D104704212 fb303 pattern). - Added `add_library(openr_networkutil openr/common/NetworkUtil.cpp)`. - Updated `set(OPENR_LIBS ...)` to point to the new local targets — all existing `${OPENR_LIBS}` references in `bgp_common`, `bgp_nexthop`, `bgp_rib`, `bgp_adjrib`, `bgp_peer`, `bgp_service` continue to work. - Removed `NetlinkWrapper.cpp` from `add_library(bgp_nexthop)` source list (it pulls unvendored `openr/messaging` + `openr/nl`). - Updated `install(DIRECTORY ... PATTERN "*.h")` to exclude `facebook`, `RibBB.h`, and `NetlinkWrapper.h` (the header pulls unvendored openr symbols). **Other OSS build fixes:** - `cpp/lib/fibers/FiberBgpPeerManager.cpp`: wrap fmt enum-format sites with `magic_enum::enum_name()`. - `cpp/policy/PolicyMatch.cpp`: add `<fmt/format.h>` and `<fmt/ranges.h>`. - `cpp/policy/PolicyAction.cpp`, `PolicyTerm.cpp`: wrap fmt enum-format sites with `magic_enum::enum_name()`. - `cpp/policy/base/PolicyMatchBase.h`: drop `noexcept` from virtual `Match` (function throws `std::bad_function_call`; newer Clang flags as `-Werror=exceptions`). - `public_tld/configerator/structs/neteng/fboss/thrift/common.thrift`: local mirror needed because FBOSS does not install its generated `common_types.h` (same fb303 pattern as D104704212). - `public_tld/configerator/structs/neteng/fboss/bgp/bgp_config.thrift`: add `enhanced_route_refresh` and `route_refresh` fields with the same field IDs as the internal copy for wire compatibility. - `manifests/bgp`: keeps `magic_enum`, drops `openr` (no longer needed since the IDL and `NetworkUtil` are vendored). - `cpp/policy/BUCK`, `cpp/lib/BUCK`: include updates surfaced by autodeps. **Removal trigger:** The vendored `openr/` slice can be deleted once the Phase 2 refactor of `NexthopInfoBase`/`NexthopStatus`/`Utils` to BGP++-private thrift types lands — at which point the entire `public_tld/openr/` tree (except `monitor/`) goes away and the openr getdeps dep is removed permanently. Reviewed By: xiangxu1121 Differential Revision: D106128986 fbshipit-source-id: 0cdef66679e18d89e555dfd311daeafe8e67930f
1 parent 88bf42a commit 61b5ab6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • build/fbcode_builder/manifests

build/fbcode_builder/manifests/bgp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fb303
2020
fboss
2121
fbthrift
2222
folly
23+
magic_enum
2324
re2
2425

2526
[shipit.pathmap]

0 commit comments

Comments
 (0)