-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy path.bazelrc
More file actions
94 lines (81 loc) · 6.64 KB
/
.bazelrc
File metadata and controls
94 lines (81 loc) · 6.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Do not edit this file without a review from @DataDog/agent-build
# ADMS config ----------------------------------------------------------------------------------------------------------
# Ensure access to DataDog internal artifact repositories in CI
import %workspace%/.adms/adms.bazelrc
# Use --config=adms to use adms for upstream dependency caching.
# TOOD: rename dd-internal in the .adms tree to adms-internal. That
# will be easier to understand.
common:adms --config=dd-internal
# Startup options ------------------------------------------------------------------------------------------------------
startup --max_idle_secs=28800 # Keep the server alive for at most 8 hours of inactivity
# Common options -------------------------------------------------------------------------------------------------------
common --@rules_python//python/config_settings:bootstrap_impl=script # https://github.com/bazel-contrib/rules_python/blob/main/BZLMOD_SUPPORT.md
common --check_direct_dependencies=error # Escalate any bypassed `bazel_dep` to a resolution failure
common --enable_platform_specific_config # Supported OS identifiers are linux, macos, windows, freebsd, and openbsd
common --experimental_disk_cache_gc_max_size=5G # Cap applied whenever --disk_cache is also set, no-op otherwise
common --experimental_strict_repo_env # Do not leak uncontrolled environment variables into repository rules
common --experimental_ui_max_stdouterr_bytes=1073741819 # why?
common --http_timeout_scaling=3.0 # At least one attempt reaches 30s (3,6,12,24,30,30,30,30) instead of only 10s (1,2,4,8,10,10,10,10)
common --repo_env=DEPLOY_AGENT # Keep in sync with env_vars in MODULE.bazel
common --repo_env=FORCED_PACKAGE_COMPRESSION_LEVEL # Keep in sync with env_vars in MODULE.bazel
common --repo_env=GOCACHE # https://pkg.go.dev/cmd/go#hdr-Build_and_test_caching
common --repo_env=GOMODCACHE # https://wiki.archlinux.org/title/XDG_Base_Directory#Partial
common --repo_env=PACKAGE_VERSION # Keep in sync with env_vars in MODULE.bazel
common --repo_env=SIGN_MAC # Keep in sync with env_vars in MODULE.bazel
common --repo_env=XDG_CACHE_HOME # https://wiki.archlinux.org/title/XDG_Base_Directory
common --skip_incompatible_explicit_targets # Let target_compatible_with skip rather than fail
common --test_output=errors # Print test errors to console output instead of only capturing them in buried test.log
common --verbose_failures
# Lint config (static code analyzers) ----------------------------------------------------------------------------------
# Go -TODO(agent-build)
# Python -TODO(agent-build)
# Rust
common:lint --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect --output_groups=+clippy_checks
common:lint --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect --output_groups=+rustfmt_checks
# Linux config ---------------------------------------------------------------------------------------------------------
common:linux --credential_helper=*.us1.ddbuild.io=%workspace%/bazel/tools/credential-helper
common:linux --strategy=sandboxed
# macOS config ---------------------------------------------------------------------------------------------------------
common:macos --credential_helper=*.us1.ddbuild.io=%workspace%/bazel/tools/credential-helper
common:macos --features=-macos_default_link_flags # https://github.com/bazelbuild/bazel/issues/23312
common:macos --macos_minimum_os=12.0 # Keep in sync with https://docs.datadoghq.com/agent/supported_platforms/?tab=macos
common:macos --strategy=sandboxed
# Windows config -------------------------------------------------------------------------------------------------------
common:windows --credential_helper=*.us1.ddbuild.io=%workspace%/bazel/tools/credential-helper.bat
common:windows --strategy=standalone # Valid values are: [dynamic_worker, standalone, dynamic, remote, worker, local]
# rules_python 1.9.0 transitions enable_runfiles to `true` for every py_ target on Windows. Pre-setting it here makes
# that transition a no-op, so Bazel deduplicates python_win and avoids 2 concurrent MSBuild racing on shared resources.
common:windows --enable_runfiles
common:windows --repo_env=BAZEL_SH=C:/tools/msys64/usr/bin/bash.exe # for https://github.com/bazelbuild/bazel/pull/26927
common:windows --repo_env=PIP_CACHE_DIR # https://pip.pypa.io/en/stable/topics/caching/#default-paths
common:windows --repo_env=SYSTEMDRIVE # needed by vswhere to locate the VS installer instance database
common:windows --repo_env=SYSTEMROOT # used by COM to load system DLLs, needed by vswhere
common:windows --repo_env=USERPROFILE # used by MSYS2 bash to emulate HOME, needed by git to fetch repositories
common:windows --repo_env=VSTUDIO_ROOT # visual_studio(path_variable) in MODULE.bazel
common:windows --shell_executable=C:/tools/msys64/usr/bin/bash.exe
# Remote cache config --------------------------------------------------------------------------------------------------
# datadog-agent virtually isolates caching instance from its parent (which is remote-caching).
# If entry isn't found in datadog-agent, it will be searched in remote-caching.
common:cache --remote_cache=grpcs://buildbarn-frontend.us1.ddbuild.io:443
common:cache --remote_instance_name=ci/datadog-agent
common:cache --remote_local_fallback # best-effort on transient connection errors (no such host)
common:cache --incompatible_remote_local_fallback_for_remote_cache # works only if --remote_local_fallback is also set
common:cache --remote_retries=1
common:cache --remote_timeout=60
# CI config ------------------------------------------------------------------------------------------------------------
common:ci --config=adms
common:ci --config=cache
common:ci --config=lint
common:ci --noexperimental_convenience_symlinks # not CI-suitable: "These symlinks are only for the user's convenience"
# Project/Language configs --------------------------------------------------------------------------------------
import %workspace%/bazel/configs/rust.bazelrc
# Global release config ------------------------------------------------------------------------------------------------
# This should aggregate all the release configs for all the languages with enabled optimizations,
# stripping, etc. It does not strictly mean that this build is the one to be released as a product.
# It just selects all the flags we should use on product builds. For example, we need to build with
# optimization and compress packages in CI so that we can run performance and size gates, even
# though we will never release that instance of the package to customers.
common:release --config=rust-release
common:release --//:release
# Local development options --------------------------------------------------------------------------------------------
try-import %workspace%/user.bazelrc