Skip to content
File

Blob: build/ci.bazelrc

5.7 KB
1# CI-only configuration. Some of these settings are inspired by bazel-lib https://github.com/bazel-contrib/bazel-lib/blob/v2.9.3/.aspect/bazelrc/ci.bazelrc
2# Not all shared options in the GitHub CI are ported since we use a different remote cache setup for
3# internal CI.
4build:ci --keep_going
5build:ci --verbose_failures
6# Use a higher jobs level to effectively fetch from CPU and and use the remote cache at the same
7# time, see https://github.com/bazelbuild/bazel/issues/6394. This is still a relatively small number
8# and should work for the CI runners we use, if we switch to bigger runners consider increasing this
9# closer towards the suggested value of 200. Note the number of maximum build jobs is controlled by
10# the --local_resources=cpu flag and still limited to the number of cores by default.
11build:ci --jobs=64
12# Do not check for changes in external repository files, should speed up bazel invocations after the first one
13build:ci --noexperimental_check_external_repository_files
14# Only build runfile trees when needed. Runfile trees are useful for directly invoking bazel-built
15# binaries, but not needed otherwise. Building runfile trees is slow on systems with slow disk I/O,
16# so avoid doing so where we can. https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
17build:ci --nobuild_runfile_links
18# Rate limit progress updates for smaller logs, default is 0.2 which leads to very frequent updates.
19build:ci --show_progress_rate_limit=3
20# Enable color output
21build:ci --color=yes
22# Indicate support for more terminal columns, 100 is the line length recommended by KJ style.
23build:ci --terminal_columns=100
24 
25# Emit build profile so that slow builds can be investigated
26build:ci --profile build.bazel-profile.gz
27test:ci --profile test.bazel-profile.gz
28test:ci --test_output=errors --test_summary=terse
29build:ci --disk_cache=~/bazel-disk-cache
30 
31# test CI jobs don't need any top-level artifacts and just verify things
32build:ci-test --remote_download_minimal
33 
34# limit storage usage on ci
35# Exclude large benchmarking binaries created in debug and asan configurations to avoid
36# running out of disk space on the runner (nominally 14GB). We typically have two copies
37# of generated artifacts: one under bazel output-base and one in the bazel disk cache.
38# Also only generate limited debug info โ€“ these binaries are only used for testing and
39# don't need to run within a debugger, so information needed for symbolication is
40# sufficient. The host configuration compiles in opt mode/without debug info by default, so
41# there's no need to set host_copt here.
42# LLVM produces a bit more debug info on macOS by default to facilitate debugging with
43# LLDB. This is not needed for this use case, so disable it using -fno-standalone-debug โ€“
44# this is already the default for Linux/Windows.
45build:ci-disable-benchmarks --build_tag_filters=-off-by-default,-requires-container-engine,-workerd-benchmark
46test:ci-disable-benchmarks --test_tag_filters=-off-by-default,-requires-fuzzilli,-requires-container-engine,-workerd-benchmark
47build:ci-limit-storage --config=ci-disable-benchmarks
48build:ci-limit-storage --copt="-g1"
49build:ci-limit-storage --copt="-fno-standalone-debug"
50 
51 
52# ci-platform dependent configuration
53 
54build:ci-linux-common --copt='-Werror'
55build:ci-linux-common --copt='-Wno-error=#warnings'
56build:ci-linux-common --copt='-Wno-error=deprecated-declarations'
57# keep in sync with .github/workflows/test.yml
58build:ci-linux-common --repo_env=CC=/usr/lib/llvm-19/bin/clang
59 
60build:ci-linux --config=ci-linux-common --remote_download_regex=".*src/workerd/server/workerd.*"
61build:ci-linux-arm --config=ci-linux-common
62 
63build:ci-linux-debug --config=ci-linux-common --config=ci-limit-storage
64build:ci-linux-debug --config=debug --config=rust-debug
65 
66build:ci-linux-arm-debug --config=ci-linux-debug
67 
68build:ci-linux-asan --config=ci-linux-common --config=ci-limit-storage
69# we're really struggling to fit asan build into worker disk size
70# having asan without symbols is better than none
71build:ci-linux-asan --config=asan --copt="-g0" --strip=always
72build:ci-linux-arm-asan --config=ci-linux-asan
73 
74# Build container tests on Linux CI
75build:ci-linux --build_tag_filters=-off-by-default
76build:ci-linux-arm --build_tag_filters=-off-by-default
77 
78build:ci-macOS --config=ci-disable-benchmarks
79 
80build:ci-macOS-debug --config=debug
81 
82# Unfortunately on macOS, we need to be able to invoke sudo to configure the network for sidecar tests
83test:ci-macOS --spawn_strategy=local
84 
85# Windows CI always runs in the release configuration to prevent breaking the release build.
86# build:ci-windows --config=windows_no_dbg
87build:ci-windows --config=release_windows
88build:ci-windows-debug --config=debug
89 
90# Some tests (like Python import tests) take a long time to run, especially when debug is enabled
91# For that reason, we only run them in the default configuration for each platform to minimize
92# effect on CI pipeline runtime.
93test:ci-linux --test_size_filters=
94test:ci-macOS --test_size_filters=
95test:ci-windows --test_size_filters=
96 
97# Run container tests on Linux CI
98test:ci-linux --test_tag_filters=-off-by-default,-requires-fuzzilli
99test:ci-linux-arm --test_tag_filters=-off-by-default,-requires-fuzzilli
100 
101# Enable reporting whenever WPT tests are run
102test:ci-test --config=wpt-test
103common:wpt-test --test_env=GEN_TEST_REPORT=1
104common:wpt-test --test_env=GEN_TEST_STATS=1
105 
106# Config to produce a full WPT report. Also ensures that test targets are fetched, even under remote_download_minimal.
107common:wpt-report --remote_download_regex=".*src/wpt/.*"
108 
109# Let tests know they're running in CI
110test:ci-test --test_env=CI=true
111 
112# release CI โ€“ use remote_download_minimal, but always fetch the workerd binary so we can add it to
113# the release artifacts.
114build:ci-release --remote_download_minimal --remote_download_regex=".*src/workerd/server/workerd.*"