startup --host_jvm_args=-Xmx2g
startup --unlimit_coredumps

# Repository archives can outlast short GitHub gateway failures. These options
# cover build/test/query/fetch downloads, independently of remote-cache retries.
common --http_connector_attempts=12
# Bazel applies jitter after capping this exponential retry-delay base.
common --http_connector_retry_max_timeout=30s

build --announce_rc

# One checked test profile for every Rust target and dependency. Bazel is used
# for tests; keep LLVM work modest and preserve debug/overflow checks.
# Keep target artifacts unstripped in both profiles: pinned Rust 1.97.1 can
# corrupt Mach-O LINKEDIT string pools, rejected by macOS 27 (rust-lang/rust#157750).
build --@rules_rust//rust/settings:extra_rustc_flags=-Copt-level=1,-Cdebuginfo=0,-Ccodegen-units=16,-Cdebug-assertions=yes,-Coverflow-checks=yes,-Cstrip=none
build --@rules_rust//rust/settings:lto=off

# Explicit release verification uses one repository profile, never target flags.
build:release --compilation_mode=opt
build:release --@rules_rust//rust/settings:extra_rustc_flags=-Copt-level=3,-Cdebuginfo=0,-Ccodegen-units=1,-Cdebug-assertions=no,-Coverflow-checks=no,-Cstrip=none
build:release --@rules_rust//rust/settings:lto=thin

# Prebuilt release archives (docs/PREBUILT_LIBRARIES.md): the release profile
# plus a platform ABI floor only. Without it, macOS objects and the linked dylib
# target the build host's own OS version. Other platforms ignore these.
build:prebuilt --config=release
build:prebuilt --macos_minimum_os=11.0
build:prebuilt --action_env=MACOSX_DEPLOYMENT_TARGET=11.0

# Rust test binaries also run cases in parallel; bound concurrent local binaries.
test --local_test_jobs=HOST_CPUS*0.5

# Keep Java-backed rules independent of the host JDK and JAVA_HOME.
build --java_runtime_version=remotejdk_21
build --tool_java_runtime_version=remotejdk_21

# Rust 1.97.1's stripping tool can misalign Mach-O string tables, which macOS
# 27 rejects when loading proc-macros (rust-lang/rust#157750). Keep execution
# tools unstripped until the pinned toolchain includes the upstream fix.
# Target-library/release flags and Linux-host defaults are unaffected.
build --enable_platform_specific_config
build:macos --@rules_rust//rust/settings:extra_exec_rustc_flags=-Cstrip=none
