Skip to content

Commit 6962910

Browse files
committed
[build] Set up Bazel profile artifact
This makes it easier to track down Bazel build performance regressions.
1 parent c2e6797 commit 6962910

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/_bazel.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
# support. Since we still need symlinks to compile C++ code properly, compile these targets
114114
# separately.
115115
run: |
116-
bazel --nowindows_enable_symlinks build ${{ inputs.extra_bazel_args }} --config=ci --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev //src/wpt:wpt-all@tsproject //src/node:node@tsproject //src/pyodide:pyodide_static@tsproject
116+
bazel --nowindows_enable_symlinks build ${{ inputs.extra_bazel_args }} --config=ci --profile build-win-workaround.bazel-profile.gz --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev //src/wpt:wpt-all@tsproject //src/node:node@tsproject //src/pyodide:pyodide_static@tsproject
117117
- name: Bazel build
118118
# timestamps are no longer being added here, the GitHub logs include timestamps (Use
119119
# 'Show timestamps' on the web interface)
@@ -158,6 +158,12 @@ jobs:
158158
name: ${{ inputs.os_name }}-${{ inputs.arch_name }}${{ inputs.suffix }}-binary
159159
path: bazel-bin/src/workerd/server/workerd${{ runner.os == 'Windows' && '.exe' || '' }}
160160
if-no-files-found: error
161+
- name: Upload build statistics
162+
if: inputs.run_tests
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: ${{ inputs.os_name }}${{ inputs.arch_name }}${{ inputs.suffix }}-bazel-profile
166+
path: '*.bazel-profile.gz'
161167

162168
- name: Drop large Bazel cache files
163169
if: always()

build/ci.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ build:ci --color=yes
2323
# Indicate support for more terminal columns, 100 is the line length recommended by KJ style.
2424
build:ci --terminal_columns=100
2525

26+
# Emit build profile so that slow builds can be investigated
27+
build:ci --profile build.bazel-profile.gz
28+
test:ci --profile test.bazel-profile.gz
2629
test:ci --test_output=errors --test_summary=terse
2730
build:ci --disk_cache=~/bazel-disk-cache
2831

0 commit comments

Comments
 (0)