Repository navigation
Expand file tree
/
Copy pathminimal.toml
More file actions
162 lines (140 loc) · 4.98 KB
/
Copy pathminimal.toml
File metadata and controls
162 lines (140 loc) · 4.98 KB
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
[upstream] # Source of software & tooling
repo = "https://github.com/gominimal/pkgs"
branch = "main"
locked_commit = "fe10f54c021665a5432e64f75988a0a3f926e791"
[stack]
use = "rust"
runtime_packages = [
"socat",
"pkgconf",
"openssl",
"linux_headers",
"zlib",
"protobuf",
"skopeo",
"coreutils",
"git",
]
[defaults]
state_key = "dev"
[session]
packages = ["just", "shellcheck", "python", "cargo-nextest"]
[tasks.build]
description = "Builds the minimal CLI"
exec = "cargo build --verbose"
inherit_cwd = true
[tasks.build-smoke]
description = "Smoke-test that a task can build something"
exec = "cargo build -p common"
inherit_cwd = true
[tasks.test]
exec = "cargo test --verbose"
inherit_cwd = true
[tasks.startup-time]
exec = "date"
[tasks.fmt-check]
exec = "cargo fmt -- --check"
inherit_cwd = true
[tasks.clippy]
exec = "cargo clippy --all-targets -- -D warnings"
inherit_cwd = true
# Mutation-test the graph wire decoder. Runs in the Linux sandbox, where the
# graph baseline test suite is green (the spec_hasher hash assertions that fail
# on macOS pass here), which cargo-mutants requires. Scoped to wire.rs to keep
# the run bounded; widen -f / drop it to cover more.
[tasks.mutants]
description = "Mutation-test the graph wire decoder with cargo-mutants"
inherit_cwd = true
bash = """
set -e
command -v cargo-mutants >/dev/null 2>&1 || cargo install cargo-mutants --locked
cargo mutants -p graph -f wire.rs --timeout 120
"""
[tasks.ci]
inherit_cwd = true
bash = """
set -e
cargo test --verbose
# cargo fmt -- --check
# cargo clippy --all-targets -- -D warnings
"""
# The agent runtime runs this one on the coder's files and amends the result
# into its last commit (runner/runner/jobs/implement.py, `run_fmt`). It must be
# `bash = `: a `spec.get("bash")` that is not a string reads as "no fmt task",
# and the PR then lands red on CI's `fmt` job for whitespace.
[tasks.fmt]
description = "rustfmt across the workspace; the runtime amends it into the coder's commit"
inherit_cwd = true
bash = """
set -e
cargo fmt --all
"""
# The gate the agent runtime runs after a task's `test:` lines, in a fresh
# clone at the pushed sha under a 10-minute budget (probeWallClockSeconds,
# worker/src/config.ts). The runtime prefers this name over `verify`.
# Without either block it falls back to the plan survey's `just test-one`,
# which has no filter to run.
#
# rustfmt, then clippy and the test suite of each crate the coder touched,
# read off `MINIMAL_CHANGED_PATHS` — the changed files the runtime puts in
# this task's env, one per line. No paths means no suites and a
# workspace-wide clippy. Clippy is scoped like nextest because a cold
# workspace clippy alone ran 9 m 10 s of the gate's 600 s on #1673 and the
# gate was stopped before nextest began; `-p` still checks every dependency
# of the touched crates, so a warning there is still caught.
[tasks.agent-verify]
description = "the gate the agent runtime runs after a task's test lines"
inherit_cwd = true
bash = """
set -e
cargo fmt --all -- --check
# Crate names out of `crates/<name>/...`, deduplicated; other paths ignored.
crates=$(printf '%s\\n' "${MINIMAL_CHANGED_PATHS:-}" \\
| sed -n 's|^crates/\\([^/][^/]*\\)/.*|\\1|p' \\
| sort -u)
args=""
for c in $crates; do args="$args -p $c"; done
# shellcheck disable=SC2086 - the package flags are meant to split
cargo clippy --all-targets --locked $args -- -D warnings
if [ -n "$crates" ]; then
# shellcheck disable=SC2086 - the package flags are meant to split
cargo nextest run --locked $args
fi
"""
# `min task run verify` — the same two checks a person can run over the
# whole tree. No crate scoping: nothing sets MINIMAL_CHANGED_PATHS at a
# terminal, and a gate that silently narrows itself is worse than one that
# says what it covers.
[tasks.verify]
description = "rustfmt and clippy over the whole workspace"
inherit_cwd = true
bash = """
set -e
cargo fmt --all -- --check
cargo clippy --all-targets --locked -- -D warnings
"""
[outputs.bash-img]
type = "oci-image"
packages = ["bash", "coreutils", "diffutils", "findutils", "tar"]
env_vars.test = "ello"
cmd = ["/usr/bin/bash", "-l"]
# Raw (uncompressed) kernel Image from the upstream virtio-kernel-raw package,
# loaded via KRUN_KERNEL_FORMAT_RAW (no in-VMM gzip decompress) for faster boot.
[outputs.virtio-kernel]
type = "raw-file"
packages = ["virtio-kernel-raw"]
path = "usr/share/virtio-linux/Image"
# Guest rootfs ext4 image from the upstream microvm-rootfs package.
[outputs.minvmd-rootfs]
type = "raw-file"
packages = ["microvm-rootfs"]
path = "usr/share/microvm-rootfs/rootfs.img"
# libkrun KVM backend (shared lib + its libkrunfw firmware) from the upstream
# libkrun package. Materialized as an OCI image whose layers carry the full
# runtime closure; scripts/fetch-libkrun.sh extracts just libkrun.so* and
# libkrunfw.so* into a link/runtime prefix. This replaces the former from-source
# build — libkrunfw compiles a guest kernel, far too heavy to rebuild in CI on
# every run.
[outputs.libkrun]
type = "oci-image"
packages = ["libkrun"]