forked from facebook/buck2-prelude
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genrule_local_labels.bzl
233 lines (168 loc) · 6.57 KB
/
genrule_local_labels.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.
"""
Handle labels used to opt-out genrules from running remotely.
"""
# Some rules have to be run locally for various reasons listed next to the label.
_GENRULE_LOCAL_LABELS = {label: True for label in [
# Used for buck2 tests that want to run locally
"buck2_test_local_exec",
# Split dwarf merge rules currently don't properly list their inputs.
"dwp",
# Bolt and hottext post-processing rules operate on a large statically
# linked binary which contains non-deterministic build info, meaning its
# a) currently too large for RE to handle and b) caching it would only
# waste cache space.
"postprocess_bolt",
"postprocess_hottext",
# The iOS build needs to run a genrule locally to gather non-deterministic
# build info from `hg`.
"non_deterministic_build_info",
# Some call "buck run" & "buck root" recursively.
"uses_buck_run",
# Some antlir and telephoto genrules use clowder for downloading from everstore
"uses_clowder",
# Some antlir genrules use cpio for unpacking rpms
"uses_cpio",
# Creates secondary Eden repos outside of `buck-out/`
"uses_eden_mounts",
# The Antlir core compiler uses sudo
"uses_sudo",
# Some rules utilize hg for some reason as part of code generation
"uses_hg",
# Dotslash is not yet supported on RE.
"uses_dotslash",
# Some rules apply a patch which is not on RE.
"uses_patch",
# Directly uses the smcc binary which is not on RE.
"uses_smcc",
# Uses shasum which is not on RE.
"uses_shasum",
# Uses xz which is not on RE.
"uses_xz",
# Uses tw tool which is not on RE.
"uses_tw",
# Uses thrift tool which is not on RE.
"uses_thrift",
# Uses protoc tool which is not on RE.
"uses_protoc",
# Yarn installs use a large in-repo yarn repo that's ~6.1GB at the time of
# writing, and so v1 uses workarounds (D17359502) to avoid the overhead this
# would causes. So, run these rules locally to maintain compatibility and
# until we have a better yarn solution.
"yarn_install",
# Non-deterministic builds that depend on data from configerator.
"reads_configerator",
# Third party java artifacts are stored in manifold and therefore can't be accessed from RE worker.
"third_party_java",
# The antlir package-at-build-time rules current rely on tools like hg/git,
# which don't work on RE.
"antlir_macros",
# UPM codegen does lots of network I/O (e.g. scuba, JK, configerator), which
# makes it fail on RE.
"upm_binary_gen",
# PHP isn't available in RE or in our repos so, for now, we run them locally
# (https://fb.workplace.com/groups/1042353022615812/posts/1849505965233843/).
"uses_php",
# Uses the `libX11-devel` package which is not available on RE.
"uses_x11",
# Unity license client needs to be set up on RE workers for this to work, and maybe further debugging.
"uses_unity",
# mksquashfs isn't available in RE, so run these locally
# (https://fb.workplace.com/groups/buck2users/permalink/3023630007893360/)
"uses_mksquashfs",
# PXL rules can't yet run on RE.
"pxl",
# Accesses dewey
"uses_dewey",
# Accesses justknobs configuration
"justknobs",
# Side effecting writes directly into buck-out on the local
# filesystem
"writes_to_buck_out",
# Calculates and writes absolute paths in the local filesystem
"uses_local_filesystem_abspaths",
# Use local GPUs with latest Nvidia libs which are not available in RE yet
"uses_lower_locally",
# Uses fbpkg outside of the repo
"uses_fbpkg",
# Makes recursive calls to buck
"uses_buck",
# Uses files in the repo that it doesn't declare as dependencies
"uses_undeclared_inputs",
# Connects to service router which won't work on RE
"uses_service_router",
# Downloads direct from manifold
"uses_manifold",
# When run on RE produces "Cache is out of space" (excessive disk/memory)
"re_cache_out_of_space",
# HHVM Post-link rules need to be local since the binary is huge.
"hhvm_postlink",
# Uses network access (unspecified what as of yet)
"network_access",
# Uses clang format which is not in RE
"uses_clang_format",
# Perform makes compilation in situ.
"uses_make",
# Like it says in the label
"uses_mkscratch",
# Locally built toolchains which do not exist on RE
"toolchain_testing",
# sphinx_wiki always needs to run locally
"sphinx_wiki",
# Uses R (which is feature gated) pending RE support
"uses_rlang",
# Uses watchman which is not in RE
"uses_watchman",
# Uses yumdownloader which is not in RE
"yumdownloader",
# Uses locally installed mvn.
"uses_maven",
# Some Qt genrules don't support RE yet
"qt_moc",
"qt_qmlcachegen",
"qt_qrc_compile",
"qt_qrc_gen",
"qt_qsb_gen",
"qt_rcc",
"qt_uic",
# use local jar
"uses_jar",
# uses local java
"uses_java",
#use locally installed svnyum
"uses_svnyum",
# uses ruby
"uses_ruby",
# Produces an output symlink, and since Meta RE doesn't support returning
# output symlinks (yet?), and sometimes the output symlink also cannot be
# dereferenced anyway (e.g. because it violates security policies or simply
# points to something that does not exist).
"dangling_output_symlink",
# Uses xcrun which is not in RE (e.g. compile metalshaders)
"uses_xcrun",
# speech translation uses genrule to get models from manifold, high priority project
"speech_translation_high_priority",
# Uses Apple's codesign command which might not be in RE
"uses_codesign",
# Uses jf which is not on RE
"uses_jf",
# On Messenger Desktop few targets are massive and take much longer on RE than
# locally to build on Windows. This is a mitigation until we can break down these
# targets
"zeratul_windows_capacity_hog",
# Uses fakeroot which is not on RE
"uses_fakeroot",
# The compilation databases produced by Buck have paths relative to the root of
# fbsource. This isn't compatible with RE.
"uses_compilation_database",
]}
def genrule_labels_require_local(labels):
for label in labels:
if label in _GENRULE_LOCAL_LABELS:
return True
return False