startup --host_jvm_args=-Xmx2g
startup --unlimit_coredumps

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

# 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
