Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: nightly

# Everything that boots a guest, the host checks a pull request does not run,
# and portability: on main every night, and on any branch by
# Everything that boots a guest, the host gate again to write the cache the
# merge queue restores, and portability: on main every night, and on any branch by
# `gh workflow run nightly.yml --ref <branch>`. Every job's logic is
# `cargo run -- --ci <job>` (src/ci.rs); this file says where each one runs.

Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
key: host-${{ github.run_id }}
restore-keys: host-

- run: cargo run -- --ci host-full
- run: cargo run -- --ci host

# The host cache's one writer. Only main's entries are readable from
# every branch.
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ exclude = [
# The userland SDK. It compiles against the ToyOS sysroot and is a path
# dependency of `rust/library/std`, so it keeps its own resolution and
# cannot be a member. It is host-tested all the same — its `lib.rs` is
# `cfg_attr(not(test), no_std)` and `cargo run -- --ci host-full` runs
# `cargo test` in it against the host triple. Every crate in `exclude` that
# has host tests is named in `src/ci.rs`; nothing here reaches them.
# `cfg_attr(not(test), no_std)` and `cargo run -- --ci host` runs
# `cargo test` in it against the host triple.
"toyos",
# Guest programs `src/build.rs` builds for `x86_64-unknown-toyos`, each from
# its own directory. The harness's own integration test lives here too
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
status: open
kind: tooling
opened: 2026-09-26
---

# A userland test in a `src/` file no module reaches runs nowhere and still reads as gated

`src/userlandhost.rs` gates a userland crate by reading its `src/` and `tests/`
for test attributes. A file under `src/` that no `mod` declaration reaches is
never compiled, so a test in it runs in no `cargo test`, and the survey
counts its crate as gated all the same. The merge gate is green over a test
that never ran. No such file is in the tree today, and nothing refuses one.

The same holds for any file the survey reads that a target's module tree does
not include. A `#[path]` pointing away from the file, or a module dropped from
its parent, orphans it.

**Exit:** every file the survey finds holding a test is shown to be compiled
into a test binary the gate runs. For example, `host` lists each gated crate's
tests (`cargo test ... -- --list`), and each such file contributes at least one
listed test. A test fixture holding an orphaned `src/` file must red.
26 changes: 0 additions & 26 deletions issues/build/soundds-host-suite-reds-a-thread-with-no-voice.md

This file was deleted.

2 changes: 1 addition & 1 deletion kernel-loom/tests/log_zeroed_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! invocations, and the other one runs nothing from this file.** That is the
//! shape, not an accident — but it was silent until 2026-08-14, when CI ran
//! only the default invocation and this file's `running 0 tests` looked
//! identical to a pass. `cargo run -- --ci host-full` runs both commands
//! identical to a pass. `cargo run -- --ci host` runs both commands
//! now, and every other `loom::model` file is gated `cfg(feature = "loom")`,
//! so a bare `--no-default-features` run at the crate root exercises none of
//! them either — the second command names this target explicitly instead.
Expand Down
2 changes: 1 addition & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,7 @@ mod tests {

/// **A control nobody runs is a control nobody has shown can fail.** Every
/// name [`declared_model_controls`] finds is a row of `crate::ci::CONTROLS`,
/// which `cargo run -- --ci host-full` runs, and every row names a declared
/// which `cargo run -- --ci host` runs, and every row names a declared
/// control — or a new control can be declared and run nowhere, silently.
#[test]
fn every_model_control_is_run() {
Expand Down
113 changes: 56 additions & 57 deletions src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
//! as `host`, only in the merge queue, where every branch has already been
//! judged as a pull request. A required check a workflow skips on the other
//! event still reports, and a skip counts as passing — that is how each half
//! enters the queue it does not itself run in. `nightly.yml` runs everything
//! that boots a guest, the rest of the host checks (`host-full`), and
//! portability. `publish.yml` puts a landing's crates on crates.io.
//! enters the queue it does not itself run in. Every test that boots no guest
//! is in [`Job::Host`], so a merge is gated on all of them. `nightly.yml` runs
//! everything that boots a guest, `host` again to write the cache the merge
//! queue restores, and portability. `publish.yml` puts a landing's crates on
//! crates.io.
//!
//! A host job runs every step and reds if any failed; a guest job stops at the
//! first failure, because what follows a wrong instrument or a missing
Expand Down Expand Up @@ -40,10 +42,10 @@ pub(crate) const REQUIRED_CHECKS: &[&str] = &["host", "abi-split"];
const NIGHTLY_RED: &str = "nightly is red";

const USAGE: &str = "cargo run -- --ci <job>, where <job> is one of:
host cargo test --lib, every host-workspace suite and clippy (ci.yml)
host every host test: the build system, the host workspace, clippy,
the model controls, userland and the SDK (ci.yml, nightly)
abi-split the published crates' versions (ci.yml; the name is the required check's)
gate-stage what protects main, read back from GitHub (ci.yml)
host-full host, plus the model controls, userland and the SDK (nightly)
toolchain publish this tree's toolchain if nobody has (nightly)
guest <i>/<n> one shard of the whole guest suite, nightly tier included (nightly)
tcg one test on an emulated CPU (nightly)
Expand All @@ -56,7 +58,6 @@ enum Job {
Host,
AbiSplit,
GateStage,
HostFull,
Toolchain,
Guest(String),
Tcg,
Expand All @@ -75,7 +76,6 @@ fn parse(words: &[String]) -> Result<Job, String> {
Some("host") => Job::Host,
Some("abi-split") => Job::AbiSplit,
Some("gate-stage") => Job::GateStage,
Some("host-full") => Job::HostFull,
Some("toolchain") => Job::Toolchain,
Some("guest") => Job::Guest(shard(words.get(1))?),
Some("tcg") => Job::Tcg,
Expand Down Expand Up @@ -103,7 +103,6 @@ pub fn dispatch(root: &Path, args: &[String]) {
vec![step("the published crates' versions", || abi_split(root))]
}
Job::GateStage => vec![step("what protects main", || gate_stage(root))],
Job::HostFull => host_full(root),
Job::Toolchain => vec![step("the toolchain release", || release::ensure_published(root))],
Job::Guest(shard) => {
guest(root, &suite_args(&["--shard", shard, "--jobs", "1", "--nightly"]))
Expand Down Expand Up @@ -205,43 +204,6 @@ fn cargo_logged(dir: &Path, args: &[&str]) -> Result<(bool, String), String> {

// --- The host jobs -------------------------------------------------------------

/// The merge queue's whole gate: the build system's own tests, every member of
/// the host workspace, and clippy with warnings denied. None of the three
/// needs the ToyOS toolchain nightly.yml alone builds — the kernel and the
/// bootloader clippy against `x86_64-unknown-none`/`x86_64-unknown-uefi`,
/// targets any rustup installs, and `x86_64-unknown-toyos` (the one target
/// that does need the fork) is userland's alone, and userland carries no
/// clippy shape (`src/clippy.rs`).
fn host(root: &Path) -> Vec<Step> {
let mut steps = vec![
step("the build system", || cargo(root, &["test", "--lib"])),
step("the host workspace", || {
cargo(root, &["test", "--workspace", "--exclude", "toyos-build"])
}),
];
steps.push(step("clippy and the bare targets", || {
for args in [
&["component", "add", "clippy"][..],
&["target", "add", "x86_64-unknown-none", "x86_64-unknown-uefi"],
] {
let status = Command::new("rustup").args(args).status().map_err(|e| e.to_string())?;
if !status.success() {
return Err(format!("rustup {} exited {status}", args.join(" ")));
}
}
Ok("installed".into())
}));
steps.push(step("clippy, warnings denied", || {
let failed = crate::clippy::run(root);
if failed.is_empty() {
Ok("clean".into())
} else {
Err(failed.join("; "))
}
}));
steps
}

/// What a model of the kernel's concurrency is shown able to catch: a feature
/// that takes away the one edge the model's property rests on, and the verdict
/// lines the model must then print.
Expand Down Expand Up @@ -398,14 +360,46 @@ fn run_control(root: &Path, control: &Control) -> Result<String, String> {
judge_control(control, green, &log)
}

/// The userland crates whose decisions are testable on the host. They name the
/// host triple because `userland/.cargo/config.toml` cross-compiles by default,
/// which is also why they cannot be host-workspace members.
const USERLAND_HOST_CRATES: &[&str] = &["sshd", "calc", "soundd", "logd", "pkg", "netd"];

fn host_full(root: &Path) -> Vec<Step> {
/// The merge queue's whole gate, and the nightly's host lane: every test that
/// runs on the host and boots no guest. The build system's own tests, every
/// member of the host workspace, clippy with warnings denied, the concurrency
/// models' negative controls, every userland crate with a host test
/// ([`crate::userlandhost`], which also reds on a userland test none of them
/// runs), and the SDK.
///
/// Clippy needs none of the ToyOS toolchain the nightly alone builds — the
/// kernel and the bootloader lint against `x86_64-unknown-none` and
/// `x86_64-unknown-uefi`, targets any rustup installs, and userland carries no
/// clippy shape (`src/clippy.rs`). Userland and the SDK are tested against the
/// host triple for the same reason.
fn host(root: &Path) -> Vec<Step> {
let host_triple = crate::toolchain::host_triple();
let mut steps = self::host(root);
let mut steps = vec![
step("the build system", || cargo(root, &["test", "--lib"])),
step("the host workspace", || {
cargo(root, &["test", "--workspace", "--exclude", "toyos-build"])
}),
];
steps.push(step("clippy and the bare targets", || {
for args in [
&["component", "add", "clippy"][..],
&["target", "add", "x86_64-unknown-none", "x86_64-unknown-uefi"],
] {
let status = Command::new("rustup").args(args).status().map_err(|e| e.to_string())?;
if !status.success() {
return Err(format!("rustup {} exited {status}", args.join(" ")));
}
}
Ok("installed".into())
}));
steps.push(step("clippy, warnings denied", || {
let failed = crate::clippy::run(root);
if failed.is_empty() {
Ok("clean".into())
} else {
Err(failed.join("; "))
}
}));
// `log_zeroed_init` and `log_body_words` are gated `cfg(not(feature =
// "loom"))`, so the default invocation runs nothing from either.
steps.push(step("kernel-loom without loom", || {
Expand All @@ -423,11 +417,16 @@ fn host_full(root: &Path) -> Vec<Step> {
for control in CONTROLS {
steps.push(step(&format!("control `{}`", control.feature), || run_control(root, control)));
}
for name in USERLAND_HOST_CRATES {
let manifest = format!("userland/{name}/Cargo.toml");
steps.push(step(&format!("userland/{name}"), || {
cargo(root, &["test", "--manifest-path", &manifest, "--target", &host_triple])
}));
match crate::userlandhost::survey(&root.join("userland")) {
Ok(survey) => {
for name in survey.gated {
let manifest = format!("userland/{name}/Cargo.toml");
steps.push(step(&format!("userland/{name}"), || {
cargo(root, &["test", "--manifest-path", &manifest, "--target", &host_triple])
}));
}
}
Err(why) => steps.push(Step { label: "the userland host crates".into(), verdict: Err(why) }),
}
// The SDK compiles against the ToyOS sysroot everywhere but here, and this
// build links no syscall.
Expand Down
4 changes: 2 additions & 2 deletions src/clippy.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Default clippy with warnings denied, over the three trees this host lints.
//!
//! `cargo run -- --clippy` runs [`SHAPES`] alone; `cargo run -- --ci
//! host-full` runs the same list as one of its steps, so the local command and
//! the nightly gate cannot verify different sets.
//! host` runs the same list as one of its steps, so the local command and
//! the merge gate cannot verify different sets.
//!
//! Userland is not here: `x86_64-unknown-toyos` is a custom target, and the
//! fork's `toyos` toolchain ships no clippy.
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub mod sysroot;
pub mod testargs;
pub mod tiers;
pub mod toolchain;
pub mod userlandhost;
pub mod wallpaper;
pub mod worktree;

Expand Down
4 changes: 2 additions & 2 deletions src/sourcegate.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Identifiers a tree may not name, and the exceptions that are named instead.
//!
//! **Clippy runs now, and these scans are what it cannot say.** `cargo run --
//! --ci host-full` runs default clippy with warnings denied over three trees
//! every night — the host workspace
//! --ci host` runs default clippy with warnings denied over three trees
//! on every merge — the host workspace
//! (`--workspace --all-targets`), the kernel (`--target x86_64-unknown-none`)
//! and the bootloader (`--target x86_64-unknown-uefi`) — so a `clippy.toml` is
//! no longer a wall with nothing behind it.
Expand Down
Loading
Loading