Skip to content

Commit 2bd21a1

Browse files
author
James Sharpe
committed
fix ci for bazel 8.x
1 parent 21e463e commit 2bd21a1

File tree

11 files changed

+165
-107
lines changed

11 files changed

+165
-107
lines changed

.bazelci/config.yaml

Lines changed: 43 additions & 27 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:
@@ -28,10 +34,8 @@ tasks:
2834
- "-//test:shell_method_symlink_contents_to_dir_test"
2935
- "-//test:shell_script_inner_fun_test"
3036
build_flags:
31-
- "--noenable_bzlmod"
3237
- "--enable_workspace"
3338
test_flags:
34-
- "--noenable_bzlmod"
3539
- "--enable_workspace"
3640
ubuntu1804_examples_standalone:
3741
name: Examples (spawn_strategy=standalone)
@@ -45,14 +49,12 @@ tasks:
4549
- "-c"
4650
- "dbg"
4751
- "--spawn_strategy=standalone"
48-
- "--noenable_bzlmod"
4952
- "--enable_workspace"
5053
test_targets: *linux_targets_standalone
5154
test_flags:
5255
- "-c"
5356
- "dbg"
5457
- "--spawn_strategy=standalone"
55-
- "--noenable_bzlmod"
5658
- "--enable_workspace"
5759
ubuntu2004_examples:
5860
name: Examples
@@ -64,24 +66,9 @@ tasks:
6466
build_targets: *linux_targets
6567
test_targets: *linux_targets
6668
build_flags:
67-
- "--noenable_bzlmod"
6869
- "--enable_workspace"
6970
test_flags:
70-
- "--noenable_bzlmod"
7171
- "--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"
8572
rbe_ubuntu2004_examples:
8673
name: Examples
8774
platform: rbe_ubuntu2004
@@ -91,10 +78,12 @@ tasks:
9178
- "//:third_party_examples_linux_rbe_tests"
9279
# Gives error: zipalign: error while loading shared libraries: /usr/local/lib/libc++.so: file too short
9380
- "-//cmake_android/..."
94-
# Python requirements not supported on Ubuntu 16.04
95-
- "-//:requirements_test"
9681
build_targets: *rbe_targets
9782
test_targets: *rbe_targets
83+
build_flags:
84+
- "--enable_workspace"
85+
test_flags:
86+
- "--enable_workspace"
9887
macos_examples_standalone:
9988
name: Examples (spawn_strategy=standalone)
10089
platform: macos
@@ -112,15 +101,13 @@ tasks:
112101
- "dbg"
113102
- "--spawn_strategy=standalone"
114103
- "--noincompatible_enable_cc_toolchain_resolution"
115-
- "--noenable_bzlmod"
116104
- "--enable_workspace"
117105
test_targets: *macos_targets_standalone
118106
test_flags:
119107
- "-c"
120108
- "dbg"
121109
- "--spawn_strategy=standalone"
122110
- "--noincompatible_enable_cc_toolchain_resolution"
123-
- "--noenable_bzlmod"
124111
- "--enable_workspace"
125112
macos_examples:
126113
name: Examples
@@ -136,12 +123,10 @@ tasks:
136123
build_targets: *macos_targets
137124
build_flags:
138125
- "--noincompatible_enable_cc_toolchain_resolution"
139-
- "--noenable_bzlmod"
140126
- "--enable_workspace"
141127
test_targets: *macos_targets
142128
test_flags:
143129
- "--noincompatible_enable_cc_toolchain_resolution"
144-
- "--noenable_bzlmod"
145130
- "--enable_workspace"
146131
windows_examples:
147132
name: Examples
@@ -172,10 +157,8 @@ tasks:
172157
build_targets: *windows_targets
173158
test_targets: *windows_targets
174159
build_flags:
175-
- "--noenable_bzlmod"
176160
- "--enable_workspace"
177161
test_flags:
178-
- "--noenable_bzlmod"
179162
- "--enable_workspace"
180163
rbe_ubuntu2004_flags:
181164
name: Flags
@@ -195,6 +178,12 @@ tasks:
195178
working_directory: test/standard_cxx_flags_test
196179
test_targets:
197180
- "//:flags_test"
181+
macos_arm64_flags:
182+
name: Flags (arm64)
183+
platform: macos_arm64
184+
working_directory: test/standard_cxx_flags_test
185+
test_targets:
186+
- "//:flags_test"
198187
windows_flags:
199188
name: Flags
200189
platform: windows
@@ -207,26 +196,53 @@ tasks:
207196
working_directory: test/detect_root_test
208197
test_targets:
209198
- "//:tests"
199+
build_flags:
200+
- "--enable_workspace"
201+
test_flags:
202+
- "--enable_workspace"
210203
ubuntu2004_detect_root:
211204
name: Detect root
212205
platform: ubuntu2004
213206
working_directory: test/detect_root_test
214207
test_targets:
215208
- "//:tests"
209+
build_flags:
210+
- "--enable_workspace"
211+
test_flags:
212+
- "--enable_workspace"
216213
macos_detect_root:
217214
name: Detect root
218215
platform: macos
219216
working_directory: test/detect_root_test
220217
test_targets:
221218
- "//:tests"
219+
build_flags:
220+
- "--enable_workspace"
221+
test_flags:
222+
- "--enable_workspace"
223+
macos_oarm64_detect_root:
224+
name: Detect root (arm64)
225+
platform: macos_arm64
226+
working_directory: test/detect_root_test
227+
test_targets:
228+
- "//:tests"
229+
build_flags:
230+
- "--enable_workspace"
231+
test_flags:
232+
- "--enable_workspace"
222233
windows_detect_root:
223234
name: Detect root
224235
platform: windows
225236
working_directory: test/detect_root_test
226237
test_targets:
227238
- "//:tests"
239+
build_flags:
240+
- "--enable_workspace"
241+
test_flags:
242+
- "--enable_workspace"
228243
docs_linux:
229244
name: Docs
245+
bazel: "7.4.1"
230246
platform: ubuntu2004
231247
working_directory: docs
232248
build_targets:

