Skip to content

Commit 8e867ca

Browse files
afq984Chromeos LUCI
authored and
Chromeos LUCI
committed
quick-verifier: Make archlinux-system-cras-rust closer to portage
This allows bugs that break portage builds to be caught earlier. BUG=b:372902037 TEST=devtools/copgen.sh Change-Id: I79705ccd141fbe2269d439405a203e9f50ee038d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5920308 Reviewed-by: Cranel W <[email protected]> Tested-by: [email protected] <[email protected]> Commit-Queue: Li-Yu Yu <[email protected]>
1 parent 4ac08ff commit 8e867ca

File tree

3 files changed

+42
-19
lines changed

3 files changed

+42
-19
lines changed

.bazelversion

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.5.0

.cop/build.yaml

+35-16
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,40 @@
3434
{
3535
"name": "gcr.io/${PROJECT_ID}/adhd-archlinux-builder",
3636
"args": [
37-
"version"
37+
"-ah",
38+
"/workspace/adhd/",
39+
"./"
3840
],
41+
"dir": "/workspace-ensure-bazel",
3942
"id": "ensure-bazel:0",
40-
"entrypoint": "bazel"
43+
"waitFor": [
44+
"prepare-source:1"
45+
],
46+
"entrypoint": "rsync",
47+
"volumes": [
48+
{
49+
"name": "workspace-ensure-bazel",
50+
"path": "/workspace-ensure-bazel"
51+
}
52+
]
4153
},
4254
{
4355
"name": "gcr.io/${PROJECT_ID}/adhd-archlinux-builder",
4456
"args": [
45-
"setup complete"
57+
"version"
4658
],
47-
"id": "setup-complete:0",
59+
"dir": "/workspace-ensure-bazel",
60+
"id": "ensure-bazel:1",
4861
"waitFor": [
49-
"prepare-source:1",
5062
"ensure-bazel:0"
5163
],
52-
"entrypoint": "echo"
64+
"entrypoint": "bazel",
65+
"volumes": [
66+
{
67+
"name": "workspace-ensure-bazel",
68+
"path": "/workspace-ensure-bazel"
69+
}
70+
]
5371
},
5472
{
5573
"name": "gcr.io/${PROJECT_ID}/adhd-archlinux-builder",
@@ -61,7 +79,7 @@
6179
"dir": "/workspace-copgen-check",
6280
"id": "copgen-check:0",
6381
"waitFor": [
64-
"setup-complete:0"
82+
"ensure-bazel:1"
6583
],
6684
"entrypoint": "rsync",
6785
"volumes": [
@@ -99,7 +117,7 @@
99117
"dir": "/workspace-rust_generate",
100118
"id": "rust_generate:0",
101119
"waitFor": [
102-
"setup-complete:0"
120+
"ensure-bazel:1"
103121
],
104122
"entrypoint": "rsync",
105123
"volumes": [
@@ -153,7 +171,7 @@
153171
"dir": "/workspace-archlinux-clang",
154172
"id": "archlinux-clang:0",
155173
"waitFor": [
156-
"setup-complete:0"
174+
"ensure-bazel:1"
157175
],
158176
"entrypoint": "rsync",
159177
"volumes": [
@@ -196,7 +214,7 @@
196214
"dir": "/workspace-archlinux-clang-asan",
197215
"id": "archlinux-clang-asan:0",
198216
"waitFor": [
199-
"setup-complete:0"
217+
"ensure-bazel:1"
200218
],
201219
"entrypoint": "rsync",
202220
"volumes": [
@@ -240,7 +258,7 @@
240258
"dir": "/workspace-archlinux-clang-ubsan",
241259
"id": "archlinux-clang-ubsan:0",
242260
"waitFor": [
243-
"setup-complete:0"
261+
"ensure-bazel:1"
244262
],
245263
"entrypoint": "rsync",
246264
"volumes": [
@@ -284,7 +302,7 @@
284302
"dir": "/workspace-archlinux-gcc",
285303
"id": "archlinux-gcc:0",
286304
"waitFor": [
287-
"setup-complete:0"
305+
"ensure-bazel:1"
288306
],
289307
"entrypoint": "rsync",
290308
"volumes": [
@@ -328,7 +346,7 @@
328346
"dir": "/workspace-archlinux-system-cras-rust",
329347
"id": "archlinux-system-cras-rust:0",
330348
"waitFor": [
331-
"setup-complete:0"
349+
"ensure-bazel:1"
332350
],
333351
"entrypoint": "rsync",
334352
"volumes": [
@@ -405,6 +423,7 @@
405423
"dbg",
406424
"--//:system_cras_rust",
407425
"--repo_env=SYSTEM_CRAS_RUST_LIB=/workspace-archlinux-system-cras-rust/target/debug/libcras_rust.a",
426+
"--override_repository=rules_rust=/workspace-archlinux-system-cras-rust/cras/rules_rust_stub",
408427
"--config=local-clang"
409428
],
410429
"dir": "/workspace-archlinux-system-cras-rust",
@@ -430,7 +449,7 @@
430449
"dir": "/workspace-kythe",
431450
"id": "kythe:0",
432451
"waitFor": [
433-
"setup-complete:0"
452+
"ensure-bazel:1"
434453
],
435454
"entrypoint": "rsync",
436455
"volumes": [
@@ -466,7 +485,7 @@
466485
],
467486
"id": "oss-fuzz-setup:0",
468487
"waitFor": [
469-
"setup-complete:0"
488+
"ensure-bazel:1"
470489
],
471490
"entrypoint": "mkdir"
472491
},
@@ -673,7 +692,7 @@
673692
"dir": "/workspace-cppcheck",
674693
"id": "cppcheck:0",
675694
"waitFor": [
676-
"setup-complete:0"
695+
"ensure-bazel:1"
677696
],
678697
"entrypoint": "rsync",
679698
"volumes": [

devtools/quick-verifier/build/build_steps.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func (cl *gerritCL) makeQuickVerifierBuild(name string) *cloudbuildpb.Build {
1818
func makeBuild(gitSteps *buildplan.Sequence, tags []string) *cloudbuildpb.Build {
1919
var b buildplan.Build
2020
git := b.Add(gitSteps)
21-
ensureBazel := b.Add(ensureBazelSteps())
22-
setup := b.Add(setupCompleteMarkerSteps().WithDep(git).WithDep(ensureBazel))
21+
ensureBazel := b.Add(ensureBazelSteps()).WithDep(git)
22+
setup := ensureBazel
2323

2424
b.Add(copgenCheckSteps().WithDep(setup))
2525
b.Add(rustGenerateSteps().WithDep(setup))
@@ -105,10 +105,12 @@ func MakeCopBuild() *cloudbuildpb.Build {
105105
func ensureBazelSteps() *buildplan.Sequence {
106106
return buildplan.Commands(
107107
"ensure-bazel",
108+
// Run with adhd/ sources so bazelisk has access to the .bazelversion file.
109+
prepareSourceStep,
108110
// Run bazel once to ensure bazel is available and to avoid
109111
// races between bazelisk downloading bazel from multiple invocations.
110112
buildplan.Command(archlinuxBuilder, "bazel", "version"),
111-
).WithManualIsolation()
113+
).WithVolume()
112114
}
113115

114116
func setupCompleteMarkerSteps() *buildplan.Sequence {
@@ -161,6 +163,7 @@ func systemCrasRustSteps() *buildplan.Sequence {
161163
"test", "//...", "--config=ci", "-c", "dbg",
162164
"--//:system_cras_rust",
163165
"--repo_env=SYSTEM_CRAS_RUST_LIB=/workspace-archlinux-system-cras-rust/target/debug/libcras_rust.a",
166+
"--override_repository=rules_rust=/workspace-archlinux-system-cras-rust/cras/rules_rust_stub",
164167
"--config=local-clang",
165168
},
166169
},

0 commit comments

Comments
 (0)