blob: 32d068d693e0cbbebfd04bdac744faebb40fbcf9 [file]
# Licensed under the Apache-2.0 license
# SPDX-License-Identifier: Apache-2.0
# Default to C++17 to ensure compatibility.
common --@pigweed//pw_toolchain/cc:cxx_standard=17
common:cxx20 --//pw_toolchain/cc:cxx_standard=20
common --per_file_copt=external/.*,.*\.pb\.cc@-w
common --host_per_file_copt=external/.*,.*\.pb\.cc@-w
# Don't automatically create __init__.py files.
#
# This prevents spurious package name collisions at import time, and should be
# the default (https://github.com/bazelbuild/bazel/issues/7386). Pigweed's
# Python libraries break without this.
common --incompatible_default_to_explicit_init_py
# Do not attempt to configure an autodetected (local) toolchain. We vendor all
# our toolchains, and CI VMs may not have any local toolchain to detect.
common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
test --@pigweed//pw_kernel:enable_tests=true
test --platform_suffix=test
# Remote execution config definitions
# ===================================
# Use the remote cache. This will only work for users who have permission to access it.
common:remote_cache --bes_backend="buildeventservice.googleapis.com"
common:remote_cache --bes_instance_name=pigweed-rbe-open
common:remote_cache --bes_results_url="https://source.cloud.google.com/results/invocations/"
common:remote_cache --bes_timeout=600s
common:remote_cache --experimental_remote_cache_eviction_retries=5
common:remote_cache --google_default_credentials=true
# Required to use buildeventservice on Bazel 8+.
# TODO: b/345556899 -- Remove this flag when no longer required.
common:remote_cache --legacy_important_outputs
common:remote_cache --remote_cache=grpcs://remotebuildexecution.googleapis.com
common:remote_cache --remote_instance_name=projects/pigweed-rbe-open/instances/default-instance
common:remote_cache --remote_upload_local_results=false
# TODO: https://github.com/bazelbuild/bazel/issues/24867 - This flag breaks
# runfiles handling with remote caching, and causes a bunch of
# java.io.FileNotFoundException when creating runfiles trees.
common:remote_cache --experimental_inprocess_symlink_creation=false
# Force `-C embed-bitcode=yes` for every Rust compile. rules_rust defaults to
# `embed-bitcode=no` for build speed, but `//third_party/caliptra/caliptra-sw:caliptra_rom`
# needs `-C lto=fat` to match upstream caliptra-sw's release profile so the
# linked ROM fits in its 96 KiB region, and `lto` is incompatible with
# `embed-bitcode=no`. Applying this globally keeps the transitive caliptra_*
# rlibs consistent without annotating every dep individually.
common --@rules_rust//:extra_rustc_flags=-Cembed-bitcode=yes
common --@rules_rust//:extra_exec_rustc_flags=-Cembed-bitcode=yes