File
Blob: build/ci.bazelrc
| 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. |
| 4 | build:ci --keep_going |
| 5 | build: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. |
| 11 | build:ci --jobs=64 |
| 12 | # Do not check for changes in external repository files, should speed up bazel invocations after the first one |
| 13 | build: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 |
| 17 | build:ci --nobuild_runfile_links |
| 18 | # Rate limit progress updates for smaller logs, default is 0.2 which leads to very frequent updates. |
| 19 | build:ci --show_progress_rate_limit=3 |
| 20 | # Enable color output |
| 21 | build:ci --color=yes |
| 22 | # Indicate support for more terminal columns, 100 is the line length recommended by KJ style. |
| 23 | build:ci --terminal_columns=100 |
| 24 | |
| 25 | # Emit build profile so that slow builds can be investigated |
| 26 | build:ci --profile build.bazel-profile.gz |
| 27 | test:ci --profile test.bazel-profile.gz |
| 28 | test:ci --test_output=errors --test_summary=terse |
| 29 | build:ci --disk_cache=~/bazel-disk-cache |
| 30 | |
| 31 | # test CI jobs don't need any top-level artifacts and just verify things |
| 32 | build: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. |
| 45 | build:ci-disable-benchmarks --build_tag_filters=-off-by-default,-requires-container-engine,-workerd-benchmark |
| 46 | test:ci-disable-benchmarks --test_tag_filters=-off-by-default,-requires-fuzzilli,-requires-container-engine,-workerd-benchmark |
| 47 | build:ci-limit-storage --config=ci-disable-benchmarks |
| 48 | build:ci-limit-storage --copt="-g1" |
| 49 | build:ci-limit-storage --copt="-fno-standalone-debug" |
| 50 | |
| 51 | |
| 52 | # ci-platform dependent configuration |
| 53 | |
| 54 | build:ci-linux-common --copt='-Werror' |
| 55 | build:ci-linux-common --copt='-Wno-error=#warnings' |
| 56 | build:ci-linux-common --copt='-Wno-error=deprecated-declarations' |
| 57 | # keep in sync with .github/workflows/test.yml |
| 58 | build:ci-linux-common --repo_env=CC=/usr/lib/llvm-19/bin/clang |
| 59 | |
| 60 | build:ci-linux --config=ci-linux-common --remote_download_regex=".*src/workerd/server/workerd.*" |
| 61 | build:ci-linux-arm --config=ci-linux-common |
| 62 | |
| 63 | build:ci-linux-debug --config=ci-linux-common --config=ci-limit-storage |
| 64 | build:ci-linux-debug --config=debug --config=rust-debug |
| 65 | |
| 66 | build:ci-linux-arm-debug --config=ci-linux-debug |
| 67 | |
| 68 | build: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 |
| 71 | build:ci-linux-asan --config=asan --copt="-g0" --strip=always |
| 72 | build:ci-linux-arm-asan --config=ci-linux-asan |
| 73 | |
| 74 | # Build container tests on Linux CI |
| 75 | build:ci-linux --build_tag_filters=-off-by-default |
| 76 | build:ci-linux-arm --build_tag_filters=-off-by-default |
| 77 | |
| 78 | build:ci-macOS --config=ci-disable-benchmarks |
| 79 | |
| 80 | build: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 |
| 83 | test: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 |
| 87 | build:ci-windows --config=release_windows |
| 88 | build: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. |
| 93 | test:ci-linux --test_size_filters= |
| 94 | test:ci-macOS --test_size_filters= |
| 95 | test:ci-windows --test_size_filters= |
| 96 | |
| 97 | # Run container tests on Linux CI |
| 98 | test:ci-linux --test_tag_filters=-off-by-default,-requires-fuzzilli |
| 99 | test:ci-linux-arm --test_tag_filters=-off-by-default,-requires-fuzzilli |
| 100 | |
| 101 | # Enable reporting whenever WPT tests are run |
| 102 | test:ci-test --config=wpt-test |
| 103 | common:wpt-test --test_env=GEN_TEST_REPORT=1 |
| 104 | common: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. |
| 107 | common:wpt-report --remote_download_regex=".*src/wpt/.*" |
| 108 | |
| 109 | # Let tests know they're running in CI |
| 110 | test: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. |
| 114 | build:ci-release --remote_download_minimal --remote_download_regex=".*src/workerd/server/workerd.*" |