MODULE.bazel

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ 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")
12-
bazel_dep(name = "rules_python", version = "0.23.1")
12+
bazel_dep(name = "rules_python", version = "1.0.0")
1313
bazel_dep(name = "rules_shell", version = "0.3.0")
1414

1515
# Dev dependencies
@@ -22,9 +22,19 @@ bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
2222
# depends on it. If you are not using bazel_ci_rules; ideally we'd be able to remove this.
2323
bazel_dep(name = "rules_cc", version = "0.0.9", dev_dependency = True)
2424

25+
rbe_preconfig = use_repo_rule(
26+
"@bazel_ci_rules//:rbe_repo.bzl",
27+
"rbe_preconfig",
28+
)
29+
30+
rbe_preconfig(
31+
name = "buildkite_config",
32+
toolchain = "ubuntu2004",
33+
)
34+
2535
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
26-
python.toolchain(python_version = "3.9")
27-
use_repo(python, "python_3_9")
36+
python.toolchain(python_version = "3.12")
37+
use_repo(python, "python_3_12")
2838

2939
tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools")
3040
use_repo(
@@ -46,6 +56,6 @@ register_toolchains(
4656
"@rules_foreign_cc_framework_toolchains//:all",
4757
"@cmake_3.23.2_toolchains//:all",
4858
"@ninja_1.12.1_toolchains//:all",
49-
"@python_3_9//:all",
59+
"@python_3_12//:all",
5060
"@rules_foreign_cc//toolchains:all",
5161
)

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
common --incompatible_allow_tags_propagation
55

66
common --noenable_bzlmod
7+
common --enable_workspace
78
build --workspace_status_command=tools/workspace_status.sh

examples/MODULE.bazel

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bazel_dep(name = "rules_foreign_cc", version = "0.0.0")
1+
bazel_dep(name = "rules_foreign_cc")
22
local_path_override(
33
module_name = "rules_foreign_cc",
44
path = "..",
@@ -12,13 +12,16 @@ use_repo(
1212
"meson_src",
1313
)
1414

15-
bazel_dep(name = "platforms", version = "0.0.6")
16-
bazel_dep(name = "rules_swift", version = "1.6.0", repo_name = "build_bazel_rules_swift")
17-
bazel_dep(name = "rules_apple", version = "3.4.0", repo_name = "build_bazel_rules_apple")
18-
bazel_dep(name = "apple_support", version = "1.12.0", repo_name = "build_bazel_apple_support")
19-
bazel_dep(name = "rules_python", version = "0.23.0")
20-
bazel_dep(name = "rules_cc", version = "0.0.9")
15+
bazel_dep(name = "platforms", version = "0.0.10")
16+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
17+
bazel_dep(name = "rules_swift", version = "2.1.1", repo_name = "build_bazel_rules_swift")
18+
bazel_dep(name = "rules_apple", version = "3.16.1", repo_name = "build_bazel_rules_apple")
19+
bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support")
20+
bazel_dep(name = "rules_python", version = "1.0.0")
21+
bazel_dep(name = "rules_cc", version = "0.0.16")
2122
bazel_dep(name = "rules_shell", version = "0.3.0")
23+
bazel_dep(name = "rules_java", version = "8.6.2")
24+
bazel_dep(name = "rules_perl", version = "0.2.4")
2225

2326
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
2427
python.toolchain(
@@ -30,26 +33,39 @@ python.toolchain(
3033

3134
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
3235
pip.parse(
33-
name = "pip",
36+
hub_name = "pip",
37+
python_version = "3.10",
3438
requirements_lock = "//:requirements_lock.txt",
35-
requirements_windows = "//:requirements_windows.txt",
3639
)
3740
use_repo(pip, "pip")
3841

39-
# bazel_dep(name = "rules_android", version = "0.1.1")
40-
# bazel_dep(name = "rules_jvm_external", version = "5.1")
41-
#
42-
# maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
43-
#
44-
# maven.install(
45-
# name = "maven_deps",
46-
# artifacts = [
47-
# "com.android.support.constraint:constraint-layout:aar:1.1.2",
48-
# "com.android.support:appcompat-v7:aar:26.1.0",
49-
# ],
50-
# repositories = [
51-
# "https://jcenter.bintray.com/",
52-
# "https://maven.google.com",
53-
# "https://repo1.maven.org/maven2",
54-
# ],
55-
# )
42+
bazel_dep(name = "rules_android", version = "0.6.0-alpha1.bcr.1")
43+
bazel_dep(name = "rules_android_ndk", version = "0.1.2")
44+
bazel_dep(name = "rules_jvm_external", version = "6.6")
45+
46+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
47+
maven.install(
48+
name = "maven",
49+
artifacts = [
50+
"com.android.support.constraint:constraint-layout:aar:1.1.2",
51+
"com.android.support:appcompat-v7:aar:26.1.0",
52+
],
53+
repositories = [
54+
"https://jcenter.bintray.com/",
55+
"https://maven.google.com",
56+
"https://repo1.maven.org/maven2",
57+
],
58+
)
59+
use_repo(maven, "maven")
60+
61+
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
62+
63+
rbe_preconfig = use_repo_rule(
64+
"@bazel_ci_rules//:rbe_repo.bzl",
65+
"rbe_preconfig",
66+
)
67+
68+
rbe_preconfig(
69+
name = "buildkite_config",
70+
toolchain = "ubuntu2004",
71+
)

examples/WORKSPACE.bzlmod

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
workspace(name = "rules_foreign_cc_examples")
22

3-
load("//deps:repositories.bzl", "repositories")
4-
5-
repositories()
6-
7-
load("//deps:deps_android.bzl", "deps_android")
8-
9-
deps_android()
10-
11-
load("//deps:deps_jvm_external.bzl", "deps_jvm_external")
12-
13-
deps_jvm_external()
14-
153
local_repository(
164
name = "rules_foreign_cc_examples_third_party",
175
path = "third_party",
@@ -20,26 +8,3 @@ local_repository(
208
load("@rules_foreign_cc_examples_third_party//:repositories.bzl", examples_third_party_repositories = "repositories")
219

2210
examples_third_party_repositories()
23-
24-
load("@rules_foreign_cc_examples_third_party//:setup.bzl", examples_third_party_setup = "setup")
25-
26-
examples_third_party_setup()
27-
28-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
29-
30-
http_archive(
31-
name = "bazelci_rules",
32-
sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
33-
strip_prefix = "bazelci_rules-1.0.0",
34-
url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
35-
)
36-
37-
load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
38-
39-
# Creates a default toolchain config for RBE.
40-
# Use this as is if you are using the rbe_ubuntu16_04 container,
41-
# otherwise refer to RBE docs.
42-
rbe_preconfig(
43-
name = "buildkite_config",
44-
toolchain = "ubuntu1804-bazel-java11",
45-
)

0 commit comments

Comments
 (0)