Skip to content

Commit 6e6713d

Browse files
committed
Fix ci for bazel 8.x
1 parent 2dd6fe2 commit 6e6713d

File tree

22 files changed

+274
-109
lines changed

22 files changed

+274
-109
lines changed

.bazelci/config.yaml

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ tasks:
1818
- "//..."
1919
test_targets:
2020
- "//..."
21+
macos_arm64:
22+
platform: macos_arm64
23+
build_targets:
24+
- "//..."
25+
test_targets:
26+
- "//..."
2127
windows:
2228
platform: windows
2329
build_targets:
@@ -35,6 +41,7 @@ tasks:
3541
- "--enable_workspace"
3642
ubuntu1804_examples_standalone:
3743
name: Examples (spawn_strategy=standalone)
44+
bazel: "7.4.1"
3845
platform: ubuntu1804
3946
working_directory: examples
4047
linux_targets: &linux_targets_standalone
@@ -45,17 +52,16 @@ tasks:
4552
- "-c"
4653
- "dbg"
4754
- "--spawn_strategy=standalone"
48-
- "--noenable_bzlmod"
4955
- "--enable_workspace"
5056
test_targets: *linux_targets_standalone
5157
test_flags:
5258
- "-c"
5359
- "dbg"
5460
- "--spawn_strategy=standalone"
55-
- "--noenable_bzlmod"
5661
- "--enable_workspace"
5762
ubuntu2004_examples:
5863
name: Examples
64+
bazel: "7.4.1"
5965
platform: ubuntu2004
6066
working_directory: examples
6167
linux_targets: &linux_targets
@@ -64,39 +70,28 @@ tasks:
6470
build_targets: *linux_targets
6571
test_targets: *linux_targets
6672
build_flags:
67-
- "--noenable_bzlmod"
6873
- "--enable_workspace"
6974
test_flags:
70-
- "--noenable_bzlmod"
7175
- "--enable_workspace"
72-
ubuntu2004_examples_bzlmod:
73-
name: Examples (bzlmod)
74-
platform: ubuntu2004
75-
working_directory: examples
76-
linux_targets: &linux_targets_bzlmod
77-
- "//..."
78-
- "//:third_party_examples_linux_tests"
79-
# gives error '//external:databinding_annotation_processor': target 'databinding_annotation_processor' not declared in package 'external' defined by /workdir/examples/WORKSPACE.bazel (Tip: use `query "//external:*"` to see all the targets in that package) and referenced by '@bazel_tools//tools/android:databinding_annotation_processor'
80-
- "-//cmake_android/..."
81-
build_targets: *linux_targets_bzlmod
82-
test_targets: *linux_targets_bzlmod
83-
build_flags:
84-
- "--enable_bzlmod"
8576
rbe_ubuntu2004_examples:
8677
name: Examples
78+
bazel: "7.4.1"
8779
platform: rbe_ubuntu2004
8880
working_directory: examples
8981
rbe_targets: &rbe_targets
9082
- "//..."
9183
- "//:third_party_examples_linux_rbe_tests"
9284
# Gives error: zipalign: error while loading shared libraries: /usr/local/lib/libc++.so: file too short
9385
- "-//cmake_android/..."
94-
# Python requirements not supported on Ubuntu 16.04
95-
- "-//:requirements_test"
9686
build_targets: *rbe_targets
9787
test_targets: *rbe_targets
88+
build_flags:
89+
- "--enable_workspace"
90+
test_flags:
91+
- "--enable_workspace"
9892
macos_examples_standalone:
9993
name: Examples (spawn_strategy=standalone)
94+
bazel: "7.4.1"
10095
platform: macos
10196
working_directory: examples
10297
macos_targets: &macos_targets_standalone
@@ -112,18 +107,17 @@ tasks:
112107
- "dbg"
113108
- "--spawn_strategy=standalone"
114109
- "--noincompatible_enable_cc_toolchain_resolution"
115-
- "--noenable_bzlmod"
116110
- "--enable_workspace"
117111
test_targets: *macos_targets_standalone
118112
test_flags:
119113
- "-c"
120114
- "dbg"
121115
- "--spawn_strategy=standalone"
122116
- "--noincompatible_enable_cc_toolchain_resolution"
123-
- "--noenable_bzlmod"
124117
- "--enable_workspace"
125118
macos_examples:
126119
name: Examples
120+
bazel: "7.4.1"
127121
platform: macos
128122
working_directory: examples
129123
macos_targets: &macos_targets
@@ -136,15 +130,14 @@ tasks:
136130
build_targets: *macos_targets
137131
build_flags:
138132
- "--noincompatible_enable_cc_toolchain_resolution"
139-
- "--noenable_bzlmod"
140133
- "--enable_workspace"
141134
test_targets: *macos_targets
142135
test_flags:
143136
- "--noincompatible_enable_cc_toolchain_resolution"
144-
- "--noenable_bzlmod"
145137
- "--enable_workspace"
146138
windows_examples:
147139
name: Examples
140+
bazel: "7.4.1"
148141
platform: windows
149142
working_directory: examples
150143
windows_targets: &windows_targets
@@ -196,6 +189,12 @@ tasks:
196189
working_directory: test/standard_cxx_flags_test
197190
test_targets:
198191
- "//:flags_test"
192+
macos_arm64_flags:
193+
name: Flags (arm64)
194+
platform: macos_arm64
195+
working_directory: test/standard_cxx_flags_test
196+
test_targets:
197+
- "//:flags_test"
199198
windows_flags:
200199
name: Flags
201200
platform: windows
@@ -208,26 +207,53 @@ tasks:
208207
working_directory: test/detect_root_test
209208
test_targets:
210209
- "//:tests"
210+
build_flags:
211+
- "--enable_workspace"
212+
test_flags:
213+
- "--enable_workspace"
211214
ubuntu2004_detect_root:
212215
name: Detect root
213216
platform: ubuntu2004
214217
working_directory: test/detect_root_test
215218
test_targets:
216219
- "//:tests"
220+
build_flags:
221+
- "--enable_workspace"
222+
test_flags:
223+
- "--enable_workspace"
217224
macos_detect_root:
218225
name: Detect root
219226
platform: macos
220227
working_directory: test/detect_root_test
221228
test_targets:
222229
- "//:tests"
230+
build_flags:
231+
- "--enable_workspace"
232+
test_flags:
233+
- "--enable_workspace"
234+
macos_arm64_detect_root:
235+
name: Detect root (arm64)
236+
platform: macos_arm64
237+
working_directory: test/detect_root_test
238+
test_targets:
239+
- "//:tests"
240+
build_flags:
241+
- "--enable_workspace"
242+
test_flags:
243+
- "--enable_workspace"
223244
windows_detect_root:
224245
name: Detect root
225246
platform: windows
226247
working_directory: test/detect_root_test
227248
test_targets:
228249
- "//:tests"
250+
build_flags:
251+
- "--enable_workspace"
252+
test_flags:
253+
- "--enable_workspace"
229254
docs_linux:
230255
name: Docs
256+
bazel: "7.4.1"
231257
platform: ubuntu2004
232258
working_directory: docs
233259
build_targets:

.bazelversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

MODULE.bazel

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
)
88

99
bazel_dep(name = "bazel_features", version = "1.15.0")
10-
bazel_dep(name = "bazel_skylib", version = "1.3.0")
10+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1111
bazel_dep(name = "platforms", version = "0.0.5")
1212
bazel_dep(name = "rules_cc", version = "0.0.17")
1313
bazel_dep(name = "rules_python", version = "1.1.0-rc0")
@@ -19,9 +19,22 @@ bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf"
1919
# Dev dependencies
2020
bazel_dep(name = "gazelle", version = "0.41.0", dev_dependency = True, repo_name = "bazel_gazelle")
2121
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True)
22+
23+
# Needed for bazel 8.0.0 on windows for some reason
24+
bazel_dep(name = "rules_java", version = "8.6.3", dev_dependency = True)
2225
bazel_dep(name = "stardoc", version = "0.5.6", dev_dependency = True, repo_name = "io_bazel_stardoc")
2326
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
2427

28+
rbe_preconfig = use_repo_rule(
29+
"@bazel_ci_rules//:rbe_repo.bzl",
30+
"rbe_preconfig",
31+
)
32+
33+
rbe_preconfig(
34+
name = "buildkite_config",
35+
toolchain = "ubuntu2004",
36+
)
37+
2538
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
2639
python.toolchain(python_version = "3.12")
2740
use_repo(python, "python_3_12")

