Skip to content

Commit 6700d5e

Browse files
committed
fixup: migrate away from bzlmod
1 parent 548e304 commit 6700d5e

File tree

6 files changed

+32
-14
lines changed

6 files changed

+32
-14
lines changed

MODULE.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
bazel_dep(name = "rules_cc", version = "0.0.17")
22
bazel_dep(name = "bazel_skylib", version = "1.7.1")
3-
bazel_dep(name = "platforms", version = "0.0.10")
3+
bazel_dep(name = "platforms", version = "0.0.10")
4+
5+
# Fetch instrument_hooks via module extension (it doesn't have MODULE.bazel)
6+
instrument_hooks_ext = use_extension("//third_party:extensions.bzl", "instrument_hooks")
7+
use_repo(instrument_hooks_ext, "instrument_hooks")

WORKSPACE.bzlmod

Lines changed: 0 additions & 10 deletions
This file was deleted.

core/instrument-hooks

Submodule instrument-hooks deleted from b1e401a

examples/google_benchmark_bazel/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_binary")
2+
13
config_setting(
24
name = "windows",
35
constraint_values = ["@platforms//os:windows"],

third_party/BUILD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# This package contains BUILD files for third-party dependencies
1+
# This package contains BUILD files and extensions for third-party dependencies
22
# that don't have their own Bazel configuration
33

4-
exports_files(["instrument_hooks.BUILD"])
4+
exports_files([
5+
"instrument_hooks.BUILD",
6+
"extensions.bzl",
7+
])

third_party/extensions.bzl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Bazel module extensions for codspeed-cpp dependencies."""
2+
3+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
4+
5+
def _instrument_hooks_impl(module_ctx):
6+
git_repository(
7+
name = "instrument_hooks",
8+
remote = "https://github.com/CodSpeedHQ/instrument-hooks",
9+
commit = "b1e401a4d031ad308edb22ed59a52253a1ebe924",
10+
build_file = Label("//third_party:instrument_hooks.BUILD"),
11+
)
12+
return module_ctx.extension_metadata(
13+
reproducible = True,
14+
root_module_direct_deps = ["instrument_hooks"],
15+
root_module_direct_dev_deps = [],
16+
)
17+
18+
instrument_hooks = module_extension(
19+
implementation = _instrument_hooks_impl,
20+
)

0 commit comments

Comments
 (0)