The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(ci): drop sccache reporting from self-hosted lanes
Steven Enamakel709e4097e98a
diff --git a/scripts/__tests__/rust-coverage-status.test.mjs b/scripts/__tests__/rust-coverage-status.test.mjsindex 9779ac4fd3..a335470072 100644--- a/scripts/__tests__/rust-coverage-status.test.mjs+++ b/scripts/__tests__/rust-coverage-status.test.mjs@@ -2,6 +2,7 @@ import assert from "node:assert/strict";import { execFileSync } from "node:child_process";import fs from "node:fs";import path from "node:path";+import os from "node:os";import test from "node:test";import { fileURLToPath } from "node:url";@@ -203,3 +204,48 @@ test("coverage finalizer retains interrupted reports and the cancellation statusassert.equal(result.status, 143, result.output);assert.match(result.output, /REPORT report --lcov --output-path interrupted.info/);});++function runMockedCoverage(exitCode) {+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rust-coverage-runner-"));+ try {+ for (const folder of ["bin", "scripts/ci", "crates/openhuman-cli"])+ fs.mkdirSync(path.join(dir, folder), { recursive: true });+ const write = (name, content) => fs.writeFileSync(path.join(dir, name), content, { mode: 0o755 });+ write("scripts/ci/product-features.sh", "#!/bin/bash\necho channels\n");+ write("scripts/ci-cancel-aware.sh", '#!/bin/bash\nexec "$@"\n');+ write("scripts/ci/assert-coverage-presence.sh", "#!/bin/bash\nexit 0\n");+ write("crates/openhuman-cli/Cargo.toml", "");+ write("bin/rustup", "#!/bin/bash\nexit 1\n");+ write("bin/cargo", `#!/bin/bash+printf '%s\\n' "$*" >> "$MOCK_CALLS"+case "$*" in *"-p openhuman --lib --bins"*) exit "${exitCode}" ;; esac+`);+ let status = 0;+ try {+ execFileSync("bash", [runner], {+ cwd: dir,+ env: { ...process.env, PATH: `${dir}/bin:${process.env.PATH}`, MOCK_CALLS: `${dir}/calls`, OH_COV_RUNNER: "nextest", OH_COV_DOCTESTS: "0" },+ stdio: "pipe",+ });+ } catch (error) { status = error.status; }+ return { status, calls: fs.readFileSync(`${dir}/calls`, "utf8").trim().split("\n") };+ } finally { fs.rmSync(dir, { recursive: true, force: true }); }+}++test("private coverage executes every package configuration once and reports after a failed suite", () => {+ const { status, calls } = runMockedCoverage(7);+ assert.equal(status, 1);+ const selections = calls.filter((line) => line.includes("llvm-cov nextest"));+ assert.equal(selections.length, 8);+ assert.equal(new Set(selections).size, 8);+ assert.ok(selections.every((line) => line.includes("--no-tests=fail")));+ assert.ok(selections.some((line) => line.includes("-p openhuman-cli --tests -E kind(test)")));+ assert.equal(calls.filter((line) => line.includes("llvm-cov report")).length, 1);+});++test("private coverage cancels remaining suites but still preserves a report", () => {+ const { status, calls } = runMockedCoverage(143);+ assert.equal(status, 143);+ assert.equal(calls.filter((line) => line.includes("llvm-cov nextest")).length, 1);+ assert.equal(calls.filter((line) => line.includes("llvm-cov report")).length, 1);+});diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjsindex 84be399798..2d1c362262 100644--- a/scripts/__tests__/self-hosted-lanes.test.mjs+++ b/scripts/__tests__/self-hosted-lanes.test.mjs@@ -20,7 +20,6 @@ import {PrioritySemaphore,processTable,treeRssMiB,- sccacheSummary,Runner,defaultHeavySlots,foldLine,@@ -238,7 +237,7 @@ test("the complete suites run, not subsets", () => {assert.match(runs, /bash scripts\/ci\/rust-coverage\.sh/);assert.match(runs,- /cargo llvm-cov --no-rustc-wrapper --manifest-path crates\/openhuman-app\/Cargo\.toml/,+ /cargo llvm-cov nextest .*--no-rustc-wrapper --manifest-path crates\/openhuman-app\/Cargo\.toml/,);});@@ -438,27 +437,6 @@ test("private runner serializes lanes even when parallelism is requested", () =>assert.equal(new Runner({ ...plan, profile: "hosted" }, { out: "unused", maxParallel: 8 }).maxParallel, 8);});-test("sccache summary reports hit rate and the store in use", () => {- assert.equal(sccacheSummary(null), null);- assert.equal(- sccacheSummary({- stats: {- cache_hits: { counts: { Rust: 30 } },- cache_misses: { counts: { Rust: 10 } },- },- cache_location: "webdav, name: , prefix: /",- }),- "sccache (shared store): 30 Rust hits, 10 misses (75%).",- );- assert.equal(- sccacheSummary({- stats: { cache_hits: { counts: {} }, cache_misses: { counts: {} } },- cache_location: 'Local disk: "/cache/sccache"',- }),- "sccache (slot disk): 0 Rust hits, 0 misses.",- );-});-test("area flags are read strictly from CI_AREA_*", () => {const areas = areasFromEnv({CI_AREA_RUST_CORE: "true",@@ -656,7 +634,7 @@ test("runner: heavy lanes wait for a slot, light lanes never do", async () => {fs.mkdirSync(path.join(out, "logs"));const check = (name) => ({ name, run: "sleep 0.2", when: true, needs: [] });const plan = {- profile: "ex63",+ profile: "hosted",lanes: [{ name: "h1", heavy: 0, active: true, checks: [check("x")] },{ name: "h2", heavy: 1, active: true, checks: [check("x")] },diff --git a/scripts/ci/self-hosted/lanes-plan.mjs b/scripts/ci/self-hosted/lanes-plan.mjsindex 786d0284a2..9e8339ac72 100644--- a/scripts/ci/self-hosted/lanes-plan.mjs+++ b/scripts/ci/self-hosted/lanes-plan.mjs@@ -148,7 +148,6 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {CARGO_INCREMENTAL: "0",RUSTFLAGS: "-C link-arg=-fuse-ld=mold",};- const sccache = {};const covEnv = {...rustEnv,CARGO_PROFILE_DEV_DEBUG: "0",@@ -360,7 +359,7 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {// First among the Rust lanes: it is the long pole, and rust-lint waits// on its test-modules check.name: "rust-cov",- // Compiles the core crate: holds one of the VM's heavy-compile slots+ // Compiles the core crate; hosted runners can cap heavy-compile slots// (lanes.mjs). Lower number = served first.heavy: 0,targetDir: targetDir("cov"),@@ -401,11 +400,11 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {},{name: "rust-lint",- // Compiles the core crate: holds one of the VM's heavy-compile slots+ // Compiles the core crate; hosted runners can cap heavy-compile slots// (lanes.mjs). Lower number = served first.heavy: 1,targetDir: targetDir("lint"),- env: { ...rustEnv, ...sccache },+ env: { ...rustEnv },checks: [// `--features` is load-bearing: `default` is the contributor set.{@@ -452,11 +451,11 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {},{name: "rust-gates-off",- // Compiles the core crate: holds one of the VM's heavy-compile slots+ // Compiles the core crate; hosted runners can cap heavy-compile slots// (lanes.mjs). Lower number = served first.heavy: 1,targetDir: targetDir("gatesoff"),- env: { ...rustEnv, ...sccache, RUST_MIN_STACK: "67108864" },+ env: { ...rustEnv, RUST_MIN_STACK: "67108864" },checks: [{name: "gate-contract-tests",@@ -500,7 +499,7 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {},{name: "tauri",- // Compiles the core crate: holds one of the VM's heavy-compile slots+ // Compiles the core crate; hosted runners can cap heavy-compile slots// (lanes.mjs). Lower number = served first.heavy: 2,targetDir: targetDir("tauri"),@@ -509,13 +508,13 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {{name: "clippy-tauri",when: areas.rustTauri,- env: sccache,+ env: {},run: "cargo clippy --manifest-path crates/openhuman-app/Cargo.toml -- -D warnings",},{// llvm-cov's RUSTFLAGS mode with the linker flag cleared, as in// ci-lite. ci-lite also clears RUSTC_WRAPPER because its container- // config installs sccache; on ex63 covEnv sets sccache on purpose.+ // config installs sccache; on ex63 covEnv sets no compiler wrapper.name: "tauri-coverage",when: areas.rustTauri,env: { ...covEnv },@@ -539,7 +538,7 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {// VM's heavy-compile slots (lanes.mjs). Lower number = served first.heavy: 2,targetDir: targetDir("storage"),- env: { ...rustEnv, ...sccache, RUST_MIN_STACK: "16777216" },+ env: { ...rustEnv, RUST_MIN_STACK: "16777216" },checks: [{name: "storage-e2e",@@ -590,7 +589,7 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {if (!["rust-gates-off", "storage-drivers"].includes(lane.name)) continue;for (const check of lane.checks) {if (!check.run.startsWith("cargo test ")) continue;- const [cargoArgs, filters] = check.run.slice("cargo test ".length).split(" --");+ const [cargoArgs, filters] = check.run.slice("cargo test ".length).split(" -- ");let args = cargoArgs.replace("--no-fail-fast ", "");let expression = "";let serial = "";diff --git a/scripts/ci/self-hosted/lanes.mjs b/scripts/ci/self-hosted/lanes.mjsindex 7119e33f28..4f827ddbfc 100644--- a/scripts/ci/self-hosted/lanes.mjs+++ b/scripts/ci/self-hosted/lanes.mjs@@ -21,7 +21,7 @@// Area flags come from CI_AREA_* (see AREA_ENV). Outputs, under --out:// logs/<lane>.log full output of each lane// lcov/*.info coverage written by the coverage checks-// ci-timings.json per-check outcome, timings, target-dir sizes, sccache+// ci-timings.json per-check outcome, timings, target-dir sizes// and a per-check outcome table in $GITHUB_STEP_SUMMARY.//// Exit status is non-zero when any gating check failed or was blocked by a@@ -125,20 +125,6 @@ export function orderProblems(plan) {return problems;}-/** One line on sccache's Rust hit rate and where its cache lives, or null. */-export function sccacheSummary(sccache) {- const stats = sccache?.stats;- if (!stats) return null;- const hits = stats.cache_hits?.counts?.Rust ?? 0;- const misses = stats.cache_misses?.counts?.Rust ?? 0;- const total = hits + misses;- const rate = total ? ` (${Math.round((100 * hits) / total)}%)` : "";- const where = /webdav/i.test(sccache.cache_location ?? "")- ? "shared store"- : "slot disk";- return `sccache (${where}): ${hits} Rust hits, ${misses} misses${rate}.`;-}-/** Render the per-check outcome table for $GITHUB_STEP_SUMMARY. */export function renderSummary(results) {const rows = [@@ -203,18 +189,6 @@ function du(path) {return Number.isFinite(bytes) ? bytes : null;}-function sccacheStats() {- const r = spawnSync("sccache", ["--show-stats", "--stats-format", "json"], {- encoding: "utf8",- });- if (r.status !== 0) return null;- try {- return JSON.parse(r.stdout);- } catch {- return null;- }-}-/*** Counting semaphore with priorities (lower first, then FIFO). Heavy lanes* each compile the whole core crate, several GB of rustc apiece, so the VM