Skip to content

Commit a00e44d

Browse files
kkolur76meta-codesync[bot]
authored andcommitted
Replace os_deps with selects in deps field [27 / ?]
Summary: Migrate os_deps parameter usages to select statements in deps for ~23 instances in various directories. The os_deps parameter is being deprecated in favor of using select() with ovr_config//os: constraints directly in the deps parameter. For cpp_library targets, os_deps maps to exported_deps (not deps), so the select() was placed in exported_deps for those targets. Files modified: - fbcode/testinfra/tpx/tpx-core/BUCK - fbcode/testinfra/tpx/tpx-fb/BUCK - fbcode/testinfra/tpx/wwwtpx/BUCK - fbcode/testinfra/tpx/wwwtpx_cli/BUCK - fbcode/testinfra/utils/BUCK - fbcode/velox/common/process/BUCK (2 instances) - fbcode/virt/perfsuite/metadata/fetcher/BUCK - fbcode/virt/perfsuite/runner/BUCK - fbcode/vscode_native/BUCK - fbcode/watchman/BUCK (4 instances) - fbcode/watchman/cli/BUCK - fbcode/watchman/cppclient/BUCK - fbcode/watchman/portability/BUCK (2 instances) - fbcode/watchman/rust/watchman_client/BUCK - fbcode/watchman/saved_state/BUCK - fbcode/watchman/thirdparty/deelevate_binding/BUCK Reviewed By: dtolnay Differential Revision: D92516634 fbshipit-source-id: 540b4483cef558edf535a77a3645ea281ce5328e
1 parent 0f1208d commit a00e44d

File tree

7 files changed

+178
-110
lines changed

7 files changed

+178
-110
lines changed

watchman/BUCK

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,6 @@ cpp_library(
471471
headers = [
472472
"watchman_stream.h",
473473
],
474-
os_deps = [
475-
(
476-
"windows",
477-
[
478-
"//eden/common/utils/windows:win_util",
479-
],
480-
),
481-
],
482474
deps = [
483475
":config",
484476
":logging",
@@ -489,7 +481,12 @@ cpp_library(
489481
],
490482
exported_deps = [
491483
"//watchman/fs:fd",
492-
],
484+
] + select({
485+
"DEFAULT": [],
486+
"ovr_config//os:windows": [
487+
"//eden/common/utils/windows:win_util",
488+
],
489+
}),
493490
)
494491

