You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ef3867
Browse filesBrowse the repository at this point in the historyBrowse files
Answer the second review of #632: Ninja measured against n2, git judged per use
The declaration is renamed to what its rows are, host tools and not only C
and C++ ones: issues/build/the-build-runs-host-tools-outside-rust-and-qemu.md.
Its one citation, reviewer.md's Arrivals, moves in this commit.
BLOCKERs:
- env is refused. src/release.rs already runs `cargo run -- --build-only`
with GITHUB_ACTIONS and CI removed, so a Rust tool does the job. Exit: the
build system removes both itself.
- Ninja is refused: n2 does its job. n2 is github.com/evmar/n2 at b1fead5,
built from source in a scratch directory (the crates.io `n2` is an unrelated
crate). LLVM was configured from the primary's rust/src/llvm-project/llvm at
52ed14fcd56a, the upstream commit the pin a79bc52c1d5e adds five ToyOS
commits to, none of them in llvm/CMakeLists.txt, llvm/cmake, lib/Support,
lib/TableGen or utils/TableGen. Flags: Release, X86 only, no tests,
benchmarks, examples or docs.
- `cmake -G Ninja -DCMAKE_MAKE_PROGRAM=<n2>`: exit 1, "The detected version
of Ninja (0.1.0) is less than the version of Ninja required by CMake
(1.3)".
- The same with CMAKE_MAKE_PROGRAM a symlink named `ninja` to n2, which is
how n2's README says CMake runs it: configure exit 0; `n2 -C build -j 8
llvm-tblgen` exit 0, "n2: ran 304 tasks, now up to date"; the same again
and `cmake --build build --target llvm-tblgen` exit 0, "n2: no work to
do"; `bin/llvm-tblgen --version` exit 0, "LLVM version 22.1.8". The build
directory holds .n2_db and no .ninja_log.
- The same again with n2 built --no-default-features, which drops its
jemalloc so that no C is linked into it: every step exit 0, 304 tasks.
`find` over the primary's llvm-project for files newer than a marker
touched before each arm printed nothing. The scratch builds are deleted.
M5 in issues/build/toyos-builds-itself.md no longer builds Ninja for ToyOS.
- The T14 bench is outside the rule. The orchestrator read the bench's
release, "Ubuntu 24.04.4 LTS", with sudo 1.9.15p5 and dd (coreutils) 9.4,
both C, and ruled its Ubuntu recovery equipment on a test machine, not the
build's host. One row says so with that release, and its tools leave with
Ubuntu.
NOTEs:
- The toolchain's own clang, llvm-ar, rust-lld and llvm-config, built from
ToyOSOrg/llvm-project, are an admitted row: rustc links every guest binary
with rust-lld, the C corpus, hello.c and doomgeneric compile with clang,
cc::Build archives with llvm-ar, and bootstrap reads LLVM through
llvm-config.
- reviewer.md's Arrivals names a `.github/` `run:` step, which is how env,
sed, sleep and the build job's `sudo rm -rf` arrive. The declaration's
intro no longer claims every row was found by those ways: it names the two
flashes by hand as its own scope.
- git is two rows, split by what gitoxide 0.85 does, read in its source in
~/.cargo/registry. Admitted: adding, removing and pruning worktrees,
updating submodules, the fork's fetch from the primary's and its checkout,
the primary's fast-forward, the tests' fixture repositories, and rustc's
bootstrap. gix 0.85 has worktrees() and no worktree add; Submodule::update
reads the config's setting and updates nothing; there is no checkout of an
existing worktree, no reset, no push and no staging (gix-index's add_entry
builds an index from a tree); and gix-transport 0.57.2's local connect
"will spawn a `git` process locally". Refused: every read (rev-parse,
show-ref, for-each-ref, rev-list, log, branch --contains, merge-base,
ls-tree, ls-files, cat-file, config --get-regexp, worktree list, status,
diff, ls-remote, grep), src/sync.rs's fetch of origin over HTTPS, and the
workflows' checkouts: gix has rev_parse, merge_base, rev_walk, status,
worktrees, has_object, index, submodules, diff_tree_to_tree, ref_map and
clone, and reqwest for HTTPS.
- The README's flashing steps: lsblk, sync and sudo on Linux have rows, and
the dd and macOS sudo rows name the README's steps.
- CLAUDE.md carries the ruling's "ToyOS's own code is Rust; it writes no
Python, Perl or shell of its own." in place of its paraphrase, and main's
"Ask of anything new: could this ever run inside ToyOS?" where it was, both
word for word. `wc -w CLAUDE.md`: 2614 on main, 2645 here.
- reviewer.md's Instructions carve-out reaches CLAUDE.md's "Stale or false
prose is deleted" and "an agent edits one only when briefed to" for the
implementer updating an instruction.
- Filed issues/build/the-fork-checkout-runs-git-submodule-in-a-linked-worktree.md:
sysroot::fork_checkout runs `git submodule update --init library/backtrace`
in a linked worktree of the primary's rust whenever the primary's backtrace
lacks the pinned commit, which implementer.md forbids.
REMOVEs: the fork line numbers after download.rs and apple.rs are deleted,
and the pull request body no longer describes #631.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016t9wjdQkB8SH7bmfUoiy6L
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ A subdirectory `CLAUDE.md` loads when a file in that subtree is `Read`, and not
58
58
59
59
## Dependencies
60
60
61
-
**Rust** and **QEMU** for development, on any host OS and architecture — the development machine is nothing special. Beside them, where no Rust tool does the job, only C or C++ tools ToyOS can one day build and run (Python, Perl, CMake, Ninja, make), each declared. No binary for one host OS alone: a macOS binary is a hard no, and "only for tests" does not soften it. No Python, Perl or shell of our own; only general and widely used crates — one that does *our* job we write ourselves, and a driver crate never; third-party crates are used as published, and a fork carries a change written to upstream quality and goes when upstream has it. No upstream pull requests are sent for now: ToyOS needs more attention and more contributors before upstream projects take it seriously, and upstreams tend to refuse AI-first projects and their contributions. A third-party source ToyOS cannot build without changing it is carried as an unmodified-source packaging mirror with a byte-identity gate, not as a fork. The north star is **self-hosting**: nothing — build, test, or verification — rests on a host binary. Self-hosting means ToyOS rebuilds itself on ToyOS and reproduces the host's bytes; a bootstrap from source with no binary seed is out of scope.
61
+
**Rust** and **QEMU** for development, on any host OS and architecture — the development machine is nothing special. Beside them, where no Rust tool does the job, only C or C++ tools ToyOS can one day build and run (Python, Perl, CMake, Ninja, make), each declared. No binary for one host OS alone: a macOS binary is a hard no, and "only for tests" does not soften it. ToyOS's own code is Rust; it writes no Python, Perl or shell of its own. Only general and widely used crates — one that does *our* job we write ourselves, and a driver crate never; third-party crates are used as published, and a fork carries a change written to upstream quality and goes when upstream has it. No upstream pull requests are sent for now: ToyOS needs more attention and more contributors before upstream projects take it seriously, and upstreams tend to refuse AI-first projects and their contributions. A third-party source ToyOS cannot build without changing it is carried as an unmodified-source packaging mirror with a byte-identity gate, not as a fork. The north star is **self-hosting**: nothing — build, test, or verification — rests on a host binary. Ask of anything new: could this ever run inside ToyOS? Self-hosting means ToyOS rebuilds itself on ToyOS and reproduces the host's bytes; a bootstrap from source with no binary seed is out of scope.
62
62
63
63
Vendor firmware a device verifies by its maker's signature may be shipped: pinned by version and hash, redistributable unmodified, recorded in `NOTICE`, and loaded only by that device's own driver through its IOMMU domain; it never executes on the CPU.
Copy file name to clipboardExpand all lines: issues/build/the-build-runs-host-tools-outside-rust-and-qemu.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,43 @@ kind: tooling
4
4
opened: 2026-09-29
5
5
---
6
6
7
-
# The build runs C and C++ tools that ToyOS does not yet build and run
7
+
# The build runs host tools outside Rust and QEMU
8
8
9
9
Every tool `main`'s build, tests, workflows and metal loop run outside Rust and
10
-
QEMU, found by the ways `.claude/agents/reviewer.md`'s Arrivals names, with the
11
-
verdict of `CLAUDE.md`'s Dependencies on each; a refused row is a standing
12
-
failure. A workflow's package manager, `apt-get` or `brew`, is how a row
10
+
QEMU, and every one `diag/flash.sh` and the README's flashing steps run by hand,
11
+
with the verdict of `CLAUDE.md`'s Dependencies on each; a refused row is a
12
+
standing failure. A workflow's package manager, `apt-get` or `brew`, is how a row
13
13
arrives and is not one. M4 and M5 are stages of `issues/build/toyos-builds-itself.md`.
14
14
15
15
| tool | runs | verdict | exit |
16
16
|---|---|---|---|
17
17
| Python | LLVM's CMake, whenever this host builds an LLVM (`src/llvm.rs`) | admitted: no Rust tool does the job, LLVM's CMake requires one (`find_package(Python3 … REQUIRED)` in `rust/src/llvm-project/llvm/CMakeLists.txt`) | M5 runs it in the guest |
18
18
| CMake | rustc's bootstrap, for LLVM and clang; `src/llvm.rs`, for the LLVM's key | admitted: no Rust tool does the job, LLVM, clang and LLD are described in CMake, and upstream's only other descriptions are a GN overlay it does not support and a Bazel one | M5 runs it in the guest |
19
-
| Ninja | runs the build CMake generates for LLVM | admitted: no Rust tool does the job, bootstrap has CMake generate for Ninja, and no CMake generator targets a Rust tool | M5 runs it in the guest |
20
-
|`git`| every build, which also adds worktrees (`src/worktree.rs`) and updates submodules (`src/lib.rs`, `src/sysroot.rs`); rustc's bootstrap; every workflow's checkout | admitted: no Rust tool does the job, gitoxide 0.85 adds no worktree and updates no submodule | M4 runs it in the guest |
19
+
| Ninja | runs the build CMake generates for LLVM | refused: a Rust tool does it, n2, named `ninja` as its README directs for CMake: CMake's Ninja generator configured `rust/src/llvm-project/llvm` for it and it built `llvm-tblgen`, exit 0 each; named `n2`, CMake refuses its version, exit 1 | rustc's bootstrap builds LLVM under n2 |
20
+
|`git` for worktrees, submodules, checkouts, fixtures and rustc's bootstrap | adds, removes and prunes worktrees (`src/worktree.rs`, `src/sysroot.rs`); updates submodules (`src/lib.rs`, `src/sysroot.rs`, `src/licence.rs`, `src/release.rs`); fetches the fork from the primary's and checks it out (`src/sysroot.rs`); fast-forwards the primary (`src/sync.rs`); makes the tests' fixture repositories; runs inside rustc's bootstrap | admitted: no Rust tool does the job, gitoxide 0.85 adds, removes and prunes no worktree, updates no submodule, stages, merges, resets and pushes nothing, checks out only a fresh clone and fetches a local path by spawning `git`; a fixture must be what `git` makes, and bootstrap runs `git` itself | M4 runs it in the guest |
21
+
|`git` for reads, and for clones and fetches over HTTPS |`rev-parse`, `show-ref`, `for-each-ref`, `rev-list`, `log`, `branch --contains`, `merge-base`, `ls-tree`, `ls-files`, `cat-file`, `config --get-regexp`, `worktree list`, `status`, `diff`, `ls-remote` and `grep`, in the build system and its tests; `src/sync.rs`'s fetch of `origin`; every workflow's checkout | refused: a Rust tool does it, gitoxide 0.85, which reads refs, objects, the index, config, worktrees and status, walks history, diffs, and lists, fetches and clones a remote over HTTPS; `grep` is a search of the files its index names | those are gitoxide's |
21
22
|`cc`, `c++` and `ar` on a Linux host, `build-essential` on the nightly's runners | rustc links every host binary through `cc`; `cc` and `c++` compile LLVM, clang, LLD and `rustc_llvm` (`src/llvm.rs` names both to bootstrap) and `ring`'s C for `tests/https-server-host` and `tests/https-fetch-host`; `ar` archives what `cc::Build` compiles | admitted: no Rust tool compiles C or C++, or takes rustc's host link | M5: no host in the loop |
23
+
| the toolchain's own `clang`, `llvm-ar`, `rust-lld` and `llvm-config`, built from `ToyOSOrg/llvm-project`| rustc links every guest binary with `rust-lld`; `clang` compiles the C corpus and `hello.c` (`tests/common/compile.rs`, `tests/common/clang.rs`) and, with `llvm-ar`, doomgeneric through `cc::Build` (`src/clang.rs`); rustc's bootstrap asks `llvm-config` how to link LLVM | admitted: our fork's C++, which ToyOS can one day build and run; no Rust tool compiles C, `cc::Build` archives with an `ar`, bootstrap reads LLVM through `llvm-config`, and `CLAUDE.md` links everything with `rust-lld`| M5: no host in the loop |
22
24
|`ovmf-generic`| the UEFI firmware of the nightly's guest containers (`src/firmware.rs`), packaged by Debian apart from QEMU | admitted: QEMU's own firmware, and no Rust firmware does its job | the instrument's QEMU carries its own firmware |
23
25
|`ca-certificates`| the trust store `git` and `curl` verify against in the nightly's containers | admitted: data both of them need | goes when neither runs there |
24
-
|`env`| the two portability jobs run `cargo run -- --build-only` under it, with `GITHUB_ACTIONS` and `CI` unset |admitted: no Rust tool on the runner unsets a variable for one command | M5: no host in the loop|
25
-
|`sudo`, `dd`, `wipefs`, `efibootmgr`, `udevadm`, `mount`, `umount`, `reboot`, `visudo`, `install`, `systemd-analyze`, `ip`, `date`, `cat`, `ls`, `test`, `mkdir`, `rm`, `true`, and the login shell each command reaches |`src/metal.rs`, over `ssh`, on the T14's Ubuntu and never on a development host |admitted: no Rust tool does their job on that Ubuntu | Ubuntu leaves the metal loop (`issues/boot-media/the-machine-updates-itself-without-ubuntu.md`) |
26
-
|`sh` running `rust/x`, and Python running `x.py` and `bootstrap.py`| every toolchain build (`src/toolchain.rs`) | refused: a Rust tool does it, upstream's bootstrap binary, which builds with stable cargo, fetches its own stage0 (`rust/src/bootstrap/src/core/download.rs:595`) and needs no Python |`src/toolchain.rs` runs the bootstrap binary |
26
+
|`env`| the two portability jobs run `cargo run -- --build-only` under it, with `GITHUB_ACTIONS` and `CI` unset |refused: a Rust tool does it, the build system, which already runs that build with both removed (`src/release.rs`) | the build system removes both itself|
27
+
|the T14's Ubuntu, 24.04.4 LTS, and every tool `src/metal.rs` runs on it over `ssh`|the metal loop, on the T14and never on a development host |outside the rule: recovery equipment on a test machine, not the build's host | they leave with Ubuntu (`issues/boot-media/the-machine-updates-itself-without-ubuntu.md`) |
28
+
|`sh` running `rust/x`, and Python running `x.py` and `bootstrap.py`| every toolchain build (`src/toolchain.rs`) | refused: a Rust tool does it, upstream's bootstrap binary, which builds with stable cargo, fetches its own stage0 (`rust/src/bootstrap/src/core/download.rs`) and needs no Python |`src/toolchain.rs` runs the bootstrap binary |
27
29
|`curl` in rustc's bootstrap | fetches the stage0 `rust/src/stage0` pins, for a compiler or LLVM build whose build directory lacks it, whichever bootstrap runs | refused: a Rust tool does it, rustup installs the dated beta the pin names, and bootstrap takes a stage0 through `build.rustc` and `build.cargo`, as `src/sysroot.rs` hands it one | no toolchain build fetches with `curl`|
28
30
|`curl` in `src/release.rs` and `src/sdkversion.rs`| the toolchain release's lookup and download and the crates.io index, on CI runners only | refused: a Rust tool does it, `ureq`, which `userland/doom/build.rs` already fetches with | those fetches are Rust's |
29
31
|`tar` and `zstd`|`src/release.rs` packs and unpacks the toolchain release, on CI runners only | refused: a Rust tool does it, the `tar` crate `userland/doom/build.rs` already unpacks with, and a zstd crate | both are done in Rust, in-process |
30
32
|`gh`|`src/release.rs` asks whether a toolchain release exists, creates it and moves the `sdk-<version>` alias, on the nightly's `build` runner | refused: not C or C++ source, it is Go |`src/release.rs` speaks GitHub's REST API itself |
31
33
|`ssh`|`src/metal.rs` reaches the T14's Ubuntu with it, only in the metal loop | refused: a Rust tool does it, the repository's own russh client `crate::build::ssh_client_host`, which `src/metaltalk.rs` already drives |`src/metal.rs` drives that client, or Ubuntu leaves the loop |
32
-
|`cc`, `c++`, `ar` and `xcrun` on a macOS host, Apple's Command Line Tools | what the Linux row's tools do, and rustc asks `xcrun` for the SDK on every host link that names no `SDKROOT` (`rust/compiler/rustc_codegen_ssa/src/back/apple.rs:230`), as `src/llvm.rs` does for the LLVM's key | refused: one host OS alone | M5: no host in the loop |
34
+
|`cc`, `c++`, `ar` and `xcrun` on a macOS host, Apple's Command Line Tools | what the Linux row's tools do, and rustc asks `xcrun` for the SDK on every host link that names no `SDKROOT` (`rust/compiler/rustc_codegen_ssa/src/back/apple.rs`), as `src/llvm.rs` does for the LLVM's key | refused: one host OS alone | M5: no host in the loop |
33
35
|`newfs_msdos` and `hdiutil`|`toyos-fat32`'s host tests format and mount their fixtures with them (`toyos-fat32/tests/common/mod.rs`), which keeps the `host` job on `macos-latest`| refused: one host OS alone |`issues/filesystem/fat32-suite-needs-macos-binaries.md`|
34
36
|`diag/flash.sh`| the owner's flash of a stick by hand: `bash`, and the `stat`, `seq`, `tr`, `grep`, `cut` and `sync` it strings together | refused: shell of our own |`issues/build/the-owners-flash-script-runs-diskutil.md`|
35
37
|`diskutil` and `plutil`|`diag/flash.sh`, and `diskutil` in the README's flashing steps | refused: one host OS alone |`issues/build/the-owners-flash-script-runs-diskutil.md`|
36
38
|`shasum`, a Perl script on macOS |`diag/flash.sh` hashes the image with it | refused: a Rust tool does it, `sha2`, which `src/release.rs` hashes with |`issues/build/the-owners-flash-script-runs-diskutil.md`|
37
-
|`dd`|`diag/flash.sh` writes the stick with it | refused: a Rust tool does it, the build system can write the image itself |`issues/build/the-owners-flash-script-runs-diskutil.md`|
38
-
|`sudo`|`diag/flash.sh` runs `dd` under it | admitted: no Rust tool raises a process to root on macOS | goes with `diag/flash.sh`|
39
+
|`lsblk`| the README's Linux flashing steps find the stick with it | refused: one host OS alone |`issues/build/the-owners-flash-script-runs-diskutil.md`|
40
+
|`dd`|`diag/flash.sh` and the README's flashing steps write the stick with it | refused: a Rust tool does it, the build system can write the image itself |`issues/build/the-owners-flash-script-runs-diskutil.md`|
41
+
|`sync`| the README's Linux flashing steps flush the stick with it | refused: a Rust tool does it, the build system can flush what it writes |`issues/build/the-owners-flash-script-runs-diskutil.md`|
42
+
|`sudo` on macOS |`diag/flash.sh` and the README's macOS flashing steps run `dd` under it | admitted: no Rust tool raises a process to root on macOS | goes with both flashes by hand |
43
+
|`sudo` on Linux | the README's Linux flashing steps run `dd` under it | refused: a Rust tool does it, sudo-rs | the README's Linux steps run sudo-rs |
39
44
|`sh` running rustup's `rustup-init.sh`| the nightly's three rustup installs, fetched with `curl`| refused: a Rust tool does it, rustup's own `rustup-init` binary | a job installs rustup without it |
40
45
|`nightly.yml`, job `build`, step "disk, QEMU, CMake and Ninja" |`sudo rm -rf` of five preinstalled SDK directories, then `sudo apt-get update` and `install`| refused: shell of our own | each step is one command |
41
46
|`nightly.yml`, step `deps`, which jobs `guest` and `tcg` share | the snapshot archive read out of `debian.sources` with `sed`, checked with `test` and written back with `echo` and `rm`, a three-attempt `apt-get` loop with `sleep` and `cat`, `git config`, and rustup through `curl`, `sh` and `echo`| refused: shell of our own | each step is one command |
0 commit comments