Skip to content

Commit

Permalink
[build] Disable WebGPU for Windows non-release builds
Browse files Browse the repository at this point in the history
The Windows build is currently much slower than the macOS/Linux builds on CI,
especially on mostly cached builds.
Based on profiling on #2981, this is caused by the repo mapping stage for dawn
taking several minutes of Windows. Disable the experimental WebGPU feature on
Windows to better meet compile time constraints. Release builds remain
unaffected.
  • Loading branch information
fhanau committed Oct 26, 2024
1 parent 0b6df82 commit 111d118
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
8 changes: 6 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ build:windows --remote_download_all
# consider moving more flags out to separate files.
import %workspace%/build/ci.bazelrc

# Enable webgpu
build --//src/workerd/io:enable_experimental_webgpu=True
# Enable webgpu. Merely fetching the required Dawn library and computing the repo mapping based on
# it slows down the Windows build significantly, so only enable this on Unix and for Windows release
# builds. This is mostly motivated by compile time constraints, we hope to lift this limitation
# again if this Windows performance bottleneck gets fixed within Bazel.
build:unix --//src/workerd/io:enable_experimental_webgpu=True
build:release_windows --//src/workerd/io:enable_experimental_webgpu=True

# Avoid generating duplicate runfile trees. This will become the default in a future bazel version.
build --nolegacy_external_runfiles
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ jobs:
else
echo "Disk cache does not exist: ~/bazel-disk-cache"
fi
- name: Upload build statistics
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os.name }}${{ matrix.config.suffix }}-bazel-profile
path: |
build.bazel-profile
test.bazel-profile
- name: Bazel shutdown
# Check that there are no .bazelrc issues that prevent shutdown.
run: bazel shutdown
11 changes: 1 addition & 10 deletions build/BUILD.wpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
# Licensed under the Apache 2.0 license found in the LICENSE file or at:
# https://opensource.org/licenses/Apache-2.0

directories = glob(
["*"],
exclude = glob(
["*"],
exclude_directories = 1,
) + [
".*",
],
exclude_directories = 0,
)
directories = ["url"]

[filegroup(
name = dir,
Expand Down
4 changes: 4 additions & 0 deletions build/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ build:ci --show_progress_rate_limit=1
build:ci --color=yes
# Indicate support for more terminal columns, 100 is the line length recommended by KJ style.
build:ci --terminal_columns=100

# Emit build profile so that slow builds can be investigated
build:ci --profile build.bazel-profile
test:ci --profile test.bazel-profile
3 changes: 1 addition & 2 deletions src/wpt/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
filegroup(
name = "wpt-test-harness",
srcs = glob(
include = ["**/*"],
allow_empty = True,
include = ["*.js"],
),
visibility = ["//visibility:public"],
)

0 comments on commit 111d118

Please sign in to comment.