REPO.bazel

Whitespace-only changes.

WORKSPACE.bzlmod

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
11
workspace(name = "rules_foreign_cc")
2-
3-
load("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig")
4-
5-
# Creates a default toolchain config for RBE.
6-
# Use this as is if you are using the rbe_ubuntu16_04 container,
7-
# otherwise refer to RBE docs.
8-
rbe_preconfig(
9-
name = "buildkite_config",
10-
toolchain = "ubuntu1804-bazel-java11",
11-
)

docs/.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
# https://github.com/bazelbuild/stardoc/issues/112
44
common --incompatible_allow_tags_propagation
5+
6+
common --noenable_bzlmod
7+
common --enable_workspace

docs/.bazelversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/WORKSPACE.bazel

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,85 @@
11
workspace(name = "rules_foreign_cc_docs")
2+
3+
local_repository(
4+
name = "rules_foreign_cc",
5+
path = "..",
6+
)
7+
8+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
9+
10+
http_archive(
11+
name = "bazel_skylib",
12+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
13+
urls = [
14+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
15+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
16+
],
17+
)
18+
19+
http_archive(
20+
name = "rules_java",
21+
sha256 = "6d8c6d5cd86fed031ee48424f238fa35f33abc9921fd97dd4ae1119a29fc807f",
22+
urls = [
23+
"https://github.com/bazelbuild/rules_java/releases/download/8.6.3/rules_java-8.6.3.tar.gz",
24+
],
25+
)
26+
27+
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
28+
29+
rules_java_dependencies()
30+
31+
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
32+
33+
rules_foreign_cc_dependencies()
34+
35+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
36+
37+
bazel_features_deps()
38+
39+
load("//:stardoc_repository.bzl", "stardoc_repository")
40+
41+
stardoc_repository()
42+
43+
load("//:stardoc_deps.bzl", "stardoc_deps")
44+
45+
stardoc_deps()
46+
47+
load("@rules_python//python:repositories.bzl", "py_repositories")
48+
49+
py_repositories()
50+
51+
# register toolchains
52+
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
53+
54+
rules_java_toolchains()
55+
56+
# Gazelle dependencies
57+
58+
http_archive(
59+
name = "bazel_gazelle",
60+
sha256 = "b7387f72efb59f876e4daae42f1d3912d0d45563eac7cb23d1de0b094ab588cf",
61+
urls = [
62+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
63+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
64+
],
65+
)
66+
67+
http_archive(
68+
name = "bazel_skylib_gazelle_plugin",
69+
sha256 = "747addf3f508186234f6232674dd7786743efb8c68619aece5fb0cac97b8f415",
70+
urls = [
71+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-gazelle-plugin-1.5.0.tar.gz",
72+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-gazelle-plugin-1.5.0.tar.gz",
73+
],
74+
)
75+
76+
load("@bazel_skylib_gazelle_plugin//:workspace.bzl", "bazel_skylib_gazelle_plugin_workspace")
77+
78+
bazel_skylib_gazelle_plugin_workspace()
79+
80+
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
81+
load("@bazel_skylib_gazelle_plugin//:setup.bzl", "bazel_skylib_gazelle_plugin_setup")
82+
83+
bazel_skylib_gazelle_plugin_setup()
84+
85+
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE.bazel")

examples/.bazelversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)