| # 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 | |
| # Enable Rust formatting support in pigweed presubmits | |
| common --@pigweed//pw_presubmit/py:enable_rust_formatter=true | |
| 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 | |
| # ── AST10x0 QEMU virtual target ── | |
| # Shared kernel build/test tag filters (mirrors openprot's k_common). | |
| build:k_common --build_tag_filters=-do_not_build,-kernel_doc_test | |
| test:k_common --test_tag_filters=-integration,-do_not_build,-do_not_run_test,-kernel_doc_test | |
| # AST1060-EVB physical board via Raspberry Pi SSH fixture. | |
| # Requires key-based SSH auth: ssh-copy-id <user>@<pi-host> | |
| # Usage: AST1060_EVB_PI_HOST=<pi-hostname> bazel test --config=k_ast1060_evb //... | |
| common:k_ast1060_evb --platforms=//target/ast10x0 | |
| build:k_ast1060_evb --build_tag_filters=-do_not_build,-kernel_doc_test | |
| # Board tests share one physical board; run them one at a time. | |
| test:k_ast1060_evb --local_test_jobs=1 | |
| test:k_ast1060_evb --run_under="//target/ast10x0/harness:test_runner " | |
| # Forward AST1060_EVB_PI_HOST from the user's shell into the test sandbox. | |
| test:k_ast1060_evb --test_env=AST1060_EVB_PI_HOST | |
| # Excludes semihosting tests (qemu_only) which HardFault on hardware without a debugger. | |
| test:k_ast1060_evb --test_tag_filters=-integration,-do_not_build,-do_not_run_test,-kernel_doc_test,-qemu_only | |
| # `bazel {build,test,run} --config=virt_ast10x0 //target/ast10x0/...` | |
| # launches the AST10x0 system images under QEMU's ast1030-evb machine. | |
| # The :qemu flag retunes SysTick to QEMU's 12 MHz clock. | |
| # Pass/fail is signalled via UART sentinel (TEST_RESULT:PASS/FAIL) rather | |
| # than semihosting, so the same firmware binary runs on physical hardware. | |
| common:virt_ast10x0 --platforms=//target/ast10x0 | |
| build:virt_ast10x0 --build_tag_filters=-do_not_build,-kernel_doc_test | |
| common:virt_ast10x0 --//target/ast10x0:qemu=true | |
| run:virt_ast10x0 --run_under="//target/ast10x0/harness:qemu_runner \ | |
| --cpu cortex-m4 --machine ast1030-evb --image " | |
| test:virt_ast10x0 --run_under="//target/ast10x0/harness:qemu_runner \ | |
| --cpu cortex-m4 --machine ast1030-evb --image " | |
| # Mirrors k_common's test_tag_filters and adds -hardware (physical-board-only tests). | |
| # Combined into one flag to avoid the Bazel 'expanded from multiple configs' warning | |
| # that fires when --test_tag_filters is set by both k_common and this config. | |
| test:virt_ast10x0 --test_tag_filters=-integration,-do_not_build,-do_not_run_test,-kernel_doc_test,-hardware | |
| # Stress test configs — same platform/build flags as the base configs but with | |
| # --timeout 0 in --run_under so the runner blocks indefinitely until FAIL. | |
| common:stress_virt_ast10x0 --platforms=//target/ast10x0 | |
| common:stress_virt_ast10x0 --//target/ast10x0:qemu=true | |
| build:stress_virt_ast10x0 --build_tag_filters=-do_not_build,-kernel_doc_test | |
| run:stress_virt_ast10x0 --run_under="//target/ast10x0/harness:qemu_runner \ | |
| --timeout 0 --cpu cortex-m4 --machine ast1030-evb --image " | |
| test:stress_virt_ast10x0 --run_under="//target/ast10x0/harness:qemu_runner \ | |
| --timeout 0 --cpu cortex-m4 --machine ast1030-evb --image " | |
| common:stress_k_ast1060_evb --platforms=//target/ast10x0 | |
| build:stress_k_ast1060_evb --build_tag_filters=-do_not_build,-kernel_doc_test | |
| test:stress_k_ast1060_evb --local_test_jobs=1 | |
| test:stress_k_ast1060_evb --run_under="//target/ast10x0/harness:test_runner \ | |
| --timeout 0 " | |
| test:stress_k_ast1060_evb --test_env=AST1060_EVB_PI_HOST | |
| # Site-local overrides. Kept last so developer machine-specific settings (e.g. a | |
| # local QEMU source override via --override_repository) take precedence. This | |
| # file is not checked in; see third_party/qemu/setup.md. | |
| try-import %workspace%/.bazelrc-site |