blob: c3dc1ee17811b0189ab31896587efbbdcc6a8518 [file] [log] [blame]
# Copyright 2024 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.
# Enable clippy lints
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build --output_groups=+clippy_checks
# Enforce rustfmt formatting
build --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build --output_groups=+rustfmt_checks
# TODO - konkers: fix upstream stable toolchains
common --@@rules_rust+//rust/toolchain/channel=nightly
common --@pigweed//pw_log/rust:pw_log_backend=@pigweed//pw_log/rust:pw_log_backend_println
# Clippy broken with embedded tests
build:qemu-microbit --output_groups=-clippy_checks
build:qemu-microbit --platforms=//target/qemu:microbit --output_groups=-clippy_checks
run:qemu-microbit --run_under="@qemu//:qemu-system-arm \
-cpu cortex-m0 \
-machine microbit \
-nographic \
-semihosting-config \
enable=on,target=native \
-serial mon:stdio \
-kernel "
# Clippy broken with embedded tests
build:qemu-lm3s6965evb --output_groups=-clippy_checks
build:qemu-lm3s6965evb --platforms=//target/qemu:lm3s6965evb
run:qemu-lm3s6965evb --run_under="@qemu//:qemu-system-arm \
-cpu cortex-m3 \
-machine lm3s6965evb \
-nographic \
-semihosting-config \
enable=on,target=native \
-serial mon:stdio \
-kernel "
test:qemu-lm3s6965evb --run_under="@qemu//:qemu-system-arm \
-cpu cortex-m3 \
-machine lm3s6965evb \
-nographic \
-semihosting-config \
enable=on,target=native \
-serial mon:stdio \
-kernel "
# 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
# cache-silo-key: this is essentially a "salt" added to the remote cache key.
# Change it to a new value when we want to create a new cache from scratch
# (e.g. to recover from cache poisoning). We've used the current date in
# YYYYMMDD format in the past.
common --remote_default_exec_properties=cache-silo-key=20240918
# User bazelrc file
# =================
# See https://bazel.build/configure/best-practices#bazelrc-file
#
# Note: this should be at the bottom of the file, so that user-specified
# options override anything in this file
# (https://bazel.build/run/bazelrc#imports)
try-import %workspace%/user.bazelrc