Skip to content

Commit 229cd95

Browse files
kkolur76meta-codesync[bot]
authored andcommitted
Replace os_deps with selects in deps field [16 / ?]
Summary: Migrate all os_deps and test_os_deps usages in fbcode/eden to use select() in the deps/test_deps fields instead. This follows the pattern: - Remove os_deps/test_os_deps field - Add select() to the corresponding deps/test_deps field - Use "DEFAULT": [] for the fallback case - OS mappings: "linux" -> "ovr_config//os:linux", "macos" -> "ovr_config//os:macos", "windows" -> "ovr_config//os:windows" For the fs_channel_types target, the fuse_kernel dependency was moved to exported_deps since FsChannelTypes.h is a public header that includes the fuse_kernel header. Reviewed By: dtolnay Differential Revision: D92407462 fbshipit-source-id: f1e2aef5dc84a0e895b24ec3b2959f0955b4ae18
1 parent 2626222 commit 229cd95

20 files changed

Lines changed: 320 additions & 282 deletions

File tree

eden/fs/inodes/BUCK

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,6 @@ cpp_library(
131131
"VirtualInode.h",
132132
"VirtualInodeLoader.h",
133133
],
134-
os_deps = [
135-
(
136-
"linux",
137-
[
138-
"//eden/fs/inodes/lmdbcatalog:buffered_lmdb_inode_catalog",
139-
"//eden/fs/inodes/lmdbcatalog:lmdb_inode_catalog",
140-
"//eden/fs/inodes/lmdbcatalog:lmdb_file_content_store",
141-
"//eden/fs/inodes/fscatalog:fsinodecatalog",
142-
],
143-
),
144-
(
145-
"macos",
146-
[
147-
"//eden/fs/inodes/lmdbcatalog:buffered_lmdb_inode_catalog",
148-
"//eden/fs/inodes/lmdbcatalog:lmdb_inode_catalog",
149-
"//eden/fs/inodes/lmdbcatalog:lmdb_file_content_store",
150-
"//eden/fs/inodes/fscatalog:fsinodecatalog",
151-
],
152-
),
153-
],
154134
deps = [
155135
"fbsource//third-party/cpptoml:cpptoml",
156136
"fbsource//third-party/fmt:fmt",
@@ -201,7 +181,21 @@ cpp_library(
201181
"//folly/system:pid",
202182
"//folly/system:thread_name",
203183
"//thrift/lib/cpp2/protocol:protocol",
204-
],
184+
] + select({
185+
"DEFAULT": [],
186+
"ovr_config//os:linux": [
187+
"//eden/fs/inodes/fscatalog:fsinodecatalog",
188+
"//eden/fs/inodes/lmdbcatalog:buffered_lmdb_inode_catalog",
189+
"//eden/fs/inodes/lmdbcatalog:lmdb_file_content_store",
190+
"//eden/fs/inodes/lmdbcatalog:lmdb_inode_catalog",
191+
],
192+
"ovr_config//os:macos": [
193+
"//eden/fs/inodes/fscatalog:fsinodecatalog",
194+
"//eden/fs/inodes/lmdbcatalog:buffered_lmdb_inode_catalog",
195+
"//eden/fs/inodes/lmdbcatalog:lmdb_file_content_store",
196+
"//eden/fs/inodes/lmdbcatalog:lmdb_inode_catalog",
197+
],
198+
}),
205199
exported_deps = [
206200
":fs_channel",
207201
":inode_metadata",

eden/fs/monitor/BUCK

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ cpp_library(
3434
"ovr_config//os:linux",
3535
"ovr_config//os:macos",
3636
],
37-
os_deps = [
38-
(
39-
"linux",
40-
[
41-
"third-party//systemd:systemd",
42-
],
43-
),
44-
],
4537
deps = [
4638
"fbsource//third-party/fmt:fmt",
4739
"//eden/fs/config:config",
@@ -59,7 +51,12 @@ cpp_library(
5951
"//folly/logging:logging",
6052
"//folly/portability:sys_stat",
6153
"//thrift/lib/cpp2/async:header_client_channel",
62-
],
54+
] + select({
55+
"DEFAULT": [],
56+
"ovr_config//os:linux": [
57+
"third-party//systemd:systemd",
58+
],
59+
}),
6360
exported_deps = [
6461
"fbsource//third-party/googletest:gtest",
6562
"fbsource//third-party/googletest:gtest_headers",

eden/fs/notifications/BUCK

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ cpp_library(
5858
name = "windows_notifier",
5959
srcs = ["WindowsNotifier.cpp"],
6060
headers = ["WindowsNotifier.h"],
61-
os_deps = [
62-
(
63-
"windows",
64-
[
65-
"fbsource//third-party/toolchains/win:ComCtl32.Lib",
66-
"fbsource//third-party/toolchains/win:shell32.lib",
67-
],
68-
),
69-
],
7061
os_linker_flags = [
7162
(
7263
"windows",
@@ -84,7 +75,13 @@ cpp_library(
8475
"//eden/fs/telemetry:log_info",
8576
"//folly/futures:core",
8677
"//folly/portability:windows",
87-
],
78+
] + select({
79+
"DEFAULT": [],
80+
"ovr_config//os:windows": [
81+
"fbsource//third-party/toolchains/win:ComCtl32.Lib",
82+
"fbsource//third-party/toolchains/win:shell32.lib",
83+
],
84+
}),
8885
exported_deps = [
8986
":notifier",
9087
"//eden/common/utils:utils",

eden/fs/privhelper/BUCK

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ cpp_library(
6161
"PrivHelperServerSanityCheck.cpp",
6262
],
6363
headers = ["PrivHelperServer.h"],
64-
os_deps = [
65-
(
66-
"macos",
67-
[
68-
"fbsource//third-party/osxfuse:osxfuse",
69-
"fbsource//third-party/toolchains/macos:CoreFoundation",
70-
"fbsource//third-party/toolchains/macos:IOKit",
71-
],
72-
),
73-
],
7464
deps = [
7565
":nfs_rpc",
7666
"//eden/common/utils:errno_utils",
@@ -94,7 +84,14 @@ cpp_library(
9484
"//folly/logging:logging",
9585
"//folly/portability:unistd",
9686
"//folly/system:thread_name",
97-
],
87+
] + select({
88+
"DEFAULT": [],
89+
"ovr_config//os:macos": [
90+
"fbsource//third-party/osxfuse:osxfuse",
91+
"fbsource//third-party/toolchains/macos:CoreFoundation",
92+
"fbsource//third-party/toolchains/macos:IOKit",
93+
],
94+
}),
9895
exported_deps = [
9996
":conn",
10097
"//eden/common/utils:io",

eden/fs/privhelper/priority/BUCK

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,15 @@ cpp_library(
4242
name = "process_priority",
4343
srcs = ["ProcessPriority.cpp"],
4444
headers = ["ProcessPriority.h"],
45-
os_deps = [
46-
(
47-
"linux",
48-
[":linux_memory_priority"],
49-
),
50-
(
51-
"macos",
52-
[":darwin_memory_priority"],
53-
),
54-
],
5545
deps = [
5646
":darwin_memory_priority",
5747
":linux_memory_priority",
5848
"//folly/logging:logging",
59-
],
49+
] + select({
50+
"DEFAULT": [],
51+
"ovr_config//os:linux": [":linux_memory_priority"],
52+
"ovr_config//os:macos": [":darwin_memory_priority"],
53+
}),
6054
exported_deps = [
6155
":memory_priority",
6256
"//folly:portability",

eden/fs/prjfs/BUCK

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ cpp_library(
2020
"PrjfsDispatcher.h",
2121
"PrjfsRequestContext.h",
2222
],
23-
os_deps = [
24-
(
25-
"windows",
26-
["fbsource//third-party/toolchains/win:ProjectedFSLib.lib"],
27-
),
28-
],
2923
deps = [
3024
"fbsource//third-party/fmt:fmt",
3125
"//eden/common/telemetry:structured_logger",
@@ -42,7 +36,10 @@ cpp_library(
4236
"//folly/executors:global_executor",
4337
"//folly/executors:serial_executor",
4438
"//folly/logging:logging",
45-
],
39+
] + select({
40+
"DEFAULT": [],
41+
"ovr_config//os:windows": ["fbsource//third-party/toolchains/win:ProjectedFSLib.lib"],
42+
}),
4643
exported_deps = [
4744
"//eden/common/telemetry:telemetry",
4845
"//eden/common/utils:immediate_future",

eden/fs/py/eden/thrift/BUCK

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ python_library(
66
name = "legacy",
77
srcs = ["legacy.py"],
88
base_module = "eden.thrift",
9-
os_deps = [
10-
(
11-
"windows",
12-
[":windows_thrift"],
13-
),
14-
],
159
deps = [
1610
"//eden/fs/service:thrift-py-deprecated",
1711
"//thrift/lib/py:base",
1812
"//thrift/lib/py:server_base",
19-
],
13+
] + select({
14+
"DEFAULT": [],
15+
"ovr_config//os:windows": [":windows_thrift"],
16+
}),
2017
)
2118

2219
python_library(

eden/fs/service/BUCK

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ cpp_library(
1313
srcs = [
1414
"EdenMain.cpp",
1515
],
16-
os_deps = [
17-
(
18-
"linux",
19-
[
20-
"//eden/fs/store/git:git",
21-
],
22-
),
23-
],
2416
deps = [
2517
":init",
2618
":startup_logger",
@@ -54,7 +46,12 @@ cpp_library(
5446
"//folly/portability:unistd",
5547
"//thrift/lib/cpp2:flags",
5648
"//thrift/lib/cpp2:server",
57-
],
49+
] + select({
50+
"DEFAULT": [],
51+
"ovr_config//os:linux": [
52+
"//eden/fs/store/git:git",
53+
],
54+
}),
5855
exported_deps = [
5956
":server",
6057
"//eden/fs/store:backing_store_interface",
@@ -76,25 +73,6 @@ cpp_binary(
7673
"/STACK:2097152", # This was picked arbitrarily as 2 MB
7774
],
7875
}),
79-
os_deps = [
80-
(
81-
"linux",
82-
[
83-
"//eden/fs/store/facebook/http:http",
84-
"//eden/fs/store/facebook/recas:recas",
85-
"//eden/fs/telemetry/facebook:activity_recorder",
86-
"//eden/fs/telemetry/facebook:scribe_logger",
87-
"//services_efficiency/heap:init",
88-
],
89-
),
90-
(
91-
"macos",
92-
[
93-
"//eden/fs/telemetry/facebook:activity_recorder",
94-
"//eden/fs/telemetry/facebook:scribe_logger",
95-
],
96-
),
97-
],
9876
deps = [
9977
":main",
10078
":server",
@@ -116,7 +94,20 @@ cpp_binary(
11694
"//folly:range",
11795
"//folly/logging:init",
11896
"//thrift/lib/cpp2:server",
119-
],
97+
] + select({
98+
"DEFAULT": [],
99+
"ovr_config//os:linux": [
100+
"//eden/fs/store/facebook/http:http",
101+
"//eden/fs/store/facebook/recas:recas",
102+
"//eden/fs/telemetry/facebook:activity_recorder",
103+
"//eden/fs/telemetry/facebook:scribe_logger",
104+
"//services_efficiency/heap:init",
105+
],
106+
"ovr_config//os:macos": [
107+
"//eden/fs/telemetry/facebook:activity_recorder",
108+
"//eden/fs/telemetry/facebook:scribe_logger",
109+
],
110+
}),
120111
)
121112

122113
cpp_binary(
@@ -327,20 +318,6 @@ cpp_library(
327318
"PeriodicTask.cpp",
328319
"ThriftPermissionChecker.cpp",
329320
],
330-
os_deps = [
331-
(
332-
"macos",
333-
[
334-
"//folly:subprocess",
335-
],
336-
),
337-
(
338-
"windows",
339-
[
340-
"//eden/fs/notifications:windows_notifier",
341-
],
342-
),
343-
],
344321
deps = [
345322
"fbsource//third-party/cpptoml:cpptoml",
346323
"fbsource//third-party/fmt:fmt",
@@ -427,7 +404,15 @@ cpp_library(
427404
"//thrift/lib/cpp2/server:cpp2_conn_context",
428405
"//thrift/lib/cpp2/server:parallel_concurrency_controller",
429406
"//thrift/lib/cpp2/server:round_robin_request_pile",
430-
],
407+
] + select({
408+
"DEFAULT": [],
409+
"ovr_config//os:macos": [
410+
"//folly:subprocess",
411+
],
412+
"ovr_config//os:windows": [
413+
"//eden/fs/notifications:windows_notifier",
414+
],
415+
}),
431416
exported_deps = [
432417
":thrift-cpp2-types",
433418
":thrift-streaming-cpp2-services",

eden/fs/store/filter/BUCK

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ cpp_library(
6161
"//eden/fs/model:model",
6262
"//eden/fs/service:thrift_util",
6363
"//folly/futures:core",
64-
],
64+
] + select({
65+
"DEFAULT": [],
66+
"ovr_config//os:windows": ["fbsource//third-party/rust:cxx"],
67+
}),
6568
exported_deps = [
6669
"fbsource//third-party/rust:cxx-core",
6770
":filters",

eden/fs/utils/BUCK

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,16 @@ cpp_library(
3232
headers = [
3333
"WinStackTrace.h",
3434
],
35-
os_deps = [
36-
(
37-
"windows",
38-
["fbsource//third-party/toolchains/win:dbghelp.lib"],
39-
),
40-
],
4135
deps = [
4236
"//eden/common/utils:path",
4337
"//eden/common/utils:stringconv",
4438
"//eden/common/utils/windows:win_error",
4539
"//folly:c_portability",
4640
"//folly/portability:windows",
47-
],
41+
] + select({
42+
"DEFAULT": [],
43+
"ovr_config//os:windows": ["fbsource//third-party/toolchains/win:dbghelp.lib"],
44+
}),
4845
)
4946

5047
cpp_library(
@@ -275,19 +272,13 @@ cpp_library(
275272
cpp_library(
276273
name = "fs_channel_types",
277274
headers = ["FsChannelTypes.h"],
278-
os_deps = [
279-
(
280-
"linux",
281-
["//eden/fs/third-party:fuse_kernel"],
282-
),
283-
(
284-
"macos",
285-
["//eden/fs/third-party:fuse_kernel"],
286-
),
287-
],
288275
exported_deps = [
289276
"//folly:file",
290-
],
277+
] + select({
278+
"DEFAULT": [],
279+
"ovr_config//os:linux": ["//eden/fs/third-party:fuse_kernel"],
280+
"ovr_config//os:macos": ["//eden/fs/third-party:fuse_kernel"],
281+
}),
291282
)
292283

293284
cpp_library(

0 commit comments

Comments
 (0)