Skip to content

Commit 79a7661

Browse files
authored
Merge pull request #5796 from cloudflare/dlapid/ci-improvements
Improve CI build performance, especially on macOS
2 parents 413a412 + 3e9c1da commit 79a7661

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
[
3636
{ name: linux, arch: X64, image: ubuntu-22.04 },
3737
{ name: linux-arm, arch: ARM64, image: ubuntu-22.04-arm },
38-
{ name: macOS, arch: ARM64, image: macos-15 },
38+
{ name: macOS, arch: ARM64, image: macos-15, use_lld: true },
3939
{ name: windows, arch: X64, image: windows-2025 },
4040
]
4141
config: [
@@ -76,6 +76,7 @@ jobs:
7676
arch_name: ${{ matrix.os.arch }}
7777
suffix: ${{ matrix.config.suffix }}
7878
extra_bazel_args: '--config=ci-test --config=ci-${{matrix.os.name}}${{matrix.config.suffix}}'
79+
macos_use_lld: ${{ matrix.os.use_lld || false }}
7980
secrets:
8081
BAZEL_CACHE_KEY: ${{ secrets.BAZEL_CACHE_KEY }}
8182
WORKERS_MIRROR_URL: ${{ secrets.WORKERS_MIRROR_URL }}

build/ci.bazelrc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ build:ci --verbose_failures
99
# increasing this closer towards the suggested value of 200. Note the number of maximum build jobs
1010
# is controlled by the --local_resources=cpu flag and still limited to the number of cores by
1111
# default.
12-
# TODO (build perf): Temporarily setting this to 8, that might help with CI freezing on macOS
13-
# release jobs?
14-
build:ci --jobs=8
12+
build:ci --jobs=32
1513
# Do not check for changes in external repository files, should speed up bazel invocations after the first one
1614
build:ci --noexperimental_check_external_repository_files
1715
# Only build runfile trees when needed. Runfile trees are useful for directly invoking bazel-built
@@ -64,8 +62,8 @@ build:ci-linux-common --copt='-Wno-error=deprecated-declarations'
6462
build:ci-linux-common --action_env=CC=/usr/lib/llvm-19/bin/clang
6563
build:ci-linux-common --host_action_env=CC=/usr/lib/llvm-19/bin/clang
6664

67-
build:ci-linux --config=ci-linux-common --remote_download_regex=".*src/workerd/server/workerd.*"
68-
build:ci-linux-arm --config=ci-linux-common
65+
build:ci-linux --config=ci-linux-common --config=ci-limit-storage --remote_download_regex=".*src/workerd/server/workerd.*"
66+
build:ci-linux-arm --config=ci-linux-common --config=ci-limit-storage
6967

7068
build:ci-linux-debug --config=ci-linux-common --config=ci-limit-storage
7169
build:ci-linux-debug --config=debug --config=rust-debug
@@ -82,14 +80,11 @@ build:ci-linux-arm-asan --config=ci-linux-asan
8280
test:ci-linux --build_tag_filters=-off-by-default
8381
test:ci-linux-arm --build_tag_filters=-off-by-default
8482

85-
# Speculatively disable asynchronous remote cache uploads on macOS to debug CI job freezes. This is
86-
# a no-op when remote caching is disabled, so we can always enable it on macOS.
87-
build:macos --noremote_cache_async
88-
8983
# Unlike the bazel Unix toolchain the macOS toolchain sets "-O0 -DDEBUG" for fastbuild by
9084
# default. This is unhelpful for compile speeds and test performance, remove the DEBUG
9185
# define.
9286
build:ci-macOS --copt=-UDEBUG
87+
build:ci-macOS --config=ci-limit-storage
9388

9489
build:ci-macOS-debug --config=debug
9590

types/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ js_binary(
3131
":types_lib",
3232
],
3333
entry_point = "scripts/build-types.js",
34+
tags = ["manual"],
3435
)
3536

3637
js_run_binary(
@@ -43,6 +44,9 @@ js_run_binary(
4344
],
4445
out_dirs = ["definitions"],
4546
silent_on_success = False, # Always enable logging for debugging
47+
# Exclude from wildcard builds (//...) - type generation is expensive and only needed
48+
# for the check-snapshot job which explicitly builds //types.
49+
tags = ["manual"],
4650
tool = ":build_types_bin",
4751
visibility = ["//visibility:public"],
4852
)
@@ -54,6 +58,7 @@ js_binary(
5458
],
5559
entry_point = "scripts/build-worker.js",
5660
node_options = ["--enable-source-maps"],
61+
tags = ["manual"],
5762
)
5863

5964
js_run_binary(
@@ -72,6 +77,8 @@ js_run_binary(
7277
exclude = ["src/cli/**/*"],
7378
),
7479
outs = ["dist/index.mjs"],
80+
# Only used by //types:types which is also manual
81+
tags = ["manual"],
7582
tool = ":build_worker_bin",
7683
)
7784

0 commit comments

Comments
 (0)