2
2
aspects_flags : &aspects_flags
3
3
- " --config=rustfmt"
4
4
- " --config=clippy"
5
+ min_rust_version_shell_commands : &min_rust_version_shell_commands
6
+ - sed -i 's|^rust_register_toolchains(|rust_register_toolchains(versions = ["1.59.0"],\n|' WORKSPACE.bazel
7
+ nightly_flags : &nightly_flags
8
+ - " --//rust/toolchain/channel=nightly"
9
+ nightly_aspects_flags : &nightly_aspects_flags
10
+ - " --//rust/toolchain/channel=nightly"
11
+ - " --config=rustfmt"
12
+ - " --config=clippy"
13
+ single_rust_channel_targets : &single_rust_channel_targets
14
+ - " --"
15
+ - " //..."
16
+ # These tests are expected to fail as they require both a nightly and stable toolchain.
17
+ - " -//test/unit/channel_transitions/..."
5
18
default_linux_targets : &default_linux_targets
6
19
- " //..."
7
20
default_macos_targets : &default_macos_targets
47
60
windows :
48
61
build_flags :
49
62
- " --enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
50
- - " --config=rustfmt "
51
- - " --config=clippy "
63
+ test_flags :
64
+ - " --enable_runfiles "
52
65
build_targets : *default_windows_targets
53
66
test_targets : *default_windows_targets
54
67
ubuntu2004_opt :
@@ -58,24 +71,28 @@ tasks:
58
71
test_targets : *default_linux_targets
59
72
build_flags :
60
73
- " --compilation_mode=opt"
74
+ test_flags :
75
+ - " --compilation_mode=opt"
61
76
macos_opt :
62
77
name : Opt Mode
63
78
platform : macos
64
79
build_targets : *default_macos_targets
65
80
test_targets : *default_macos_targets
66
81
build_flags :
67
82
- " --compilation_mode=opt"
68
- # # TODO: https://github.com/bazelbuild/rules_rust/issues/1629
69
- # windows_opt:
70
- # name: Opt Mode
71
- # platform: windows
72
- # build_flags:
73
- # - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
74
- # - "--config=rustfmt"
75
- # - "--config=clippy"
76
- # - "--compilation_mode=opt"
77
- # build_targets: *default_windows_targets
78
- # test_targets: *default_windows_targets
83
+ test_flags :
84
+ - " --compilation_mode=opt"
85
+ windows_opt :
86
+ name : Opt Mode
87
+ platform : windows
88
+ build_flags :
89
+ - " --enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
90
+ - " --compilation_mode=opt"
91
+ test_flags :
92
+ - " --enable_runfiles"
93
+ - " --compilation_mode=opt"
94
+ build_targets : *default_windows_targets
95
+ test_targets : *default_windows_targets
79
96
ubuntu2004_with_aspects :
80
97
name : With Aspects
81
98
platform : ubuntu2004
@@ -135,6 +152,8 @@ tasks:
135
152
- " --enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
136
153
- " --config=rustfmt"
137
154
- " --config=clippy"
155
+ test_flags :
156
+ - " --enable_runfiles"
138
157
build_targets : *default_windows_targets
139
158
test_targets : *default_windows_targets
140
159
windows_rolling_with_aspects :
@@ -144,6 +163,8 @@ tasks:
144
163
- " --enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
145
164
- " --config=rustfmt"
146
165
- " --config=clippy"
166
+ test_flags :
167
+ - " --enable_runfiles"
147
168
build_targets : *default_windows_targets
148
169
test_targets : *default_windows_targets
149
170
soft_fail : yes
@@ -194,6 +215,58 @@ tasks:
194
215
build_targets : *default_linux_targets
195
216
test_targets : *default_linux_targets
196
217
build_flags : *aspects_flags
218
+ ubuntu2004_min_rust_version :
219
+ name : " Min Rust Version"
220
+ platform : ubuntu2004
221
+ shell_commands : *min_rust_version_shell_commands
222
+ build_targets : *single_rust_channel_targets
223
+ test_targets : *single_rust_channel_targets
224
+ ubuntu2004_min_rust_version_with_aspects :
225
+ name : " Min Rust Version With Aspects"
226
+ platform : ubuntu2004
227
+ shell_commands : *min_rust_version_shell_commands
228
+ build_flags : *aspects_flags
229
+ build_targets : *single_rust_channel_targets
230
+ test_flags : *aspects_flags
231
+ test_targets : *single_rust_channel_targets
232
+ ubuntu2004_stable_toolchain :
233
+ name : " Only Stable Toolchain"
234
+ platform : ubuntu2004
235
+ # Test rules while only registering a nightly toolchain
236
+ shell_commands :
237
+ - sed -i 's|^rust_register_toolchains(|load("//rust/private:common.bzl", "DEFAULT_RUST_VERSION")\nrust_register_toolchains(versions = [DEFAULT_RUST_VERSION],\n|' WORKSPACE.bazel
238
+ build_targets : *single_rust_channel_targets
239
+ test_targets : *single_rust_channel_targets
240
+ ubuntu2004_stable_with_aspects :
241
+ name : " Only Stable Toolchain With Aspects"
242
+ platform : ubuntu2004
243
+ # Test rules while only registering a nightly toolchain
244
+ shell_commands :
245
+ - sed -i 's|^rust_register_toolchains(|load("//rust/private:common.bzl", "DEFAULT_RUST_VERSION")\nrust_register_toolchains(versions = [DEFAULT_RUST_VERSION],\n|' WORKSPACE.bazel
246
+ build_flags : *aspects_flags
247
+ build_targets : *single_rust_channel_targets
248
+ test_flags : *aspects_flags
249
+ test_targets : *single_rust_channel_targets
250
+ ubuntu2004_nightly_toolchain :
251
+ name : " Only Nightly Toolchain"
252
+ platform : ubuntu2004
253
+ # Test rules while only registering a nightly toolchain
254
+ shell_commands :
255
+ - sed -i 's|^rust_register_toolchains(|load("//rust/private:common.bzl", "DEFAULT_NIGHTLY_ISO_DATE")\nrust_register_toolchains(versions = ["nightly/" + DEFAULT_NIGHTLY_ISO_DATE],\n|' WORKSPACE.bazel
256
+ build_flags : *nightly_flags
257
+ build_targets : *single_rust_channel_targets
258
+ test_flags : *nightly_flags
259
+ test_targets : *single_rust_channel_targets
260
+ ubuntu2004_nightly_with_aspects :
261
+ name : " Only Nightly Toolchain With Aspects"
262
+ platform : ubuntu2004
263
+ # Test rules while only registering a nightly toolchain
264
+ shell_commands :
265
+ - sed -i 's|^rust_register_toolchains(|load("//rust/private:common.bzl", "DEFAULT_NIGHTLY_ISO_DATE")\nrust_register_toolchains(versions = ["nightly/" + DEFAULT_NIGHTLY_ISO_DATE],\n|' WORKSPACE.bazel
266
+ build_flags : *nightly_aspects_flags
267
+ build_targets : *single_rust_channel_targets
268
+ test_flags : *nightly_aspects_flags
269
+ test_targets : *single_rust_channel_targets
197
270
ubuntu2004_rolling_with_aspects :
198
271
name : " Rolling Bazel Version With Aspects"
199
272
bazel : " rolling"
@@ -219,7 +292,7 @@ tasks:
219
292
name : Negative Rustfmt Tests
220
293
platform : ubuntu2004
221
294
run_targets :
222
- - " //test/rustfmt:test_runner"
295
+ - " //test/rustfmt:rustfmt_integration_test_suite. test_runner"
223
296
rust_analyzer_tests :
224
297
name : Rust-Analyzer Tests
225
298
platform : ubuntu2004
@@ -307,6 +380,8 @@ tasks:
307
380
- " --enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
308
381
- " --config=rustfmt"
309
382
- " --config=clippy"
383
+ test_flags :
384
+ - " --enable_runfiles"
310
385
windows_targets : &windows_targets
311
386
- " --" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
312
387
- " //..."
@@ -444,9 +519,16 @@ tasks:
444
519
platform : macos
445
520
working_directory : examples/ios_build
446
521
test_flags :
447
- - " --platforms=//:ios_x86_64"
522
+ - " --cpu=ios_x86_64"
523
+ - " --apple_platform_type=ios"
448
524
test_targets :
449
525
- " //..."
526
+ zig_cross_compiling :
527
+ name : Zig cross compiling test
528
+ platform : ubuntu2004
529
+ working_directory : examples/zig_cross_compiling
530
+ build_targets :
531
+ - " //..."
450
532
451
533
buildifier :
452
534
version : latest
0 commit comments