Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
node_modules

# Nested modules
build/google-benchmark
build/perfetto
build/workerd-v8
2 changes: 1 addition & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Run benchmarks
runs-on: ubuntu-22.04
env:
BAZEL_ARGS: --config=benchmark --@codspeed//core:codspeed_mode=instrumentation --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev
BAZEL_ARGS: --config=benchmark --@workerd-google-benchmark//:codspeed_mode=instrumentation --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev
steps:
- uses: actions/checkout@v4
with:
Expand Down
18 changes: 0 additions & 18 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ load("//:build/rust_toolchains.bzl", "rust_toolchains")

rust_toolchains()

# Tell workerd code where to find google-benchmark with CodSpeed.
#
# We indirect through `@workerd-google-benchmark` to allow dependents to override how and where
# google-benchmark is built, similar to the v8 setup above.
new_local_repository(
name = "workerd-google-benchmark",
build_file_content = """cc_library(
name = "benchmark",
deps = [ "@codspeed//google_benchmark:benchmark" ],
visibility = ["//visibility:public"])

cc_library(
name = "benchmark_main",
deps = [ "@codspeed//google_benchmark:benchmark_main" ],
visibility = ["//visibility:public"])""",
path = "empty",
)

# rust-based lolhtml dependency, including the API header.
# Presented as a separate repository to allow overrides.
new_local_repository(
Expand Down
7 changes: 0 additions & 7 deletions build/deps/build_deps.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
"file_regex": "^cargo-bazel-x86_64-pc-windows-msvc.exe$",
"file_type": "executable",
"downloaded_file_path": "downloaded.exe"
},
// microbenchmark
{
"name": "codspeed",
"type": "github_release",
"owner": "CodSpeedHQ",
"repo": "codspeed-cpp"
}
]
}
2 changes: 0 additions & 2 deletions build/deps/gen/build_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ load("@//build/deps:gen/dep_cargo_bazel_linux_x64.bzl", "dep_cargo_bazel_linux_x
load("@//build/deps:gen/dep_cargo_bazel_macos_arm64.bzl", "dep_cargo_bazel_macos_arm64")
load("@//build/deps:gen/dep_cargo_bazel_macos_x64.bzl", "dep_cargo_bazel_macos_x64")
load("@//build/deps:gen/dep_cargo_bazel_win_x64.bzl", "dep_cargo_bazel_win_x64")
load("@//build/deps:gen/dep_codspeed.bzl", "dep_codspeed")
load("@//build/deps:gen/dep_rules_rust.bzl", "dep_rules_rust")

def deps_gen():
Expand All @@ -15,4 +14,3 @@ def deps_gen():
dep_cargo_bazel_macos_x64()
dep_cargo_bazel_macos_arm64()
dep_cargo_bazel_win_x64()
dep_codspeed()
18 changes: 0 additions & 18 deletions build/deps/gen/dep_codspeed.bzl

This file was deleted.

10 changes: 10 additions & 0 deletions build/deps/v8.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ local_path_override(
module_name = "workerd-v8",
path = "build/workerd-v8",
)

# Tell workerd code where to find google-benchmark with CodSpeed.
#
# We indirect through `@workerd-google-benchmark` to allow dependents to override how and where
# google-benchmark is built, similar to the v8 setup above.
bazel_dep(name = "workerd-google-benchmark")
local_path_override(
module_name = "workerd-google-benchmark",
path = "build/google-benchmark",
)
16 changes: 16 additions & 0 deletions build/google-benchmark/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package(default_visibility = ["//visibility:public"])

cc_library(
name = "benchmark",
deps = ["@codspeed//google_benchmark:benchmark"],
)

cc_library(
name = "benchmark_main",
deps = ["@codspeed//google_benchmark:benchmark_main"],
)

alias(
name = "codspeed_mode",
actual = "@codspeed//core:codspeed_mode",
)
16 changes: 16 additions & 0 deletions build/google-benchmark/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module(name = "workerd-google-benchmark")

bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.8")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "codspeed",
url = "https://api.github.com/repos/CodSpeedHQ/codspeed-cpp/tarball/v1.2.0",
patches = ["codspeed_pr_21.patch"],
strip_prefix = "CodSpeedHQ-codspeed-cpp-719c41f",
type = "tgz",
sha256 = "1ced2c2e813313a574f41de9a218f38b53a4114cf7e72ee286801eaba6d8b240",
)
10 changes: 10 additions & 0 deletions build/google-benchmark/codspeed_pr_21.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- core/BUILD
+++ core/BUILD
@@ -67,6 +67,7 @@ string_flag(
"instrumentation",
"walltime",
],
+ visibility = ["//visibility:public"],
)

config_setting(