forked from dfinity/ic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bazelrc
155 lines (125 loc) · 7.25 KB
/
.bazelrc
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# To require no rustfmt issues, pass --config=fmt.
# To require no clippy issues, pass --config=clippy. Without this, warnings will still be generated.
# To enable both of the above, pass --config=lint.
# --config=ci implies --config=lint
build:ci --config=lint
# --config=lint implies both --config=fmt and --config=clippy.
build:lint --config=fmt
build:lint --config=clippy
# rust-clippy
build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:clippy --output_groups=+clippy_checks
build --@rules_rust//:clippy.toml=//:clippy.toml --@rules_rust//:clippy_flags=-D,warnings,-D,clippy::all,-D,clippy::mem_forget,-C,debug-assertions=off
# rustfmt
build:fmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build:fmt --output_groups=+rustfmt_checks
build --@rules_rust//:rustfmt.toml=//:rustfmt.toml
# https://github.com/bazelbuild/rules_rust/pull/2277 breaks our build in CI
# TODO(levsha): localise the problem and report to the upstream
build --@rules_rust//rust/settings:experimental_toolchain_generated_sysroot=False
build:ci --progress_report_interval=30
# Use hermetic JDK
# See https://bazel.build/docs/bazel-and-java#hermetic-testing
build --java_runtime_version=remotejdk_17
common --experimental_allow_tags_propagation
build --nosandbox_default_allow_network
build --incompatible_strict_action_env # use an environment with a static value for PATH and do not inherit LD_LIBRARY_PATH
# default to optimized and unstripped binaries.
build --compilation_mode=opt
build --@rules_rust//:extra_rustc_flags=-Cdebug-assertions=on
build --@rules_rust//:extra_rustc_flag=-Dbindings_with_variant_name
build --strip=never
build --strategy_regexp=ic-os/.*=local
build --remote_cache=bazel-remote.idx.dfinity.network
build --experimental_remote_cache_async
build --experimental_remote_cache_compression # If enabled, compress/decompress cache blobs with zstd.
build --remote_timeout=30s # Default is 60s.
build:ci --remote_timeout=5m # Default is 60s.
# TODO: re-enable after fixing the error like this:
# `Failed to fetch file with hash 'xxx' because it does not exist remotely. --remote_download_outputs=minimal does not work if your remote cache evicts files during builds.`
# Probably disabling `--experimental_remote_cache_async` will help
#build --remote_download_minimal # https://bazel.build/reference/command-line-reference#flag--remote_download_minimal
#build --remote_download_outputs=toplevel # Still download outputs from top level targets.
build --experimental_remote_downloader=bazel-remote.idx.dfinity.network --experimental_remote_downloader_local_fallback
build:local --experimental_remote_downloader=
# Does not produce valid JSON. See https://github.com/bazelbuild/bazel/issues/14209
build --execution_log_json_file=bazel-build-log.json
build:ci --build_event_binary_file=bazel-bep.pb
build --bes_results_url=https://dash.idx.dfinity.network/invocation/
build --bes_backend=bes.idx.dfinity.network
build --bes_timeout=30s # Default is no timeout.
build:ci --bes_timeout=180s # Default is no timeout.
build --experimental_remote_build_event_upload=minimal
build --remote_local_fallback
build --workspace_status_command=$(pwd)/bazel/workspace_status.sh
build --experimental_repository_downloader_retries=3 # https://bazel.build/reference/command-line-reference#flag--experimental_repository_downloader_retries
build --cxxopt='-std=c++17'
build --flag_alias=ic_version=//bazel:ic_version
build --flag_alias=ic_version_rc_only=//bazel:ic_version_rc_only
build --flag_alias=s3_endpoint=//gitlab-ci/src/artifacts:s3_endpoint
build --flag_alias=rc=//gitlab-ci/src/artifacts:rc
build --flag_alias=k8s=//rs/tests:k8s
# Exclude system tests by default
# https://github.com/bazelbuild/bazel/issues/8439
build --build_tag_filters="-system_test,-upload,-fuzz_test"
test --test_tag_filters="-system_test,-post_master,-fuzz_test"
test:alltests --test_tag_filters=""
test:paritytests --test_tag_filters="-system_test"
test:ci --test_tag_filters="-post_master,-system_test_hourly,-system_test_nightly,-system_test_nightly_nns,-system_test_staging,-system_test_hotfix,-fuzz_test"
test --test_output=errors
test --test_env=RUST_BACKTRACE=full
test:precommit --build_tests_only --test_tag_filters="smoke"
build:systest --build_tag_filters= --s3_endpoint=https://s3-upload.idx.dfinity.network
test:systest --test_output=streamed --test_tag_filters=
build:testnet --build_tag_filters= --s3_endpoint=https://s3-upload.idx.dfinity.network --ic_version_rc_only=
test:testnet --test_output=streamed --test_tag_filters=
# For sandboxed actions, mount an empty, writable directory at this absolute path
# (if supported by the sandboxing implementation, ignored otherwise).
test --sandbox_tmpfs_path=/tmp
# TODO(IDX-2374): enable alltests in CI when we will have actual system tests.
#test:ci --config=alltests
# Run all tests once by default, run flaky tests up to 3 times in CI.
test --flaky_test_attempts=1
test:ci --flaky_test_attempts=default
build:ci --noremote_local_fallback
build:ci --build_tag_filters="-system_test,-fuzz_test"
# So that developers can build in debug mode.
build:dev --compilation_mode=fastbuild
build:macos_ci --compilation_mode=fastbuild
build:macos_ci --build_tag_filters="-system_test,-fuzz_test"
# Run `bazel build ... --config=local` if you don't have access to the buildfarm infrastructure.
build:local --remote_cache=
build:local --bes_backend=
# A config to get faster compilation feedback by skipping code generation.
# We aim to do essentially the same thing as cargo check (https://doc.rust-lang.org/cargo/commands/cargo-check.html), which is to only emit metadata(.rmeta) files.
# We do this by combining pipelined compilation and requesting only metadata files via --output_groups.
#
# pipelined_compilation=True means that we now build and depend on metadata files(`.rmeta`s)
# For more information on what pipelined compilation is, see https://internals.rust-lang.org/t/evaluating-pipelined-rustc-compilation/10199
# TODO: consider always enabling this once we've confirmed it deterministically doesn't fail
build:check --@rules_rust//rust/settings:pipelined_compilation=True
# By requesting only the output group containing the metadata files, we don't run actions that do full compilation (e.g. codegen, linking)
# and instead only run the ones that output metadata files
build:check --output_groups=build_metadata
# Fuzzing configuration
build:fuzzing --action_env="SANITIZERS_ENABLED=1"
# sanitizers are only supported in nightly
build:fuzzing --@rules_rust//rust/toolchain/channel=nightly
build:fuzzing --build_tag_filters=fuzz_test
# Ignoring transitions for now since it doesn't add any additional improvement to current setup.
build:fuzzing --//bazel:enable_fuzzing_code=True
# AFL configuration
build:afl --action_env="AR=llvm-ar-17"
build:afl --action_env="AS=llvm-as-17"
build:afl --action_env="CC=afl-clang-lto"
build:afl --action_env="CXX=afl-clang-lto++"
build:afl --action_env="LD=afl-clang-lto++"
build:afl --action_env="LLVM_CONFIG=llvm-config-17"
build:afl --action_env="RANLIB=llvm-ranlib-17"
build:afl --config=fuzzing
build:afl --build_tag_filters=afl
build:afl --run_under="/ic/bin/afl_wrapper.sh"
# Suppress all additional output to make it more convenient in scripts
query --ui_event_filters=-info,-debug --noshow_progress
cquery --ui_event_filters=-info,-debug --noshow_progress
try-import %workspace%/user.bazelrc