2023-03-09 09:23:42 -05:00
|
|
|
# share bazel cache between checkouts of the same project
|
|
|
|
# and keep old build caches around for longer
|
2023-08-16 06:37:29 -04:00
|
|
|
common --disk_cache=~/.cache/shared_bazel_action_cache
|
|
|
|
common --repository_cache=~/.cache/shared_bazel_repository_cache
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# better caching / reproducibility
|
2023-08-16 06:37:29 -04:00
|
|
|
common --incompatible_strict_action_env=true
|
|
|
|
common --experimental_output_directory_naming_scheme=diff_against_baseline
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# disable automatic toolchain detection for C/C++
|
2023-08-16 06:37:29 -04:00
|
|
|
common --incompatible_enable_cc_toolchain_resolution
|
|
|
|
common --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# inject version information into binaries
|
2023-08-16 06:37:29 -04:00
|
|
|
common --stamp --workspace_status_command=tools/workspace_status.sh
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# strip binaries for better reproducibility
|
2023-08-16 06:37:29 -04:00
|
|
|
common --strip=always
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# set build mode to opt by default (better reproducibility and performance)
|
2023-08-16 06:37:29 -04:00
|
|
|
common --compilation_mode=opt
|
2023-03-09 09:23:42 -05:00
|
|
|
|
2023-03-21 12:02:26 -04:00
|
|
|
# use pure go implementation of netdns
|
2023-08-16 06:37:29 -04:00
|
|
|
common --define=gotags=netgo
|
2023-03-21 12:02:26 -04:00
|
|
|
|
2023-03-09 09:23:42 -05:00
|
|
|
# enable tpm simulator for tests
|
|
|
|
test --//bazel/settings:tpm_simulator
|
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
# set registry flag alias
|
|
|
|
build --flag_alias=container_prefix=//bazel/settings:container_prefix
|
|
|
|
|
2023-05-30 03:05:36 -04:00
|
|
|
# set cli edition flag alias
|
|
|
|
build --flag_alias=cli_edition=//bazel/settings:cli_edition
|
|
|
|
|
2023-05-19 09:44:38 -04:00
|
|
|
# build only what is needed for tests
|
|
|
|
test --build_tests_only
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# bazel config for debug builds
|
2023-08-16 06:37:29 -04:00
|
|
|
common:debug --compilation_mode=dbg --strip=never
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# bazel configs to explicitly target a platform
|
2023-08-16 06:37:29 -04:00
|
|
|
common:host --platforms @local_config_platform//:host
|
|
|
|
common:linux_amd64 --platforms @zig_sdk//libc_aware/platform:linux_amd64_gnu.2.23
|
|
|
|
common:linux_arm64 --platforms @zig_sdk//libc_aware/platform:linux_arm64_gnu.2.23
|
|
|
|
common:linux_amd64_static --platforms @zig_sdk//libc_aware/platform:linux_amd64_musl
|
|
|
|
common:linux_arm64_static --platforms @zig_sdk//libc_aware/platform:linux_arm64_musl
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
# bazel config to explicitly disable stamping (hide version information at build time)
|
2023-08-16 06:37:29 -04:00
|
|
|
common:nostamp --nostamp --workspace_status_command=
|
2023-03-20 11:05:08 -04:00
|
|
|
|
|
|
|
# bazel config to use remote cache
|
2023-08-16 06:37:29 -04:00
|
|
|
common:remote_cache --bes_results_url=https://app.buildbuddy.io/invocation/
|
|
|
|
common:remote_cache --bes_backend=grpcs://remote.buildbuddy.io
|
|
|
|
common:remote_cache --remote_cache=grpcs://remote.buildbuddy.io
|
|
|
|
common:remote_cache --remote_timeout=3600
|
|
|
|
common:remote_cache --experimental_remote_build_event_upload=minimal
|
|
|
|
common:remote_cache --experimental_remote_cache_compression
|
|
|
|
common:remote_cache --nolegacy_important_outputs
|
|
|
|
common:remote_cache_readonly --noremote_upload_local_results # Uploads logs & artifacts without writing to cache
|
2023-03-20 13:21:47 -04:00
|
|
|
|
2023-04-27 05:52:02 -04:00
|
|
|
try-import %workspace%/.bazeloverwriterc
|