.bazelrc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. startup --expand_configs_in_place
  2. # Show us information about failures.
  3. build --verbose_failures
  4. test --test_output=errors
  5. # Include git version info
  6. build --workspace_status_command hack/print-workspace-status.sh
  7. # Make /tmp hermetic
  8. build --sandbox_tmpfs_path=/tmp
  9. # Ensure that Bazel never runs as root, which can cause unit tests to fail.
  10. # This flag requires Bazel 0.5.0+
  11. build --sandbox_fake_username
  12. # Enable go race detection.
  13. build:unit --features=race
  14. test:unit --features=race
  15. test:unit --build_tests_only
  16. test:unit --test_tag_filters=-e2e,-integration
  17. test:unit --flaky_test_attempts=3
  18. test:integration --local_test_jobs 4
  19. test:integration --test_tag_filters=integration
  20. # Darwin and Windows only cross-compile pure Go
  21. build:cross:darwin_386 --platforms=@io_bazel_rules_go//go/toolchain:darwin_386
  22. build:cross:darwin_amd64 --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64
  23. build:cross:windows_386 --platforms=@io_bazel_rules_go//go/toolchain:windows_386
  24. build:cross:windows_amd64 --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64
  25. # We enable cgo cross-compilation for Linux, but need to use our custom crosstool.
  26. build:repo_infra_crosstool --crosstool_top=@io_k8s_repo_infra//tools:toolchain --compiler=gcc
  27. build:cross:linux_386 --config=repo_infra_crosstool --platforms=@io_bazel_rules_go//go/toolchain:linux_386
  28. build:cross:linux_amd64 --config=repo_infra_crosstool --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 --cpu=amd64
  29. build:cross:linux_arm --config=repo_infra_crosstool --platforms=@io_bazel_rules_go//go/toolchain:linux_arm --cpu=arm
  30. build:cross:linux_arm64 --config=repo_infra_crosstool --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64 --cpu=arm64
  31. build:cross:linux_ppc64le --config=repo_infra_crosstool --platforms=@io_bazel_rules_go//go/toolchain:linux_ppc64le --cpu=ppc64le
  32. build:cross:linux_s390x --config=repo_infra_crosstool --platforms=@io_bazel_rules_go//go/toolchain:linux_s390x --cpu=s390x
  33. # --config=remote-cache enables a remote bazel cache
  34. # Note needs a --remote_instance_name=projects/PROJ/instances/default_instance flag
  35. build:remote-cache --remote_cache=remotebuildexecution.googleapis.com
  36. build:remote-cache --tls_enabled=true
  37. build:remote-cache --remote_timeout=3600
  38. build:remote-cache --auth_enabled=true
  39. # --config=remote adds remote execution to the --config=remote-cache
  40. # Note needs a --remote_instance_name=projects/PROJ/instances/default_instance flag
  41. build:remote --config=remote-cache
  42. build:remote --remote_executor=remotebuildexecution.googleapis.com
  43. build:remote --jobs=500
  44. build:remote --host_javabase=@rbe_default//java:jdk
  45. build:remote --javabase=@rbe_default//java:jdk
  46. build:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
  47. build:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
  48. build:remote --crosstool_top=@rbe_default//cc:toolchain
  49. build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
  50. build:remote --extra_toolchains=@rbe_default//config:cc-toolchain
  51. build:remote --extra_execution_platforms=:rbe_with_network
  52. build:remote --host_platform=:rbe_with_network
  53. build:remote --platforms=:rbe_with_network
  54. build:remote --spawn_strategy=remote
  55. build:remote --strategy=Javac=remote
  56. build:remote --strategy=Closure=remote
  57. build:remote --strategy=Genrule=remote
  58. build:remote --define=EXECUTOR=remote
  59. # tar locally due to https://github.com/bazelbuild/bazel/issues/8462
  60. build:remote --strategy=PackageTar=sandboxed
  61. # --config=ci-instance adds a remote instance name
  62. build:ci-instance --remote_instance_name=projects/k8s-prow-builds/instances/default_instance
  63. # The config we want to use in CI
  64. build:ci --config=remote --config=ci-instance