Skip to content

Commit afed61c

Browse files
committed
Update BUILD files to work with bazel 9.
For now though pin bazel version to 8.5.1 since some of our deps (brotli, riegeli) are not yet compatible with bazel 9.
1 parent 4329294 commit afed61c

File tree

20 files changed

+352
-273
lines changed

20 files changed

+352
-273
lines changed

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.5.1

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
- name: Install bazelisk
1111
run: |
12-
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
12+
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-amd64"
1313
mkdir -p "${GITHUB_WORKSPACE}/bin/"
1414
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
1515
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"

MODULE.bazel

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ module(
55

66
# Bazel Modules
77

8-
bazel_dep(name = "googletest", version = "1.17.0")
9-
bazel_dep(name = "abseil-cpp", version = "20250814.0")
10-
bazel_dep(name = "protobuf", version = "32.0")
8+
bazel_dep(name = "rules_cc", version = "0.2.16")
9+
bazel_dep(name = "rules_python", version = "1.8.0")
10+
11+
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
12+
bazel_dep(name = "abseil-cpp", version = "20260107.0")
13+
bazel_dep(name = "protobuf", version = "33.4")
1114
bazel_dep(name = "riegeli", version = "0.0.0-20250822-9f2744d")
12-
bazel_dep(name = "rules_proto", version = "7.1.0")
1315
bazel_dep(name = "platforms", version = "1.0.0")
14-
bazel_dep(name = "rules_rust", version = "0.64.0")
15-
bazel_dep(name = "glib", version = "2.82.2.bcr.5")
16-
bazel_dep(name = "brotli", version = "1.1.0")
16+
bazel_dep(name = "rules_rust", version = "0.68.1")
17+
bazel_dep(name = "glib", version = "2.82.2.bcr.7")
18+
bazel_dep(name = "brotli", version = "1.2.0")
1719

1820
# Frequency Data
1921
bazel_dep(name = "ift_encoder_data", version = "git")

brotli/BUILD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
3+
14
cc_library(
25
name = "encoding",
36
srcs = [
@@ -20,8 +23,8 @@ cc_library(
2023
],
2124
deps = [
2225
"//common",
23-
"@brotli//:brotlienc",
2426
"@abseil-cpp//absl/types:span",
27+
"@brotli//:brotlienc",
2528
],
2629
)
2730

@@ -52,8 +55,8 @@ cc_test(
5255
deps = [
5356
":encoding",
5457
"//common",
55-
"@brotli//:brotlienc",
5658
"@abseil-cpp//absl/types:span",
59+
"@brotli//:brotlienc",
5760
"@googletest//:gtest_main",
5861
],
5962
)

common/BUILD

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,64 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
3+
14
cc_library(
25
name = "common",
36
srcs = [
7+
"axis_range.cc",
48
"bit_input_buffer.cc",
59
"bit_input_buffer.h",
610
"bit_output_buffer.cc",
711
"bit_output_buffer.h",
812
"brotli_binary_diff.cc",
913
"brotli_binary_patch.cc",
14+
"compat_id.cc",
15+
"compat_id.h",
1016
"file_font_provider.cc",
1117
"font_helper.cc",
1218
"hb_set_unique_ptr.cc",
13-
"sparse_bit_set.cc",
14-
"axis_range.cc",
1519
"indexed_data_reader.h",
20+
"sparse_bit_set.cc",
1621
"woff2.cc",
17-
"compat_id.h",
18-
"compat_id.cc",
1922
],
2023
hdrs = [
24+
"axis_range.h",
2125
"binary_diff.h",
2226
"binary_patch.h",
2327
"branch_factor.h",
2428
"brotli_binary_diff.h",
2529
"brotli_binary_patch.h",
30+
"compat_id.h",
2631
"file_font_provider.h",
2732
"font_data.h",
2833
"font_helper.h",
2934
"font_helper_macros.h",
3035
"font_provider.h",
36+
"hasher.h",
3137
"hb_set_unique_ptr.h",
38+
"int_set.h",
3239
"sparse_bit_set.h",
33-
"axis_range.h",
34-
"woff2.h",
35-
"hasher.h",
36-
"compat_id.h",
3740
"try.h",
38-
"int_set.h",
41+
"woff2.h",
42+
],
43+
copts = [
44+
"-DHB_EXPERIMENTAL_API",
3945
],
4046
visibility = [
4147
"//visibility:public",
4248
],
4349
deps = [
4450
"//brotli:shared_brotli_encoder",
45-
"@brotli//:brotlidec",
46-
"@brotli//:brotlienc",
51+
"@abseil-cpp//absl/container:btree",
4752
"@abseil-cpp//absl/container:flat_hash_map",
4853
"@abseil-cpp//absl/container:flat_hash_set",
49-
"@abseil-cpp//absl/container:btree",
5054
"@abseil-cpp//absl/log",
5155
"@abseil-cpp//absl/status:statusor",
5256
"@abseil-cpp//absl/strings",
57+
"@brotli//:brotlidec",
58+
"@brotli//:brotlienc",
5359
"@harfbuzz",
5460
"@woff2",
5561
],
56-
copts = [
57-
"-DHB_EXPERIMENTAL_API",
58-
],
5962
)
6063

6164
cc_library(
@@ -91,18 +94,18 @@ cc_test(
9194
name = "common_test",
9295
size = "small",
9396
srcs = [
97+
"axis_range_test.cc",
9498
"bit_buffer_test.cc",
9599
"bit_input_buffer_test.cc",
96100
"bit_output_buffer_test.cc",
97101
"branch_factor_test.cc",
98102
"brotli_patching_test.cc",
99-
"axis_range_test.cc",
100-
"indexed_data_reader_test.cc",
101103
"file_font_provider_test.cc",
102104
"font_helper_test.cc",
105+
"indexed_data_reader_test.cc",
106+
"int_set_test.cc",
103107
"sparse_bit_set_test.cc",
104108
"woff2_test.cc",
105-
"int_set_test.cc",
106109
],
107110
data = [
108111
"//common:testdata",
@@ -111,8 +114,8 @@ cc_test(
111114
deps = [
112115
":common",
113116
":mocks",
114-
"@googletest//:gtest_main",
115117
"@abseil-cpp//absl/container:btree",
116118
"@abseil-cpp//absl/hash:hash_test",
119+
"@googletest//:gtest_main",
117120
],
118121
)

common/bit_output_buffer_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "common/bit_output_buffer.h"
22

3+
#include <algorithm>
34
#include <bitset>
45
#include <string>
56

@@ -19,7 +20,7 @@ class BitOutputBufferTest : public ::testing::Test {
1920
string result;
2021
for (unsigned int i = 0; i < s.size(); i++) {
2122
string byte_bits = bitset<8>(s.c_str()[i]).to_string();
22-
reverse(byte_bits.begin(), byte_bits.end());
23+
std::reverse(byte_bits.begin(), byte_bits.end());
2324
result += byte_bits;
2425
result += " ";
2526
}

ift/BUILD

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
3+
14
cc_library(
25
name = "ift",
36
srcs = [
47
"glyph_keyed_diff.cc",
58
"glyph_keyed_diff.h",
6-
"url_template.cc",
79
"table_keyed_diff.cc",
810
"table_keyed_diff.h",
11+
"url_template.cc",
912
],
1013
hdrs = [
11-
"url_template.h",
1214
"table_keyed_diff.h",
15+
"url_template.h",
1316
],
1417
visibility = [
1518
"//visibility:public",
@@ -38,28 +41,28 @@ cc_library(
3841
hdrs = [
3942
"testdata/test_segments.h",
4043
],
41-
deps = [
42-
"@abseil-cpp//absl/container:flat_hash_set",
43-
],
4444
visibility = [
4545
"//visibility:public",
4646
],
47+
deps = [
48+
"@abseil-cpp//absl/container:flat_hash_set",
49+
],
4750
)
4851

4952
cc_test(
5053
name = "ift_test",
5154
size = "small",
5255
srcs = [
5356
"glyph_keyed_diff_test.cc",
54-
"url_template_test.cc",
5557
"table_keyed_diff_test.cc",
58+
"url_template_test.cc",
5659
],
5760
copts = [
5861
"-DHB_EXPERIMENTAL_API",
5962
],
6063
data = [
61-
"//ift:testdata",
6264
"//common:testdata",
65+
"//ift:testdata",
6366
],
6467
deps = [
6568
":ift",
@@ -81,15 +84,15 @@ cc_test(
8184
"-DHB_EXPERIMENTAL_API",
8285
],
8386
data = [
84-
"//ift:testdata",
8587
"//common:testdata",
88+
"//ift:testdata",
8689
],
8790
deps = [
8891
":ift",
8992
":test_segments",
9093
"//common",
91-
"//ift/encoder",
9294
"//ift/client:fontations",
95+
"//ift/encoder",
9396
"@abseil-cpp//absl/container:flat_hash_set",
9497
"@googletest//:gtest_main",
9598
],

ift/client/BUILD

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
13
cc_library(
2-
name = "fontations",
3-
srcs = [
4-
"fontations_client.cc",
5-
"fontations_client.h",
6-
],
7-
deps = [
8-
"//common",
9-
"//ift/encoder",
10-
"@abseil-cpp//absl/container:btree",
11-
"@abseil-cpp//absl/status",
12-
],
13-
data = [
14-
"@fontations//:ift_graph",
15-
"@fontations//:ift_extend",
16-
],
17-
visibility = [
18-
"//ift:__subpackages__",
19-
],
20-
)
4+
name = "fontations",
5+
srcs = [
6+
"fontations_client.cc",
7+
"fontations_client.h",
8+
],
9+
data = [
10+
"@fontations//:ift_extend",
11+
"@fontations//:ift_graph",
12+
],
13+
visibility = [
14+
"//ift:__subpackages__",
15+
],
16+
deps = [
17+
"//common",
18+
"//ift/encoder",
19+
"@abseil-cpp//absl/container:btree",
20+
"@abseil-cpp//absl/status",
21+
],
22+
)

0 commit comments

Comments
 (0)