Commit 23343a9
Elide stats_facebook from the stats crate in pure-glue
Summary:
Drop the C++ `stats_facebook` backend from `common/rust/shed/stats` in a pure-`glue` build, so a `glue_mode[glue]` ancestor (clippy's `:clippy-glue` / `:clippy_cli`) sheds the fb303 `ServiceData` C++ closure — the runtime-closure win motivating the migration. Glue routing comes from the `stats_glue_backend` factory the consumer registers; this diff is what lets that build link no C++.
Backward-compatible and opt-in: with no `glue_mode` modifier (every existing consumer) the `select()`s resolve to `DEFAULT` — `stats_facebook` stays and no `--cfg` is set — so behavior is unchanged.
- `BUCK`: a `glue_mode[glue]` `select()` sets `--cfg=glue_mode="glue"`, and a second drops `//common/rust/shed/stats/facebook:stats_facebook` from `deps` (kept via `DEFAULT`). No `--check-cfg` is needed — the buck toolchain doesn't run strict cfg-checking, so the cfg is set without a declaration (verified: both modes build warning-free).
- `src/lib.rs`: the only two `stats_facebook` references (`get_default_stats_manager_factory`, `create_singleton_counter`) get a `glue_mode = "glue"` arm routing to the existing no-op, mirroring the `not(fbcode_build)` path.
- `Cargo.toml` (+ autocargo manifest): declare `glue_mode` in the OSS `unexpected_cfgs` check-cfg so the cargo build doesn't warn on the new arms (cargo, unlike buck, runs that lint).
Pure-`glue` clippy (`:clippy-glue`) builds green with this; `inproc` / `inproc_and_glue` are untouched.
Reviewed By: mzlee
Differential Revision: D109851332
fbshipit-source-id: 337fee736173f694e6690ab2751ed312a491bbe61 parent 8de131b commit 23343a9
3 files changed
Lines changed: 22 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
32 | | - | |
33 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
0 commit comments