forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pants.toml
482 lines (418 loc) · 14.1 KB
/
pants.toml
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# All of the following are seeded with defaults in the config
# user: the current user
# homedir: the current user's home directory
# buildroot: the root of this repo
# pants_bootstrapdir: the global pants scratch space primarily used for caches
# pants_configdir: the global pants storage for config files
# pants_supportdir: pants support files for this repo go here; for example: ivysettings.xml
# pants_distdir: user visible artifacts for this repo go here
# pants_workdir: the scratch space used to for live builds in this repo
# [DEFAULT] should only contain variables to be used later in this config or
# options not in global scope but available in certain subsystems or tasks.
[DEFAULT]
# TODO: Still needed until we migrate jvm tools to subsystems.
jvm_options = ["-Xmx1g"]
local_artifact_cache = "%(pants_bootstrapdir)s/artifact_cache"
# [GLOBAL] should only contain valid options in global scope.
[GLOBAL]
print_exception_stacktrace = true
v2 = false
# Enable our own custom loose-source plugins as well as contribs.
pythonpath = [
"%(buildroot)s/contrib/avro/src/python",
"%(buildroot)s/contrib/awslambda/python/src/python",
"%(buildroot)s/contrib/buildrefactor/src/python",
"%(buildroot)s/contrib/codeanalysis/src/python",
"%(buildroot)s/contrib/cpp/src/python",
"%(buildroot)s/contrib/confluence/src/python",
"%(buildroot)s/contrib/errorprone/src/python",
"%(buildroot)s/contrib/findbugs/src/python",
"%(buildroot)s/contrib/go/src/python",
"%(buildroot)s/contrib/googlejavaformat/src/python",
"%(buildroot)s/contrib/jax_ws/src/python",
"%(buildroot)s/contrib/mypy/src/python",
"%(buildroot)s/contrib/node/src/python",
"%(buildroot)s/contrib/python/src/python",
"%(buildroot)s/contrib/scalajs/src/python",
"%(buildroot)s/contrib/scrooge/src/python",
"%(buildroot)s/contrib/thrifty/src/python",
"%(buildroot)s/pants-plugins/src/python",
]
backend_packages.add = [
"pants.backend.docgen",
"pants.contrib.avro",
"pants.contrib.awslambda.python",
"pants.contrib.buildrefactor",
"pants.contrib.codeanalysis",
"pants.contrib.cpp",
"pants.contrib.confluence",
"pants.contrib.errorprone",
"pants.contrib.findbugs",
"pants.contrib.go",
"pants.contrib.googlejavaformat",
"pants.contrib.jax_ws",
"pants.contrib.scalajs",
"pants.contrib.node",
"pants.contrib.python.checks",
"pants.contrib.scrooge",
"pants.contrib.thrifty",
"internal_backend.repositories",
"internal_backend.sitegen",
"internal_backend.utilities",
]
backend_packages.remove = [
# We use the V2 isort implementation.
"pants.backend.python.lint.isort",
]
backend_packages2 = [
"pants.backend.project_info",
"pants.backend.python",
"pants.backend.python.lint.black",
"pants.backend.python.lint.docformatter",
"pants.backend.python.lint.isort",
"pants.backend.native",
"internal_backend.rules_for_testing",
]
# The pants script in this repo consumes these files to run pants
pantsd_invalidation_globs.add = ["src/python/**/*.py"]
# Path patterns to ignore for filesystem operations on top of the builtin patterns.
pants_ignore.add = [
# venv directories under build-support.
"/build-support/virtualenvs/",
"/build-support/*.venv/",
# An absolute symlink to the Pants Rust toolchain sources.
"/build-support/bin/native/src",
]
[cache]
# Caching is on globally by default, but we disable it here for development purposes.
# It is explicitly re-enabled below for [cache.bootstrap] only.
read_from = []
write_to = []
[cache.bootstrap]
# The just-in-time tool shading performed by jvm tool bootstrapping is very expensive, so we turn
# on artifact caching for it that can survive clean-all.
read_from = ["%(local_artifact_cache)s"]
write_to = ["%(local_artifact_cache)s"]
[ivy]
# A custom ivysettings.xml file to allow for consumption from a local .m2 repository.
# If you don't need access to a local .m2 repository, remove this setting to use the default.
ivy_settings = "%(pants_supportdir)s/ivy/ivysettings.xml"
# We need a custom ivy profile to grab the optional pgp libs for
# signing artifacts we publish to maven central.
ivy_profile = "%(pants_supportdir)s/ivy/ivy.xml"
[gen.scrooge]
service_deps = """
{
'java': [
'3rdparty:slf4j-api',
'3rdparty:thrift',
'3rdparty/jvm/com/twitter:finagle-thrift',
'3rdparty/jvm/com/twitter:scrooge-core',
],
'scala': [
'3rdparty:thrift',
'3rdparty/jvm/com/twitter:finagle-thrift',
'3rdparty/jvm/com/twitter:scrooge-core',
],
}
"""
structs_deps = """
{
'java': [
'3rdparty:thrift',
'3rdparty/jvm/com/twitter:scrooge-core',
],
'scala': [
'3rdparty:thrift',
'3rdparty/jvm/com/twitter:scrooge-core',
],
}
"""
service_exports = """
{
'java': [
'3rdparty:thrift',
],
'scala': [
'3rdparty:thrift',
'3rdparty/jvm/com/twitter:finagle-thrift',
'3rdparty/jvm/com/twitter:scrooge-core',
],
}
"""
structs_exports = """
{
'java': [
'3rdparty:thrift',
],
'scala': [
'3rdparty:thrift',
'3rdparty/jvm/com/twitter:scrooge-core',
],
}
"""
[gen.thrift-java]
deps = ["3rdparty:thrift"]
[gen.thrift-py]
deps = ["examples/3rdparty/python:thrift"]
[gen.thrifty]
allow_dups = true
[gen.antlr-py]
antlr3_deps = ["3rdparty/python:antlr-3.1.3"]
[gen.go-protobuf]
import_target = "contrib/go/examples/src/protobuf/org/pantsbuild/example:protobuf-deps"
[compile.errorprone]
command_line_options = [
# See http://errorprone.info/bugpatterns for all patterns
'-Xep:CatchAndPrintStackTrace:OFF',
'-Xep:StringSplitter:OFF',
]
exclude_patterns = [
'contrib/errorprone/tests/java/org/pantsbuild/contrib/errorprone:error',
'testprojects/src/java/org/pantsbuild/testproject/.*'
]
[compile.findbugs]
max_rank = 4
fail_on_error = true
exclude_patterns = [
'contrib/findbugs/tests/java/org/pantsbuild/contrib/findbugs:high',
'testprojects/src/java/org/pantsbuild/testproject/.*',
]
[compile.rsc]
jvm_options = ['-Xmx4g', '-XX:+UseConcMarkSweepGC', '-XX:ParallelGCThreads=4']
args = [
# NB: See https://github.com/pantsbuild/pants/issues/3702
'-C-encoding', '-CUTF-8',
'-S-encoding', '-SUTF-8',
'-S-g:vars',
# Compiling the zinc codebase with `2.11.12` requires that scala target `JDK8`:
# this setting is a function of the fact that the libraries we're consuming require it,
# rather than anything inherent to `2.11.12`.
'-S-target:jvm-1.8',
]
warning_args = [
'-S-deprecation',
'-S-unchecked',
# request warnings for http://www.scala-lang.org/api/2.10.4/index.html#scala.language$
'-S-feature',
]
no_warning_args = [
'-S-nowarn',
]
[compile.javac]
args = [
'-encoding', 'UTF-8',
'-J-Xmx2g',
]
# javac -help -X will show the complete list
warning_args = [
'-Xlint:deprecation',
'-Xlint:empty',
'-Xlint:finally',
'-Xlint:overrides',
'-Xlint:static',
'-Xlint:unchecked',
'-Xlint:try',
]
no_warning_args = [
'-Xlint:none',
]
[black]
config = "pyproject.toml"
[checkstyle]
config = "%(pants_supportdir)s/checkstyle/coding_style.xml"
[docformatter]
args = ["--wrap-summaries=100", "--wrap-descriptions=100"]
[eslint]
setupdir = "%(pants_supportdir)s/eslint"
config = "%(pants_supportdir)s/eslint/.eslintrc"
ignore = "%(pants_supportdir)s/eslint/.eslintignore"
[google-java-format]
skip = true
[isort]
config = [".isort.cfg", "contrib/.isort.cfg", "examples/.isort.cfg"]
[python-eval]
skip = true
[scalafmt]
skip = true
[scalafix]
skip = true
[scalastyle]
config = "%(buildroot)s/build-support/scalastyle/scalastyle_config.xml"
[lint.scalastyle]
excludes = "%(buildroot)s/build-support/scalastyle/excludes.txt"
[protoc.gen.go-protobuf]
version = "3.4.1"
[pycheck-class-factoring]
skip = true
[pycheck-context-manager]
skip = true
[pycheck-import-order]
skip = true
[pycheck-indentation]
skip = true
[pycheck-newlines]
skip = true
[pycheck-newstyle-classes]
skip = true
[pycheck-pycodestyle]
skip = true
[pycheck-trailing-whitespace]
skip = true
[pycheck-variable-names]
skip = true
[scala]
version = 2.12
[java]
strict_deps = true
[jvm]
options = ["-Xmx1g"]
[jvm.bench]
options = ["-Xmx1g"]
[jvm.run.jvm]
options = ["-Xmx1g"]
[jvm.test.junit]
options = ["-Djava.awt.headless=true", "-Xmx1g"]
# NB(gmalmquist): You can set the bootclasspath relative to the
# appropriate java home (inferred from the target level) by setting
# an arg like:
# "-C-Xbootclasspath:$JAVA_HOME/jre/lib/resources.jar:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/jre/lib/sunrsasign.jar:$JAVA_HOME/jre/lib/jsse.jar:$JAVA_HOME/jre/lib/jce.jar:$JAVA_HOME/jre/lib/charsets.jar:$JAVA_HOME/jre/lib/jfr.jar:$JAVA_HOME/jre/classes"
[jvm-platform]
default_platform = "java8"
# TODO(#8669): remove `java7` once we can install openJDK 11 on the RBE docker image, which would
# allow fixing testprojects/tests/java/org/pantsbuild/testproject/testjvms:eight-runtime-platform to
# use Java 8 and 11, rather than Java 7 and 8.
platforms = """
{
'java7': {'source': '7', 'target': '7', 'args': [] },
'java8': {'source': '8', 'target': '8', 'args': [] },
'java9': {'source': '9', 'target': '9', 'args': [] },
}
"""
[pants-releases]
branch_notes = """
{
'master': 'src/python/pants/notes/master.rst',
'1.0.x': 'src/python/pants/notes/1.0.x.rst',
'1.1.x': 'src/python/pants/notes/1.1.x.rst',
'1.2.x': 'src/python/pants/notes/1.2.x.rst',
'1.3.x': 'src/python/pants/notes/1.3.x.rst',
'1.4.x': 'src/python/pants/notes/1.4.x.rst',
'1.5.x': 'src/python/pants/notes/1.5.x.rst',
'1.6.x': 'src/python/pants/notes/1.6.x.rst',
'1.7.x': 'src/python/pants/notes/1.7.x.rst',
'1.8.x': 'src/python/pants/notes/1.8.x.rst',
'1.9.x': 'src/python/pants/notes/1.9.x.rst',
'1.10.x': 'src/python/pants/notes/1.10.x.rst',
'1.11.x': 'src/python/pants/notes/1.11.x.rst',
'1.12.x': 'src/python/pants/notes/1.12.x.rst',
'1.13.x': 'src/python/pants/notes/1.13.x.rst',
'1.14.x': 'src/python/pants/notes/1.14.x.rst',
'1.15.x': 'src/python/pants/notes/1.15.x.rst',
'1.16.x': 'src/python/pants/notes/1.16.x.rst',
'1.17.x': 'src/python/pants/notes/1.17.x.rst',
'1.18.x': 'src/python/pants/notes/1.18.x.rst',
'1.19.x': 'src/python/pants/notes/1.19.x.rst',
'1.20.x': 'src/python/pants/notes/1.20.x.rst',
'1.21.x': 'src/python/pants/notes/1.21.x.rst',
'1.22.x': 'src/python/pants/notes/1.22.x.rst',
'1.23.x': 'src/python/pants/notes/1.23.x.rst',
'1.24.x': 'src/python/pants/notes/1.24.x.rst',
'1.25.x': 'src/python/pants/notes/1.25.x.rst',
'1.26.x': 'src/python/pants/notes/1.26.x.rst',
}
"""
[publish.jar]
ivy_settings = "%(pants_supportdir)s/ivy/publish.ivysettings.xml"
push_postscript = """
# Prevent Travis CI from running for this automated JAR publish commit:
# https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build
[ci skip]
"""
repos = """
{
'public': { # must match the name of the `Repository` object that you defined in your plugin.
'resolver': 'oss.sonatype.org', # must match hostname in ~/.netrc and the <url> parameter
# in your custom ivysettings.xml.
'auth': 'build-support/ivy:netrc', # Pants spec to a 'credentials()' object.
'help': 'Configure your ~/.netrc for oss.sonatype.org access.'
}
}
"""
restrict_push_branches = ['master']
restrict_push_urls = [
'git@github.com:pantsbuild/pants.git',
'https://github.com/pantsbuild/pants.git',
]
# The commithooks on this repository cause a deadlock while acquiring the workspace lock
# if a commit is made from within pants: skip them.
verify_commit = false
[python-setup]
interpreter_cache_dir = "%(pants_bootstrapdir)s/python_cache/interpreters"
resolver_cache_dir = "%(pants_bootstrapdir)s/python_cache/requirements"
[pytest]
pytest_plugins.add = [
# TODO(8528): implement a generic retry mechanism for the V2 test runner instead of using this
# plugin.
"pytest-rerunfailures",
# TODO(#8651): We need this until we switch to implicit namespace packages so that pytest-cov
# understands our __init__ files. NB: this version matches 3rdparty/python/requirements.txt.
"setuptools==44.0.0",
"ipdb",
]
[test.pytest]
timeouts = true
timeout_default = 60
[test.junit]
timeouts = true
timeout_default = 60
[test.go]
# TODO(#8649): Switch to --chroot.
chroot = false
[buildgen.go]
materialize = true
remote = true
fail_floating = true
# Site generation options.
[reference]
pants_reference_template = "reference/pants_reference_body.html"
build_dictionary_template = "reference/build_dictionary_body.html"
[markdown]
fragment = true
[sitegen]
config_path = "src/docs/docsite.json"
[native-build-step.cpp-compile-settings]
# TensorFlow 1.13 on python 3.7 specifically uses a newer C++ ABI than any other TensorFlow release,
# so in this repo's CI we override this option to avoid using the previous ABI for our python 3.7
# testing by setting PANTS_NATIVE_BUILD_STEP_CPP_COMPILE_SETTINGS_DEFAULT_COMPILER_OPTION_SETS="[]"
# in the environment.
default_compiler_option_sets = ['glibcxx_use_old_abi']
# TensorFlow custom operators cannot be built against the C++11 ABI yet: see
# https://www.tensorflow.org/guide/extend/op.
compiler_option_sets_enabled_args = "{'glibcxx_use_old_abi': ['-D_GLIBCXX_USE_CXX11_ABI=0']}"
compiler_option_sets_disabled_args = "{'glibcxx_use_old_abi': ['-D_GLIBCXX_USE_CXX11_ABI=1']}"
[libc]
enable_libc_search = true
[sourcefile-validation]
config = "@build-support/regexes/config.yaml"
[coursier]
repos = [
# First try RBE's maven central mirror, as we can get throttled by
# maven central due to all RBE traffic appearing to them as coming from a single IP.
# There's no harm in trying this even outside RBE, as it is world-visible.
'https://maven-central.storage-download.googleapis.com/repos/central/data',
'https://repo1.maven.org/maven2',
# Custom repo for Kythe jars, as Google doesn't currently publish them anywhere.
'https://raw.githubusercontent.com/toolchainlabs/binhost/master/',
# Specify local default maven repo to support
# testing snapshots of 3rdparty jars published locally.
'file://%(homedir)s/.m2/repository',
]
fetch_options.add = ["--retry-count", "3", "--no-default"]
[cache.resolve.coursier]
# Only use local artifact for coursier because the cache content contains abs path
# and is not portable. That said, if remote cache is enabled, this would not break
# but would be less performant, as the task will validate the entry paths from cache
# and decide to rerun coursier since the paths are invalid.
read_from = ["%(local_artifact_cache)s"]
write_to = ["%(local_artifact_cache)s"]