Skip to content

Commit 6117cb2

Browse files
committed
fixup: migrate away from bzlmod
1 parent 548e304 commit 6117cb2

File tree

5 files changed

+31
-11
lines changed

5 files changed

+31
-11
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("//bazel:extensions.bzl", "instrument_hooks")
7+
use_repo(instrument_hooks_ext, "instrument_hooks")

WORKSPACE.bzlmod

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

bazel/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This package contains Bazel module extensions
2+
3+
exports_files(["extensions.bzl"])

bazel/extensions.bzl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
"""Fetches instrument_hooks repository."""
7+
git_repository(
8+
name = "instrument_hooks",
9+
remote = "https://github.com/CodSpeedHQ/instrument-hooks",
10+
commit = "b1e401a4d031ad308edb22ed59a52253a1ebe924",
11+
build_file = Label("//third_party:instrument_hooks.BUILD"),
12+
)
13+
return module_ctx.extension_metadata(
14+
reproducible = True,
15+
root_module_direct_deps = ["instrument_hooks"],
16+
root_module_direct_dev_deps = [],
17+
)
18+
19+
instrument_hooks = module_extension(
20+
implementation = _instrument_hooks_impl,
21+
)

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"],

0 commit comments

Comments
 (0)