# populate env used for stamping builds etc
build --workspace_status_command=./hack/print-workspace-status.sh
run --workspace_status_command=./hack/print-workspace-status.sh

# enable data race detection
test --features=race --test_output=errors

# only build tests when testing
test --build_tests_only

# you can build remotely by specifying the following in a .bazelrc:
# build --config=remote --remote_instance_name=<build_instance>
# https://github.com/bazelbuild/bazel-toolchains/blob/master/bazelrc/bazel-0.27.0.bazelrc
build:remote --jobs=500
build:remote --host_javabase=@rbe_default//java:jdk
build:remote --javabase=@rbe_default//java:jdk
build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build:remote --crosstool_top=@rbe_default//cc:toolchain
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

build:remote --extra_toolchains=@rbe_default//config:cc-toolchain
build:remote --extra_execution_platforms=@io_k8s_repo_infra//:rbe_with_network
build:remote --host_platform=@io_k8s_repo_infra//:rbe_with_network
build:remote --platforms=@io_k8s_repo_infra//:rbe_with_network

build:remote --define=EXECUTOR=remote
build:remote --remote_executor=grpcs://remotebuildexecution.googleapis.com
build:remote --remote_timeout=3600

# --google_credentials=some_file.json
build:remote --google_default_credentials=true
build:remote --config=toplevel

run:remote --experimental_remote_download_outputs=all --noexperimental_inmemory_jdeps_files --noexperimental_inmemory_dotd_files

# configs to minimize what is downloaded
build:inmemory --experimental_inmemory_jdeps_files
build:inmemory --experimental_inmemory_dotd_files

build:toplevel --config=inmemory
build:toplevel --experimental_remote_download_outputs=toplevel

build:minimal --config=inmemory
build:minimal --experimental_remote_download_outputs=minimal

# Used for non-interactive ci builds
build:ci --noshow_progress # reduce log spam
test:ci --nobuild_tests_only # yes, build everything

# https://github.com/bazelbuild/rules_go/pull/2110#issuecomment-508713878
build --stamp=true
