Skip to content

Commit 9f9cfee

Browse files
feat: prepare repository for BCR release
1 parent c66d550 commit 9f9cfee

File tree

10 files changed

+77
-144
lines changed

10 files changed

+77
-144
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
build --//core:codspeed_mode=instrumentation
1+
build --@codspeed_core//:codspeed_mode=instrumentation
22
build --compilation_mode=dbg
33
build --copt=-O2
44

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ jobs:
118118

119119
- name: Build benchmark example
120120
run: |
121-
bazel build //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }} --//core:strict_warnings=on
121+
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on
122122
123123
- name: Run the benchmarks
124124
uses: CodSpeedHQ/action@main
125125
if: matrix.codspeed-mode != 'off'
126126
with:
127127
mode: ${{ matrix.codspeed-mode }}
128-
run: bazel run //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }} --//core:strict_warnings=on
128+
run: bazel run //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on
129129
token: ${{ secrets.CODSPEED_TOKEN }}
130130

131131
cmake-build:
@@ -193,4 +193,4 @@ jobs:
193193

194194
- name: Build benchmark example
195195
run: |
196-
bazel build //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }} --//core:strict_warnings=on
196+
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on

MODULE.bazel

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
# This MODULE.bazel is for local development in the monorepo.
2+
# Individual modules have their own MODULE.bazel files.
3+
14
bazel_dep(name = "rules_cc", version = "0.0.17")
25
bazel_dep(name = "bazel_skylib", version = "1.7.1")
36
bazel_dep(name = "platforms", version = "0.0.10")
4-
bazel_dep(name = "instrument_hooks", version = "1.0.0")
57

6-
git_override(
7-
module_name = "instrument_hooks",
8-
commit = "42ed74076c697c2f06c5ac81a84ccee983d7f140",
9-
remote = "https://github.com/CodSpeedHQ/instrument-hooks",
8+
# Local path overrides for development - these point to the subdirectories
9+
# When published to BCR, users will get the published versions instead
10+
bazel_dep(name = "codspeed_core")
11+
local_path_override(
12+
module_name = "codspeed_core",
13+
path = "core",
14+
)
15+
16+
bazel_dep(name = "codspeed_google_benchmark_compat")
17+
local_path_override(
18+
module_name = "codspeed_google_benchmark_compat",
19+
path = "google_benchmark",
1020
)

MODULE.bazel.lock

Lines changed: 36 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
22
load("@rules_cc//cc:defs.bzl", "cc_library")
33

4-
CODSPEED_VERSION = "1.2.0"
4+
CODSPEED_VERSION = module_version()
55

66
config_setting(
77
name = "windows",

core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.10)
22

3-
set(CODSPEED_VERSION 1.2.0)
3+
set(CODSPEED_VERSION 1.4.0)
44

55
project(codspeed VERSION ${CODSPEED_VERSION} LANGUAGES CXX C)
66

core/MODULE.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module(
2+
name = "codspeed_core",
3+
version = "1.4.0",
4+
)
5+
6+
bazel_dep(name = "rules_cc", version = "0.0.17")
7+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
8+
bazel_dep(name = "platforms", version = "0.0.10")

examples/google_benchmark_bazel/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ cc_binary(
1313
"//conditions:default": ["-Wall", "-Wextra", "-Werror"],
1414
}),
1515
deps = [
16-
"//google_benchmark:benchmark",
16+
"@codspeed_google_benchmark_compat//:benchmark"
1717
],
1818
)

google_benchmark/BUILD.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
22

33
licenses(["notice"])
44

5+
# Re-export codspeed_mode from core for easier consumer access
6+
alias(
7+
name = "codspeed_mode",
8+
actual = "@codspeed_core//:codspeed_mode",
9+
visibility = ["//visibility:public"],
10+
)
11+
512
COPTS = [
613
"-pedantic",
714
"-pedantic-errors",
@@ -77,7 +84,7 @@ cc_library(
7784
"_LARGEFILE_SOURCE",
7885
],
7986
visibility = ["//visibility:public"],
80-
deps = ["//core:codspeed"] + select({
87+
deps = ["@codspeed_core//:codspeed"] + select({
8188
":perfcounters": ["@libpfm"],
8289
"//conditions:default": [],
8390
}),

google_benchmark/MODULE.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module(
2-
name = "google_benchmark",
3-
version = "1.9.1",
2+
name = "codspeed_google_benchmark_compat",
3+
version = "1.4.0",
44
)
55

6+
bazel_dep(name = "codspeed_core", version = "1.4.0")
67
bazel_dep(name = "bazel_skylib", version = "1.7.1")
78
bazel_dep(name = "platforms", version = "0.0.10")
89
bazel_dep(name = "rules_cc", version = "0.0.9")

0 commit comments

Comments
 (0)