bazel: common options between community and ultimate

GitOrigin-RevId: dbdbfddcae08547a0029e8bcbe36bc6098e69878
This commit is contained in:
Leonid Shalupov
2025-02-28 22:12:15 +00:00
committed by intellij-monorepo-bot
parent 1ae9c2b129
commit 5a198e9c10
2 changed files with 76 additions and 47 deletions
+7 -47
View File
@@ -1,52 +1,12 @@
# https://bazel.build/docs/bazel-and-java#hermetic-testing
# The code is compiled for, executed, and tested on this JVM.
### Profiles ###
build --@rules_jvm//:default-kotlinc-opts=//:k17
# ci — configuration tailored for CI
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
# 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 commpilation 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-
### --- ###
import common.bazelrc
# Disk Cache
build --experimental_disk_cache_gc_max_size=32G --experimental_disk_cache_gc_max_age=28d
common --enable_platform_specific_config
build:macos --disk_cache=~/Library/Caches/JetBrains/bazel-ij
build:linux --disk_cache=~/.bazel-ij
build:windows --disk_cache=~/.bazel-ij
# Remote Caching (https://bazel.build/remote/caching)
# https://github.com/bazelbuild/bazel/issues/13378#issuecomment-869301764
# https://github.com/buildfarm/buildfarm/issues/756#issuecomment-847890721
# IJ Infrastruture team will setup Google OAuth instead of mTLS
# basic auth cannot be specified in URL for gRPC, so, please create ~/.netrc file (https://jb.gg/yp4kxq)
build --bes_results_url=https://ij-build.labs.jb.gg/invocation/
build --bes_backend=grpcs://ij-build-grpc.labs.jb.gg
build --remote_cache=grpcs://ij-build-grpc.labs.jb.gg
# https://www.buildbuddy.io/blog/debugging-slow-bazel-builds/
# check if `--remote_download_outputs=minimal` makes sense for CI or some local builds
build --nolegacy_important_outputs --remote_build_event_upload=minimal
# on CI, set remote_cache_async to false! set to false for local runs also, to investigate https://github.com/bazelbuild/bazel/issues/19273
build --experimental_remote_cache_async=false --remote_cache_compression
# build --remote_timeout=3600
common:macos --disk_cache=~/Library/Caches/JetBrains/community-bazel-disk-cache
common:linux --disk_cache=~/.cache/JetBrains/community-bazel-disk-cache
common:windows --disk_cache=~/AppData/Local/Temp/JetBrains/community-bazel-disk-cache
+69
View File
@@ -0,0 +1,69 @@
# 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=80 --@rules_jvm//:java_inc_threshold=200
# 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