blob: bce9e0c8efea1cdfc745f2f71ea7c3056bf7dc9f [file] [edit]
common --@rules_python//python/config_settings:bootstrap_impl=script
# Either consumed as @remoteapis or as files.
common --deleted_packages=third_party/remoteapis
# Shared configuration flags to build and test Bazel on RBE.
common:remote_shared --remote_instance_name=projects/bazel-untrusted/instances/default_instance
common:remote_shared --remote_executor=grpcs://remotebuildexecution.googleapis.com
common:remote_shared --remote_download_toplevel
common:remote_shared --remote_timeout=600
common:remote_shared --google_default_credentials
common:remote_shared --jobs=100
common:remote_shared --action_env=PATH=/bin:/usr/bin:/usr/local/bin
# Configuration to build and test Bazel on RBE on Ubuntu 24.04
common:ubuntu2404 --extra_execution_platforms=//:rbe_ubuntu2404_platform,//:rbe_ubuntu2404_highcpu_platform
common:ubuntu2404 --host_platform=//:rbe_ubuntu2404_platform
common:ubuntu2404 --platforms=//:rbe_ubuntu2404_platform
common:ubuntu2404 --config=remote_shared
# Alias
common:remote --config=ubuntu2404
common --host_macos_minimum_os=10.13
common --macos_minimum_os=10.13
common:windows_arm64 --platforms=//:windows_arm64
# Build Bazel with the hermetic LLVM toolchains from the `llvm` module instead
# of the auto-configured host toolchain. Combine with --platforms to
# cross-compile, e.g.:
# bazel build --platforms=@llvm//platforms:linux_x86_64 //src:bazel
# bazel build --platforms=//:windows_x86_64 //src:bazel
# bazel build --platforms=@llvm//platforms:macos_aarch64 //src:bazel
common --extra_toolchains=@llvm//toolchain:all
common --extra_toolchains=//src:llvm_rc_toolchain
# Link the static MSVC CRT (/MT) for Windows targets (no-op on other platforms)
# so that cross-compiled and native Windows binaries do not depend on the VC++
# redistributable at runtime.
common --features=-dynamic_link_msvcrt
common --features=static_link_msvcrt
common --host_features=-dynamic_link_msvcrt
common --host_features=static_link_msvcrt
# Enables the `linux` and `windows` configs below on these hosts.
common --enable_platform_specific_config
# On Linux, build against the oldest glibc that the LLVM toolchains support, so
# that the binaries run on old distributions. See //:linux_host_platform.
common:linux --host_platform=//:linux_host_platform
# On Windows, pair the hermetic MSVC LLVM toolchain with `windows-msvc` Rust
# and shorten platform output dir names to keep generated Rust sysroot `.rlib`
# paths under Windows's 260-character MAX_PATH limit.
# --extra_execution_platforms is needed so //:windows_host_platform takes
# precedence over register_execution_platforms("//:default_host_platform") in
# MODULE.bazel for exec-configuration tools.
common:windows --extra_execution_platforms=//:windows_host_platform
common:windows --host_platform=//:windows_host_platform
common:windows --experimental_override_name_platform_in_output_dir=//:windows_host_platform=w
common:windows --experimental_override_name_platform_in_output_dir=//:windows_arm64=wa
# The Bazel client only talks to the server via 127.0.0.1/[::1], so it never
# needs a DNS resolver. Disable gRPC's c-ares based resolver to avoid building
# c-ares.
common --define=grpc_no_ares=true
# Check direct Bazel module dependencies are up-to-date
common --check_direct_dependencies=error
# Add mirrors for certain download URLs
common --downloader_config=bazel_downloader.cfg
# Add BCR module mirrors
common --module_mirrors=https://bcr.cloudflaremirrors.com
# Some integration tests need the PATH environment variable set.
common --test_env=PATH
# macOS layering check is broken with grpc https://github.com/grpc/grpc/pull/41953
common --repo_env=APPLE_SUPPORT_LAYERING_CHECK_BETA=0
# Suppress warnings from headers in external repos, we have no direct control on them anyway.
# Use this rather than --per_file_copt to support cross-platform builds and different compilers.
common --features=external_include_paths
common --host_features=external_include_paths
# Build protoc from source instead of using the prebuilt binary so we can apply patches.
common --@com_google_protobuf//bazel/flags:prefer_prebuilt_protoc=false
# Use the upb kernel for Rust protos to avoid linking C++ protobuf and Abseil
# (whose synchronization.lib collides with the Windows SDK's synchronization.lib
# needed by Rust's std).
common --@com_google_protobuf//rust:rust_proto_library_kernel=upb
# Enable Java 25 language features and compile for a Java 25 runtime, but run on the version of
# the embedded JDK.
# Keep in sync with //:java_toolchain_%d.
# LINT.IfChange
common --java_language_version=25
common --tool_java_language_version=25
common --java_runtime_version=remotejdk_27
common --tool_java_runtime_version=remotejdk_25
# LINT.ThenChange(//BUILD)
# Reduce the amount of warnings shown due to the deprecation of most Unsafe
# methods.
# TODO: Remove this after migrating more code to use VarHandles.
common --javacopt=-Xlint:-removal
common --host_javacopt=-Xlint:-removal
# Use a bootclasspath version matching the language version.
common --@rules_java//toolchains:incompatible_language_version_bootclasspath
# Fail if a classpath contains different versions of the same class
common --experimental_one_version_enforcement=ERROR
# User-specific .bazelrc
try-import %workspace%/user.bazelrc
common:docs --workspace_status_command=scripts/docs/get_workspace_status.sh
# Flags for CI builds
## Common
common:ci-common --lockfile_mode=error
common:ci-common --remote_download_minimal
common:ci-common --nobuild_runfile_links
common:ci-common --experimental_profile_include_target_label
# Required by @windows_support (used by @llvm's MSVC ABI toolchain) to fetch
# the MSVC runtime and Windows SDK headers/libraries for native Windows builds
# and cross-compilation targets (e.g. //src:bazel_windows_llvm).
common:ci-common --repo_env=BAZEL_MSVC_RUNTIME_VISUAL_STUDIO_EULA=1
common:ci-common --repo_env=BAZEL_WINDOWS_SDK_EULA=1
## For Linux
common:ci-linux --config=ci-common
common:ci-linux --repository_cache=/var/lib/buildkite-agent/bazeltest/repo_cache
common:ci-linux --test_env=TEST_INSTALL_BASE=/var/lib/buildkite-agent/bazeltest/install_base
common:ci-linux --test_env=REPOSITORY_CACHE=/var/lib/buildkite-agent/bazeltest/repo_cache
common:ci-linux --test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80
test:ci-linux --sandbox_writable_path=/var/lib/buildkite-agent/bazeltest
test:ci-linux --sandbox_default_allow_network=false
## For macOS
common:ci-macos --config=ci-common
common:ci-macos --repository_cache=/Users/buildkite/bazeltest/repo_cache
common:ci-macos --experimental_collect_system_network_usage
common:ci-macos --test_env=TEST_INSTALL_BASE=/Users/buildkite/bazeltest/install_base
common:ci-macos --test_env=REPOSITORY_CACHE=/Users/buildkite/bazeltest/repo_cache
common:ci-macos --test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80
test:ci-macos --sandbox_writable_path=/Users/buildkite/bazeltest
# TODO(pcloudy): Revert to false once https://github.com/bazelbuild/bazel/issues/23726 is resolved.
test:ci-macos --sandbox_default_allow_network=true
common:ci-macos --test_tag_filters=-no_macos
common:ci-macos --experimental_async_execution
common:ci-macos --experimental_async_execution_max_concurrent_actions=0
common:ci-macos --jobs=100
## For Windows
common:ci-windows --config=ci-common
common:ci-windows --repository_cache=C:/b/bazeltest_repo_cache
common:ci-windows --test_env=BAZEL_VC
common:ci-windows --test_env=JAVA_HOME
common:ci-windows --test_env=TEST_INSTALL_BASE=C:/b/bazeltest_install_base
common:ci-windows --test_env=REPOSITORY_CACHE=C:/b/bazeltest_repo_cache
common:ci-windows --test_tag_filters=-no_windows,-slow
# Hide warnings and output of successful actions from external repositories
# (e.g. MSVC warnings from grpc, protobuf and abseil). Errors still show.
common:ci-windows --output_filter=^//