495492
cpp_library(
@@ -656,15 +653,6 @@ cpp_library(
656653
name = "userdir",
657654
srcs = ["UserDir.cpp"],
658655
headers = ["UserDir.h"],
659-
os_deps = [
660-
(
661-
"windows",
662-
[
663-
"fbsource//third-party/toolchains/win:shell32.lib",
664-
"fbsource//third-party/toolchains/win:ole32.lib",
665-
],
666-
),
667-
],
668656
deps = [
669657
"fbsource//third-party/fmt:fmt",
670658
":logging",
@@ -675,6 +663,13 @@ cpp_library(
675663
"//watchman/fs:fs",
676664
"//watchman/portability:winerror",
677665
],
666+
exported_deps = select({
667+
"DEFAULT": [],
668+
"ovr_config//os:windows": [
669+
"fbsource//third-party/toolchains/win:ole32.lib",
670+
"fbsource//third-party/toolchains/win:shell32.lib",
671+
],
672+
}),
678673
)
679674

680675
cpp_library(
@@ -843,15 +838,6 @@ cpp_library(
843838
# static tables of things. Ensure that they don't get stripped
844839
# out of the final binary!
845840
link_whole = True,
846-
os_deps = [
847-
(
848-
"macos",
849-
[
850-
"fbsource//third-party/toolchains/macos:CoreFoundation",
851-
"fbsource//third-party/toolchains/macos:CoreServices",
852-
],
853-
),
854-
],
855841
deps = [
856842
"fbsource//third-party/cpptoml:cpptoml",
857843
":child_process",
@@ -916,7 +902,13 @@ cpp_library(
916902
"//watchman/fs:fs",
917903
"//watchman/telemetry:telemetry",
918904
"//watchman/thirdparty/jansson:jansson",
919-
],
905+
] + select({
906+
"DEFAULT": [],
907+
"ovr_config//os:macos": [
908+
"fbsource//third-party/toolchains/macos:CoreFoundation",
909+
"fbsource//third-party/toolchains/macos:CoreServices",
910+
],
911+
}),
920912
)
921913

922914
cpp_library(
@@ -936,16 +928,6 @@ cpp_binary(
936928
"ProcessLock.cpp",
937929
"main.cpp",
938930
],
939-
os_deps = [
940-
(
941-
"linux",
942-
["//watchman/facebook/saved_state:manifold_saved_state"],
943-
),
944-
(
945-
"windows",
946-
["//watchman/thirdparty/deelevate_binding:deelevate_binding"],
947-
),
948-
],
949931
deps = [
950932
"fbsource//third-party/fmt:fmt",
951933
":child_process",
@@ -976,7 +958,15 @@ cpp_binary(
976958
"//folly/system:shell",
977959
"//watchman/fs:fd",
978960
"//watchman/fs:fs",
979-
],
961+
] + select({
962+
"DEFAULT": [],
963+
"ovr_config//os:linux": [
964+
"//watchman/facebook/saved_state:manifold_saved_state",
965+
],
966+
"ovr_config//os:windows": [
967+
"//watchman/thirdparty/deelevate_binding:deelevate_binding",
968+
],
969+
}),
980970
)
981971

982972
python_unittest(

watchman/cli/BUCK

Lines changed: 106 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,104 @@ rust_binary(
1010
"name": "watchmanctl",
1111
},
1212
"cargo_toml_config": {
13+
"dependencies_override": {
14+
"dependencies": {
15+
"ahash": {
16+
"features": ["runtime-rng"],
17+
"version": "0.8.11",
18+
},
19+
"anyhow": {"version": "1.0.98"},
20+
"duct": {"version": "0.13.6"},
21+
"jwalk": {"version": "0.8.1"},
22+
"serde": {
23+
"features": [
24+
"derive",
25+
"rc",
26+
],
27+
"version": "1.0.219",
28+
},
29+
"serde_json": {
30+
"features": [
31+
"alloc",
32+
"float_roundtrip",
33+
"raw_value",
34+
"unbounded_depth",
35+
],
36+
"version": "1.0.140",
37+
},
38+
"structopt": {"version": "0.3.26"},
39+
"sysinfo": {"version": "0.35.1"},
40+
"tabular": {"version": "0.2.0"},
41+
"tokio": {
42+
"features": [
43+
"full",
44+
"test-util",
45+
"tracing",
46+
],
47+
"version": "1.47.1",
48+
},
49+
},
50+
"target": {
51+
"'cfg(target_os = \"linux\")'": {
52+
"dependencies": {
53+
"nix": {
54+
"features": [
55+
"dir",
56+
"event",
57+
"hostname",
58+
"inotify",
59+
"ioctl",
60+
"mman",
61+
"mount",
62+
"net",
63+
"poll",
64+
"ptrace",
65+
"reboot",
66+
"resource",
67+
"sched",
68+
"signal",
69+
"term",
70+
"time",
71+
"user",
72+
"zerocopy",
73+
],
74+
"version": "0.30.1",
75+
},
76+
},
77+
},
78+
"'cfg(target_os = \"macos\")'": {
79+
"dependencies": {
80+
"nix": {
81+
"features": [
82+
"dir",
83+
"event",
84+
"hostname",
85+
"inotify",
86+
"ioctl",
87+
"mman",
88+
"mount",
89+
"net",
90+
"poll",
91+
"ptrace",
92+
"reboot",
93+
"resource",
94+
"sched",
95+
"signal",
96+
"term",
97+
"time",
98+
"user",
99+
"zerocopy",
100+
],
101+
"version": "0.30.1",
102+
},
103+
},
104+
},
105+
},
106+
},
13107
"extra_buck_dependencies": {
108+
"dependencies": [
109+
"//watchman/rust/watchman_client:watchman_client",
110+
],
14111
"target": {
15112
"'cfg(unix)'": {
16113
"dependencies": [
@@ -28,20 +125,6 @@ rust_binary(
28125
features = [
29126
"fb",
30127
],
31-
os_deps = [
32-
(
33-
"linux",
34-
[
35-
"fbsource//third-party/rust:nix",
36-
],
37-
),
38-
(
39-
"macos",
40-
[
41-
"fbsource//third-party/rust:nix",
42-
],
43-
),
44-
],
45128
deps = [
46129
"fbsource//third-party/rust:ahash",
47130
"fbsource//third-party/rust:anyhow",
@@ -54,5 +137,13 @@ rust_binary(
54137
"fbsource//third-party/rust:tabular",
55138
"fbsource//third-party/rust:tokio",
56139
"//watchman/rust/watchman_client:watchman_client",
57-
],
140+
] + select({
141+
"DEFAULT": [],
142+
"ovr_config//os:linux": [
143+
"fbsource//third-party/rust:nix",
144+
],
145+
"ovr_config//os:macos": [
146+
"fbsource//third-party/rust:nix",
147+
],
148+
}),
58149
)

watchman/cppclient/BUCK

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,6 @@ cpp_library(
2525
"WatchmanClient.h",
2626
"WatchmanConnection.h",
2727
],
28-
os_deps = [
29-
(
30-
"windows",
31-
[
32-
"//eden/common/utils:process",
33-
],
34-
),
35-
(
36-
"linux",
37-
[
38-
"//folly:subprocess",
39-
],
40-
),
41-
(
42-
"macos",
43-
[
44-
"//folly:subprocess",
45-
],
46-
),
47-
],
4828
deps = [
4929
"fbsource//third-party/fmt:fmt",
5030
"//folly:network_address",
@@ -61,7 +41,18 @@ cpp_library(
6141
"//folly/io/async:async_base",
6242
"//folly/io/async:async_socket",
6343
"//folly/json:dynamic",
64-
],
44+
] + select({
45+
"DEFAULT": [],
46+
"ovr_config//os:linux": [
47+
"//folly:subprocess",
48+
],
49+
"ovr_config//os:macos": [
50+
"//folly:subprocess",
51+
],
52+
"ovr_config//os:windows": [
53+
"//eden/common/utils:process",
54+
],
55+
}),
6556
external_deps = [
6657
"glog",
6758
],

watchman/portability/BUCK

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ cpp_library(
66
name = "backtrace",
77
srcs = ["Backtrace.cpp"],
88
headers = ["Backtrace.h"],
9-
os_deps = [
10-
(
11-
"windows",
12-
["fbsource//third-party/toolchains/win:dbghelp.lib"],
13-
),
14-
],
9+
exported_deps = select({
10+
"DEFAULT": [],
11+
"ovr_config//os:windows": [
12+
"fbsource//third-party/toolchains/win:dbghelp.lib",
13+
],
14+
}),
1515
)
1616

1717
cpp_library(
1818
name = "getopt",
1919
headers = ["GetOpt.h"],
20-
os_deps = [
21-
(
22-
"windows",
23-
["//watchman/thirdparty/getopt:getopt"],
24-
),
25-
],
20+
exported_deps = select({
21+
"DEFAULT": [],
22+
"ovr_config//os:windows": [
23+
"//watchman/thirdparty/getopt:getopt",
24+
],
25+
}),
2626
)
2727

2828
cpp_library(

watchman/rust/watchman_client/BUCK

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ oncall("scm_client_infra")
66
rust_library(
77
name = "watchman_client",
88
srcs = glob(["src/**/*.rs"]),
9-
os_deps = [
10-
(
11-
"windows",
12-
["fbsource//third-party/rust:winapi"],
13-
),
14-
],
159
preferred_linkage = "static",
1610
deps = [
1711
"fbsource//third-party/rust:anyhow",
@@ -23,7 +17,12 @@ rust_library(
2317
"fbsource//third-party/rust:tokio",
2418
"fbsource//third-party/rust:tokio-util",
2519
"//watchman/rust/serde_bser:serde_bser",
26-
],
20+
] + select({
21+
"DEFAULT": [],
22+
"ovr_config//os:windows": [
23+
"fbsource//third-party/rust:winapi",
24+
],
25+
}),
2726
)
2827

2928
rust_binary(

0 commit comments

Comments
 (0)