fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreDeleted "extra workspace member" functionality from crate_universe (#1406)a15e67d6

0.6.0
11.5 KiB346 linesraw
1---
2aspects_flags: &aspects_flags
3  - "--config=rustfmt"
4  - "--config=clippy"
5default_linux_targets: &default_linux_targets
6  - "//..."
7  # TODO: Switch manual tag to platform constraint after bazel 4.0.
8  - "//test/versioned_dylib:versioned_dylib_test"
9default_macos_targets: &default_macos_targets
10  - "--"
11  - "//..."
12default_windows_targets: &default_windows_targets
13  - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
14  - "//..."
15  - "-//bindgen/..."
16  - "-//test/proto/..."
17  - "-//tools/rust_analyzer/..."
18crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets
19  - "//vendor_external:crates_vendor"
20  - "//vendor_local_manifests:crates_vendor"
21  - "//vendor_local_pkgs:crates_vendor"
22  - "//vendor_remote_manifests:crates_vendor_manifests"
23  - "//vendor_remote_pkgs:crates_vendor_pkgs"
24tasks:
25  ubuntu2004:
26    build_targets: *default_linux_targets
27    test_targets: *default_linux_targets
28  rbe_ubuntu1604:
29    shell_commands:
30      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
31      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
32    build_targets:
33      - "//..."
34    test_targets:
35      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
36      - "//..."
37      - "//test/..."
38      - "-//test/conflicting_deps:conflicting_deps_test"
39  macos:
40    build_targets: *default_macos_targets
41    test_targets: *default_macos_targets
42    build_flags: *aspects_flags
43  windows:
44    build_flags:
45      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
46      - "--config=rustfmt"
47      - "--config=clippy"
48    build_targets: *default_windows_targets
49    test_targets: *default_windows_targets
50  ubuntu2004_with_aspects:
51    name: With Aspects
52    platform: ubuntu2004
53    build_targets: *default_linux_targets
54    test_targets: *default_linux_targets
55    build_flags: *aspects_flags
56  rbe_ubuntu1604_with_aspects:
57    name: With Aspects
58    platform: rbe_ubuntu1604
59    shell_commands:
60      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
61      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
62    build_targets: *default_linux_targets
63    test_targets:
64      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
65      - "..."
66      - "//test/..."
67      - "-//test/conflicting_deps:conflicting_deps_test"
68    build_flags: *aspects_flags
69  rbe_ubuntu1604_rolling_with_aspects:
70    name: RBE Rolling Bazel Version With Aspects
71    platform: rbe_ubuntu1604
72    shell_commands:
73      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
74      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
75    build_targets: *default_linux_targets
76    test_targets:
77      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
78      - "..."
79      - "//test/..."
80      - "-//test/conflicting_deps:conflicting_deps_test"
81    build_flags: *aspects_flags
82    soft_fail: yes
83    bazel: "rolling"
84  macos_with_aspects:
85    name: With Aspects
86    platform: macos
87    build_targets: *default_macos_targets
88    test_targets: *default_macos_targets
89    build_flags: *aspects_flags
90  macos_rolling_with_aspects:
91    name: "Macos Rolling Bazel Version With Aspects"
92    platform: macos
93    build_targets: *default_macos_targets
94    test_targets: *default_macos_targets
95    build_flags: *aspects_flags
96    soft_fail: yes
97    bazel: "rolling"
98  windows_with_aspects:
99    name: With Aspects
100    platform: windows
101    build_flags:
102      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
103      - "--config=rustfmt"
104      - "--config=clippy"
105    build_targets: *default_windows_targets
106    test_targets: *default_windows_targets
107  windows_rolling_with_aspects:
108    name: "Windows Rolling Bazel Version With Aspects"
109    platform: windows
110    build_flags:
111      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
112      - "--config=rustfmt"
113      - "--config=clippy"
114    build_targets: *default_windows_targets
115    test_targets: *default_windows_targets
116    soft_fail: yes
117    bazel: "rolling"
118  ubuntu2004_clang:
119    name: With Clang
120    platform: ubuntu2004
121    build_flags:
122      - "--config=rustfmt"
123      - "--config=clippy"
124      - "--repo_env=CC=clang"
125    build_targets: *default_linux_targets
126    test_targets: *default_linux_targets
127  ubuntu2004_clang_lld:
128    name: With Clang and LLD
129    platform: ubuntu2004
130    shell_commands:
131      - "sudo apt -y update && sudo apt -y install lld"
132    build_flags:
133      - "--config=rustfmt"
134      - "--config=clippy"
135      - "--repo_env=CC=clang"
136      - "--linkopt=-fuse-ld=lld"
137    build_targets: *default_linux_targets
138    test_targets: *default_linux_targets
139  ubuntu2004_rolling_clang:
140    name: Rolling Bazel Version With Clang
141    platform: ubuntu2004
142    build_flags:
143      - "--config=rustfmt"
144      - "--config=clippy"
145      - "--repo_env=CC=clang"
146    build_targets: *default_linux_targets
147    test_targets: *default_linux_targets
148    soft_fail: yes
149    bazel: "rolling"
150  ubuntu1804:
151    name: "Min Bazel Version"
152    bazel: "4.0.0"
153    platform: ubuntu1804
154    build_targets: *default_linux_targets
155    test_targets: *default_linux_targets
156  ubuntu1804_with_aspects:
157    name: "Min Bazel Version With Aspects"
158    bazel: "4.0.0"
159    platform: ubuntu1804
160    build_targets: *default_linux_targets
161    test_targets: *default_linux_targets
162    build_flags: *aspects_flags
163  ubuntu2004_rolling_with_aspects:
164    name: "Rolling Bazel Version With Aspects"
165    bazel: "rolling"
166    platform: ubuntu2004
167    soft_fail: yes
168    build_targets: *default_linux_targets
169    test_targets: *default_linux_targets
170    build_flags: *aspects_flags
171  linux_docs:
172    name: Docs
173    platform: ubuntu2004
174    working_directory: docs
175    build_targets:
176      - //...
177    run_targets:
178      - "//:test_docs"
179  clippy_failure:
180    name: Negative Clippy Tests
181    platform: ubuntu2004
182    run_targets:
183      - "//test/clippy:clippy_failure_test"
184  rustfmt_failure:
185    name: Negative Rustfmt Tests
186    platform: ubuntu2004
187    run_targets:
188      - "//test/rustfmt:test_runner"
189  rust_analyzer_tests:
190    name: Rust-Analyzer Tests
191    platform: ubuntu2004
192    run_targets:
193      - "//test/rust_analyzer:rust_analyzer_test"
194  ubuntu2004_examples:
195    name: Examples
196    platform: ubuntu2004
197    working_directory: examples
198    build_targets:
199      - "//..."
200    test_targets:
201      - "//..."
202    build_flags: *aspects_flags
203  ubuntu2004_examples_clang:
204    name: Examples with Clang
205    platform: ubuntu2004
206    working_directory: examples
207    build_flags:
208      - "--repo_env=CC=clang"
209    build_targets:
210      - "//..."
211    test_targets:
212      - "//..."
213    build_flags: *aspects_flags
214  ubuntu2004_examples_clang_lld:
215    name: Examples with Clang and LLD
216    platform: ubuntu2004
217    shell_commands:
218      - "sudo apt -y update && sudo apt -y install lld"
219    working_directory: examples
220    build_flags:
221      - "--repo_env=CC=clang"
222      - "--linkopt=-fuse-ld=lld"
223    build_targets:
224      - "//..."
225    test_targets:
226      - "//..."
227    build_flags: *aspects_flags
228  ubuntu2004_examples_rolling:
229    name: "Examples with Rolling Bazel Version"
230    platform: ubuntu2004
231    working_directory: examples
232    build_targets:
233      - "//..."
234    test_targets:
235      - "//..."
236    build_flags: *aspects_flags
237    soft_fail: yes
238  rbe_ubuntu1604_examples:
239    name: Examples
240    platform: rbe_ubuntu1604
241    working_directory: examples
242    rbe_examples_targets: &rbe_examples_targets
243      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
244      - "//..."
245      # TODO: This requires an updated `rules_foreign_cc`
246      - "-//sys/..."
247      # See https://github.com/bazelbuild/bazel/issues/9987
248      - "-//ffi/rust_calling_c:matrix_dylib_test"
249      # The bindgen rules currently do not work on RBE
250      # see: https://github.com/bazelbuild/rules_rust/issues/919
251      - "-//bindgen/..."
252    shell_commands:
253      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
254      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
255    build_targets: *rbe_examples_targets
256    test_targets: *rbe_examples_targets
257    build_flags: *aspects_flags
258  macos_examples:
259    name: Examples
260    platform: macos
261    working_directory: examples
262    build_targets:
263      - "//..."
264    test_targets:
265      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
266      - "//..."
267    build_flags: *aspects_flags
268  windows_examples:
269    name: Examples
270    platform: windows
271    working_directory: examples
272    build_flags:
273      - "--enable_runfiles" # this is not enabled by default on windows and is necessary for the cargo build scripts
274      - "--config=rustfmt"
275      - "--config=clippy"
276    windows_targets: &windows_targets
277      - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
278      - "//..."
279      # The bindgen rules currently do not work on windows
280      # see: https://github.com/bazelbuild/rules_rust/issues/919
281      - "-//bindgen/..."
282      # The proto rules do not work on windows
283      - "-//proto/..."
284      # The wasm rules do not work on windows
285      - "-//wasm/..."
286    build_targets: *windows_targets
287    test_targets: *windows_targets
288  crate_universe_examples_ubuntu2004:
289    name: Crate Universe Examples
290    platform: ubuntu2004
291    working_directory: examples/crate_universe
292    run_targets: *crate_universe_vendor_example_targets
293    build_targets:
294      - "//..."
295    test_targets:
296      - "//..."
297    build_flags: *aspects_flags
298  crate_universe_rbe_ubuntu1604:
299    name: Crate Universe Examples
300    platform: rbe_ubuntu1604
301    working_directory: examples/crate_universe
302    shell_commands:
303      - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel
304      - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
305    run_targets: *crate_universe_vendor_example_targets
306    build_targets:
307      - "//..."
308    test_targets:
309      - "//..."
310    build_flags: *aspects_flags
311  crate_universe_examples_macos:
312    name: Crate Universe Examples
313    platform: macos
314    working_directory: examples/crate_universe
315    run_targets: *crate_universe_vendor_example_targets
316    build_targets:
317      - "//..."
318    test_targets:
319      - "//..."
320    build_flags: *aspects_flags
321  crate_universe_examples_windows:
322    name: Crate Universe Examples
323    platform: windows
324    working_directory: examples/crate_universe
325    batch_commands:
326      - echo startup --windows_enable_symlinks >> user.bazelrc
327      - echo build --enable_runfiles >> user.bazelrc  # this is not enabled by default on windows and is necessary for the cargo build scripts
328    run_targets: *crate_universe_vendor_example_targets
329    build_flags: *aspects_flags
330    build_targets:
331      - "//..."
332      # TODO: Temporarily disable this windows build as it recently started
333      # failing. This is likely an issue with the windows workers in CI.
334      - "-//vendor_local_pkgs/..."
335      - "-//vendor_remote_pkgs/..."
336      - "-//no_cargo_manifests/..."
337    test_targets:
338      - "//..."
339      # TODO: Temporarily disable this windows build as it recently started
340      # failing. This is likely an issue with the windows workers in CI.
341      - "-//vendor_local_pkgs/..."
342      - "-//vendor_remote_pkgs/..."
343      - "-//no_cargo_manifests/..."
344buildifier:
345  version: latest
346  warnings: "all"