8000 minimal/.minimal/minimal.toml at main · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
162 lines (140 loc) · 4.99 KB

minimal.toml

File metadata and controls

162 lines (140 loc) · 4.99 KB
[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.task]
state_key = "dev"
[defaults.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]
< 9182 /div>
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"]
0