blob: 776800fab8619067834c24612c2f4aebe1ebb5b6 [file]
# Copyright 2026 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# Common flags
common --experimental_isolated_extension_usages
# Default to C++17 to ensure compatibility.
common --@pigweed//pw_toolchain/cc:cxx_standard=17
# Don't automatically create __init__.py files.
common --incompatible_default_to_explicit_init_py
# Do not attempt to configure an autodetected (local) toolchain.
# We rely on vendored toolchains from Pigweed.
common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# Silence warnings in external repositories and generated proto files.
common --per_file_copt=.*external.*,.*\.pb\.cc@-w
common --host_per_file_copt=.*external.*,.*\.pb\.cc@-w
# Host platform configuration
build:host --platforms=@pigweed//pw_kernel/target/host:host
# 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
# Lint configuration
# ==================
# Enable clippy lints
build:lint --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:lint --output_groups=+clippy_checks
build:lint --@rules_rust//rust/settings:clippy_flags="\
-Dclippy::cast_lossless,\
-Dclippy::cast_possible_truncation,\
-Dclippy::cast_possible_wrap,\
-Dclippy::cast_precision_loss,\
-Dclippy::cast_sign_loss,\
-Dclippy::char_lit_as_u8,\
-Dclippy::fn_to_numeric_cast,\
-Dclippy::fn_to_numeric_cast_with_truncation,\
-Dclippy::ptr_as_ptr,-Dclippy::unnecessary_cast,\
-Dinvalid_reference_casting,\
-Dclippy::alloc_instead_of_core,\
-Dclippy::as_underscore,\
-Dclippy::assertions_on_result_states,\
-Dclippy::correctness,\
-Dclippy::dbg_macro,\
-Dclippy::decimal_literal_representation,\
-Dclippy::double_must_use,\
-Dclippy::missing_safety_doc,\
-Dclippy::must_use_candidate,\
-Dclippy::must_use_unit,\
-Dclippy::obfuscated_if_else,\
-Dclippy::perf,\
-Dclippy::return_self_not_must_use,\
-Dclippy::std_instead_of_core,\
-Dclippy::style,\
-Dclippy::suspicious,\
-Dclippy::unimplemented,\
-Dclippy::unnested_or_patterns,\
-Aclippy::new_without_default"