blob: 95aa20ef47150517c43c921b3531d74a7e049dac [file] [edit]
# Copyright (C) 2021 The Android Open Source Project
#
# 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
#
# http://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.
# Lock down the PATH variable in actions to /usr/bin and /usr/local/bin.
build --incompatible_strict_action_env
# By default, output all the logs to stdout/stderr by disabling the console limit
build --experimental_ui_max_stdouterr_bytes=-1
# Show the full set of flags for observability and debuggability.
# common --announce_rc
# Make output directories writable so `rm -rf out/` works.
build --experimental_writable_outputs
# Control auto-load modules
common --incompatible_autoload_externally=+@rules_cc,-@rules_python,-@rules_shell,-@rules_android,-@rules_java,-@protobuf,-@com_google_protobuf
common --noincompatible_enable_proto_toolchain_resolution
# See bazel.py for additional flags.
# Enable 2-stage bootstrapping for rules_python. This drops dependency on
# host Python 3, improving hermeticity.
# HACK: We use canonical repo name here so that the root module doesn't have to
# explicitly depend on rules_python (for DDKv2 style workspace setup).
# This only works when we have explicit
# local_path_override(module_name = "rules_python"), and --config=no_internet
# is a sufficient (though not necessary) condition of local_path_override.
# If we are fetching rules_python from the Internet, bootstrap_impl=script
# may not work without the ANDROID: specific hacks, so it is reasonable to
# disable it.
common:no_internet --@@rules_python+//python/config_settings:bootstrap_impl=script
# Disable rules_rust's automatic sysroot generation globally to align with GBL's
# bare-metal requirements, ensuring consistent compiler behavior across the workspace.
common --@@rules_rust+//rust/settings:toolchain_generated_sysroot=false
# Always dump full test results
test --test_output=errors --test_summary=terse
# Support a device-specific bazelrc file
try-import %workspace%/device.bazelrc
# Support a local user-specific bazelrc file.
try-import %workspace%/user.bazelrc
# Do not add more flags below so that the flags set by device.bazelrc
# and user.bazelrc are respected.