Ted Pudlik | 448df69 | 2023-10-16 21:17:27 +0000 | [diff] [blame] | 1 | # Copyright 2023 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
Ted Pudlik | 2447579 | 2024-01-11 19:39:57 +0000 | [diff] [blame] | 14 | |
Ted Pudlik | 16c686b | 2024-08-08 22:14:02 +0000 | [diff] [blame] | 15 | # Don't automatically create __init__.py files. |
| 16 | # |
| 17 | # This prevents spurious package name collisions at import time, and should be |
| 18 | # the default (https://github.com/bazelbuild/bazel/issues/7386). It's |
| 19 | # particularly helpful for Pigweed, because we have many potential package name |
| 20 | # collisions due to a profusion of stuttering paths like |
| 21 | # pw_transfer/py/pw_transfer. |
| 22 | common --incompatible_default_to_explicit_init_py |
Ted Pudlik | 2447579 | 2024-01-11 19:39:57 +0000 | [diff] [blame] | 23 | |
Ted Pudlik | 448df69 | 2023-10-16 21:17:27 +0000 | [diff] [blame] | 24 | # Do not attempt to configure an autodetected (local) toolchain. We vendor all |
| 25 | # our toolchains, and CI VMs may not have any local toolchain to detect. |
| 26 | common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 |
| 27 | |
| 28 | # Required for new toolchain resolution API. |
| 29 | build --incompatible_enable_cc_toolchain_resolution |
Ted Pudlik | 5e7f1e3 | 2024-08-02 22:32:12 +0000 | [diff] [blame] | 30 | |
Ted Pudlik | 16c686b | 2024-08-08 22:14:02 +0000 | [diff] [blame] | 31 | # Don't propagate flags or defines to the exec config. This will become the |
| 32 | # default one day (https://github.com/bazelbuild/bazel/issues/22457) and will |
| 33 | # improve cache hit rates between builds targeting different platforms. |
| 34 | common --experimental_exclude_defines_from_exec_config |
| 35 | common --experimental_exclude_starlark_flags_from_exec_config |
| 36 | |
| 37 | # Enforces consistent action environment variables. This is important to |
| 38 | # address Protobuf's rebuild sensitivity on changes to the environment |
| 39 | # variables. It also improves cache hit rates. Should be true by default one |
| 40 | # day (https://github.com/bazelbuild/bazel/issues/7026). |
| 41 | build --incompatible_strict_action_env |
| 42 | |
| 43 | # Expose exec toolchains for Python. We use these toolchains in some rule |
| 44 | # implementations (git grep for |
| 45 | # "@rules_python//python:exec_tools_toolchain_type"). |
| 46 | build --@rules_python//python/config_settings:exec_tools_toolchain=enabled |
| 47 | |
Ted Pudlik | fe93ea8 | 2024-09-27 18:40:54 +0000 | [diff] [blame] | 48 | # Remote execution config definitions |
| 49 | # =================================== |
| 50 | # Use the remote cache. This will only work for users who have permission to access it. |
| 51 | common:remote_cache --remote_cache=grpcs://remotebuildexecution.googleapis.com |
| 52 | common:remote_cache --google_default_credentials=true |
| 53 | common:remote_cache --remote_instance_name=projects/pigweed-rbe-open/instances/default-instance |
| 54 | common:remote_cache --remote_upload_local_results=false |
| 55 | common:remote_cache --bes_backend="buildeventservice.googleapis.com" |
| 56 | # Required to use buildeventservice on Bazel 8+. |
| 57 | # TODO: b/345556899 -- Remove this flag when no longer required. |
| 58 | common:remote_cache --legacy_important_outputs |
| 59 | common:remote_cache --bes_timeout=600s |
| 60 | common:remote_cache --bes_results_url="https://source.cloud.google.com/results/invocations/" |
| 61 | common:remote_cache --bes_instance_name=pigweed-rbe-open |
| 62 | |
Ted Pudlik | 5e7f1e3 | 2024-08-02 22:32:12 +0000 | [diff] [blame] | 63 | # User bazelrc file; see |
| 64 | # https://bazel.build/configure/best-practices#bazelrc-file |
| 65 | # |
| 66 | # Note: this should be at the bottom of the file, so that user-specified |
| 67 | # options override anything in this file |
| 68 | # (https://bazel.build/run/bazelrc#imports) |
| 69 | try-import %workspace%/user.bazelrc |