Skip to content

Commit ea001e8

Browse files
induvsureshmeta-codesync[bot]
authored andcommitted
Sync fboss common.thrift into BGP OSS build via ShipIt pathmap
Summary: BGP++'s OSS build (shipped to `github.com/facebook/BGP`) runs its own thrift compile of `rib_policy.thrift`, whose `include "configerator/structs/neteng/fboss/thrift/common.thrift"` (restored in the child diff, along with the `fboss_common.AllowSkipThriftCow` annotations) must resolve from BGP++'s OSS source root. The standalone getdeps build could not resolve it: FBOSS installs the compiled C++ for `common.thrift` (`common_types.h` under `include/`, symbols in `cfgr_fboss_common_cpp2`, both already consumed by BGP++) but not the raw `.thrift` schema. `common.thrift` cannot be vendored as a repackaged copy the way BGP++'s other OSS schemas are. thrift-cow detects `AllowSkipThriftCow` by the annotation's resolved C++ type (`facebook::neteng::fboss::common::AllowSkipThriftCow`), which is derived from the thrift `package`, so keeping the package identical to FBOSS's is required for the annotation to be recognized. But a committed copy carrying that same `package` duplicates the implicit Thrift URI `facebook.com/neteng/fboss/common/AllowSkipThriftCow` already declared by the configerator source, which the land-blocking `thrift-duplicate-uri` linter rejects. So this mirrors exactly what FBOSS does for the same file: sync the single configerator source into the OSS tree rather than committing a second copy. - `manifests/bgp`: add a `[shipit.pathmap]` entry `fbcode/configerator/structs/neteng/fboss/thrift = configerator/structs/neteng/fboss/thrift` (matching `manifests/fboss`), so `getdeps` materializes `common.thrift` into BGP++'s OSS tree at fetch/ship time. The unrelated schemas in that dir are stripped so only `common.thrift` ships. - `bgp_oss_build.bzl`: the `bgp-oss-build` CI builds from a staged `bgp_src/` (not from the pathmap), so stage `common.thrift` from the configerator source there too. No file is committed under `public_tld`, so there is no duplicate URI and no `validate_cmake_sync` change is needed (`common.thrift` has no `add_fbthrift_cpp_library()` target; its C++ comes from `cfgr_fboss_common_cpp2`). Replaces the previous version of this diff, which committed a vendored copy of `common.thrift` that tripped `thrift-duplicate-uri`. Per review feedback from joseph5wu (use the shipit option like FBOSS), this keeps the change on the BGP++ side and leaves FBOSS's install surface untouched. Reviewed By: joseph5wu Differential Revision: D111074394 fbshipit-source-id: 4802eeb380f44d2eb60867df03317a12ef21757b
1 parent 60cb55c commit ea001e8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • build/fbcode_builder/manifests

build/fbcode_builder/manifests/bgp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ gcc12
3232
fbcode/neteng/fboss/bgp/public_tld = .
3333
fbcode/neteng/fboss/bgp = neteng/fboss/bgp
3434
fbcode/fboss/common = common
35+
# common.thrift defines the @AllowSkipThriftCow annotation whose C++ type is
36+
# derived from its package, so rib_policy.thrift must resolve the exact FBOSS
37+
# schema. A committed copy under public_tld would duplicate the configerator
38+
# Thrift URI, so sync the real file in the same way manifests/fboss does.
39+
fbcode/configerator/structs/neteng/fboss/thrift = configerator/structs/neteng/fboss/thrift
3540

3641
[shipit.strip]
3742
^fbcode/neteng/fboss/bgp/.*facebook.*
@@ -44,3 +49,9 @@ fbcode/fboss/common = common
4449
^fbcode/neteng/fboss/bgp/cpp/tests/NetlinkWrapperTest\.cpp
4550
^fbcode/neteng/fboss/bgp/cpp/tests/PlatformConstantBbTest\.cpp
4651
^fbcode/neteng/fboss/bgp/cpp/tests/FibEbbTest\.cpp
52+
# Only common.thrift is needed from configerator/structs/neteng/fboss/thrift;
53+
# strip the unrelated schemas the pathmap above would otherwise ship.
54+
^fbcode/configerator/structs/neteng/fboss/thrift/BUCK
55+
^fbcode/configerator/structs/neteng/fboss/thrift/package_versions\.thrift
56+
^fbcode/configerator/structs/neteng/fboss/thrift/platform_npi_stage\.thrift
57+
^fbcode/configerator/structs/neteng/fboss/thrift/sdk\.thrift

0 commit comments

Comments
 (0)