forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.bazelrc
72 lines (52 loc) · 2.65 KB
/
common.bazelrc
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
# Common bazel settings between open source community repository and the monorepo
### Profiles ###
# ci — configuration tailored for CI
### --- ###
common --@rules_jvm//:default-kotlinc-opts=@community//:k17
common --@rules_jvm//:worker-impl=@rules_jvm//src/misc:worker-jvm
common --@rules_jvm//:koltin_inc_threshold=0 --@rules_jvm//:java_inc_threshold=0
# configure resources
common --local_resources=memory=HOST_RAM*.77 --local_resources=cpu=HOST_CPUS*2
common --jobs=HOST_CPUS*2 --worker_max_multiplex_instances=JpsCompile=HOST_CPUS*2
# hide Java 8 deprecation warnings
common --javacopt=-Xlint:-options
# https://bazel.build/docs/bazel-and-java#hermetic-testing
# The code is compiled for, executed, and tested on this JVM.
common --java_language_version=17
common --java_runtime_version=remotejdk_21
# see https://bazel.build/external/lockfile
# use `bazel mod deps --lockfile_mode=refresh` to update lock file
common --lockfile_mode=error
common --noenable_workspace
common --nolegacy_external_runfiles --experimental_sibling_repository_layout
# https://bazel.build/docs/bazel-and-java#config-build-tools-java
# A second pair of JDK and JVM used to build and execute tools, which are used in the build process, but are not in the build results.
# That JDK and JVM are controlled using --tool_java_language_version and --tool_java_runtime_version
common --tool_java_language_version=21
# Java runtime the tools should use
common --tool_java_runtime_version=remotejdk_21
# make sure you don't need to open file to read compilation errors
common --experimental_ui_max_stdouterr_bytes=-1
# IDEA do not handle symlinks efficiently (freeze due to modal non-cancellable dialog) and no way to exclude directories by pattern bazel-
common --symlink_prefix=out/bazel-
# FS Watch
build --watchfs
build --experimental_windows_watchfs
build:ci --nowatchfs
common --enable_platform_specific_config
common --incompatible_strict_action_env=true
# Generally good remote cache tweaks
# on CI, set remote_cache_async to false! set to false for local runs also, to investigate https://github.com/bazelbuild/bazel/issues/19273
common --remote_cache_async=false --remote_cache_compression=true
common:ci --remote_cache_async=false
# https://www.buildbuddy.io/blog/debugging-slow-bazel-builds/
# check if `--remote_download_outputs=minimal` makes sense for CI or some local builds
build --remote_build_event_upload=minimal
build --nolegacy_important_outputs
# protobuf
common --incompatible_enable_proto_toolchain_resolution
# More debug on CI
common:ci --announce_rc
common:ci --show_progress_rate_limit=30
# avoid creating a runfiles tree for binaries or tests until it is needed
build --nobuild_runfile_links