Subscriptions are the lifeblood of LWN.net. If you admit this content and would for illustration to spot much of it, your subscription will help to guarantee that LWN continues to thrive. Please visit this page to subordinate up and support LWN on the net.
By Jake Edge
August 17, 2026
FOSSY
This year's version of theand Open Source Software Yearly conference, amended known arsenic "FOSSY", moved northbound to the beautiful (and enormous) field of the University of British Columbia (UBC) in Vancouver, Canada from its location for the 3 erstwhile editions: Portland, Oregon, successful the US. There were galore different types of talks at FOSSY, from profoundly method kernel-track topics, done talks connected legal and organization issues, to the "FOSS successful Daily Life" talks. In the "Toolchains and Other Development Tools" track, Timothy Sample gave a presentation about bootstrappable builds, which is somewhat little well-known than its cousin, reproducible builds, though LWN did look astatine the topic conscionable complete 2 years ago. In short, a bootstrappable build is 1 that starts pinch a tiny program that tin build different somewhat larger program, which tin build yet another, and truthful on, until the entirety of a modern Linux personification abstraction is built from a mini seed. Ultimately, it results successful codification pinch a completely understood origin—unlike a emblematic Linux personification abstraction today.
He began by asking attendees whether they had heard of bootstrappable builds and whether they were mostly acquainted pinch the idea; he seemed impressed that the mostly knew the word and that astir half of the assemblage knew more than that. He said that he embarked connected the way toward bootstrappable builds almost 10 years agone erstwhile he started utilizing GNU Guix (which he pronounced "geeks"—surprising me). At that time, if you were utilizing Guix, you were contributing to it, he said pinch a chuckle. Guix is a "functional package manager" that is similar to (and inspired by) Nix.
For some Guix and Nix, each of the package successful the strategy is represented in a "derivation graph", which describes really to build each of its programs. There are various inputs required successful bid to beryllium capable to build a particular program, which are specified successful the graph. The measurement to build each of the inputs (and, of course, the inputs to the inputs and truthful on) is also represented successful the graph. "There's hundreds and hundreds of nodes in modern software, which is terrifyingly complex."
He gave the illustration of a Python program. It, obviously, requires Python in order to run, but Python is simply a C program, truthful a C compiler is needed. That C compiler is written successful immoderate language, truthful a compiler for that language will beryllium needed. And truthful on. Guix collects each of that into the graph, which is an entity that tin beryllium looked astatine and explored. "So you start wondering who compiles my compiler's compiler compiler and wherever does it stop?"
For a strategy for illustration Debian, it stops astatine a C compiler binary that personification has uploaded to the repositories. For Guix, the original stopping constituent was a 250MB statically linked blob of GNU user-space programs. The reply to where each of that codification came from is not wholly clear, of course, which was unsatisfying to Guix developers. That blob could beryllium built reproducibly, which is good, Sample said, but does not lick the full problem.
Bootstrappable
The basal thought down bootstrappable builds is to create a strategy that can be built without relying connected pre-built artifacts. "Can we spell from zero to the modern time without having to conscionable presume the beingness of these already-built-for-us artifacts?" The classical look for yogurt requires immoderate yogurt to commencement the process, which is for illustration really we normally build a C compiler today—we commencement pinch an existing C compiler binary. You might deliberation astir making sourdough breadstuff pinch your grandmother's starter brought complete from the aged country; "we're fundamentally making C compilers with Dennis Ritchie's starter carried complete from Bell Labs".
It is not conscionable C, of course, arsenic it is existent for astir languages. It is something of a constituent of pridefulness for languages to "self host" by penning the compiler and different devices successful the connection itself. It is earthy for the language developers to do that, because obviously their connection is the best, but it leaves thing of a chicken-and-egg problem behind. Bootstrappable builds is an effort to move beyond that and to build these devices "from scratch".
Reproducible builds let group to "have much assurance that the binary you are using, which is really executing connected the computer, corresponds to the root code". A personification tin person a binary that purports to travel from a group of root codification files, but really tin they beryllium sure that it does? With a reproducible build, they tin create the binary themselves and cheque to guarantee that it is bit-for-bit the aforesaid arsenic what they were given.
Bootstrappable builds do precisely the aforesaid thing, but they grip a different nonaccomplishment mode. If a reproducible build fails to verify, that's because the personification who built the binary is lying aliases mistaken astir wherever it came from. Bootstrappable builds tin forestall the kinds of problems that Ken Thompson described successful his celebrated Turing Award lecture: Reflections on Trusting Trust.
An illustration that Thompson gave successful that speech asked wherever successful a C compiler you tin find the meaning of "\n", Sample said. Looking successful the source code of the compiler will not show a definition, it will simply supply the circular meaning that "\n" is "\n"; the conversion of "\n" to ASCII ten is embodied successful the C compiler binary itself. Thompson continued his lecture by noting that thing alternatively much dangerous, specified arsenic a backdoor for the login program, could besides beryllium hidden successful the compiler successful the same way.
It is not conscionable C compilers, aliases moreover conscionable compilers, that tin person this sort of flaw; immoderate self-hosting programme tin perchance autumn prey to it. Programs of this benignant tin region specifications from the root codification and person them persist successful binary form. As he was preparing for the talk, a colleague pointed him astatine a caller paper ("Trusting-Trust Attack against an Entire Linux Distribution through Binary Manipulation") that showed an existent onslaught of this sort. The researchers inserted a backdoor into the strip program connected NixOS, which is tally connected astir each binary that is built connected the system. "They were capable to backdoor fundamentally each azygous programme on the strategy successful a measurement that's wholly invisible from source-code analysis." That is the benignant of onslaught that bootstrappable builds is meant to thwart.
While the information perspective is the largest use of bootstrappable builds, Sample said that location are software-freedom aspects too. Being capable to read the root codification is useful, but knowing that the root code corresponds to the moving programme is important arsenic well. There is besides a sense of pridefulness that galore programmers person successful making their codification clear and understandable. Ensuring that the codification tin beryllium inspected and that each of its details beryllium successful immoderate disposable assemblage of root codification is portion of that.
The champion measurement to grip bootstrapping is proactively, he said. Before a compiler is self-hosted, it is usually written successful immoderate different language; preserving that codification and maintaining it alongside the self-hosted version provides a intends to guarantee that thing is hidden successful the binary. That is what the GNU Guile project does; it is simply a type of Scheme that is utilized by Guix and various other projects. Guile still has a C implementation of the language available to usage for bootstrapping the compiler. GNU Make has a makefile, of course, but it besides has a ammunition book successful lawsuit nary make is available. "We admit that we're a basal build instrumentality and that there should beryllium different on-ramp here."
For devices that only support a self-hosted build, there are immoderate techniques that he and others successful the bootstrappable-builds community usage to circumvent that lack. The first is an "archaeological dig", which uses the history of the task to find a non-self-hosted version; that type is built utilizing the devices from that era. "Then you move done history, type aft type [...] until you get to the modern tool." Sometimes immoderate of the type steps tin beryllium skipped, but wide it is simply a slow process. "In immoderate ways, it conscionable benignant of kicks the tin down the road; technically, you do person each of the root code", but asking personification to look at, say, 12 different versions of a instrumentality is alternatively daunting; it would beryllium bully for location to just beryllium 1 type to verify.
An assemblage personnel asked if this was for illustration utilizing the OCaml type of the Rust compiler to bootstrap to existent Rust; Sample said that it was, except that the OCaml Rust compiler is nary longer available. Another attendee noted that the Plan 9 C compiler that was utilized to build the Go programming connection is still available, arsenic is the earlier Plan 9 C compiler that built that C compiler. Those kinds of build chains are normal for Guix, Sample said. For Rust, it presently starts pinch the C++-based mrustc to build Rust type 1.54 aliases 1.56; modern Rust is 1.97 and astir every version successful betwixt must beryllium built, which is rather slow. When rebuilding a Guix system, Sample said, "it's very depressing erstwhile you deed this chain of Rust compiles"; an attendee said it took them 3 days to build that connected their Arm laptop.
The extremity consequence of those chains is not each that bully because of the number of steps that request to beryllium verified. An replacement is to "purpose-build a caller instrumentality for bringing thing up", which is precisely what mrustc is. The consequence is nicer, pinch a azygous codification guidelines to inspect, but "it takes forever" to create a bespoke instrumentality of that sort. He has done immoderate of that and the consequence is unsatisfying astatine immoderate level because the instrumentality simply exists to alteration different instrumentality to beryllium bootstrapped. Beyond that, the tool will require attraction to support up pinch the target tool, but it is not particularly breathtaking activity that mightiness pull different developers.
The astir successful bootstrappable builds usage a operation of the two approaches. As pinch Rust and mrustc, they spell backmost successful clip to a simpler version that tin beryllium built pinch an replacement bespoke tool, past move forward to the present-day version. In fact, mrustc tin now build Rust 1.90, but that has not been integrated into Guix yet; he plans to do truthful in the adjacent future.
Projects
He returned to Guix and its seed, which is only astir 256 bytes these days, alternatively than the 250MB blob. It consists of a programme called hex0, which tin "build up done many many layers and yet gets to GCC 2, GCC 4, and modern GCC, and modern Guile and each these tools". While that's "super cool", there are a batch of caveats; the biggest is that a statically linked Guile is still utilized "to do a bunch of stuff". That is "absolutely cheating", he said, but location are plans to hole that, which he is working on, but it is going to return immoderate clip to achieve.
The different point that often disappoints group is that location is nary answer for really to bootstrap the kernel. Guix assumes location is simply a kernel; "it'll bootstrap each of userland from nothing, but the kernel is outside of the scope of this discussion".
A related task is live-bootstrap, which useful pinch Guix and uses galore of the aforesaid devices and approaches; live-bootstrap moves much quickly than Guix, however, and has explored bootstrapping kernels utilizing the Fiwix kernel. Live-bootstrap regenerates immoderate of the machine-created files that mightiness travel a root release (e.g. configure) arsenic well; it is "very admirable how thoroughgoing they are", but the "downside is it's extremely complicated".
To show that, he put up the 182-step process to bootstrap the system. It lists devices that request to beryllium built in the bid needed to get astatine a guidelines Linux system. It starts with hex0, builds various different tools, including aggregate C compilers of expanding complexity, galore versions of Perl successful bid to bootstrap Automake and Autoconf, and truthful on. It does not see devices for illustration Rust and Go; "it's conscionable the modern GNU/Linux guidelines system".
"It's awesome that they've done that work, it's beautiful chaotic and complicated, and it would beryllium bully to amended that", Sample said.
The hex0 programme provides a measurement to turn a drawstring of hexadecimal matter into a binary pinch those bytes. Normally, that is utilized to build hex1 and hex2, which are besides hexadecimal converters adding single-character labels (hex1) and much complete labels that let fancier addressing modes (hex2). Using those, M0 tin beryllium built, which allows utilizing assembly mnemonics, rather than hex opcodes.
Sample said that he had omitted a fewer steps but that yet M2-Planet tin be built, which "is almost for illustration C"; codification tin beryllium compiled, but sometimes definite C features will beryllium missing truthful it will request to be rewritten to debar them. At that point, everything switches complete to usage GNU Mes, which is simply a Scheme interpreter written successful the M2-Planet dialect of C. Mes has a C library (Meslibc) and a C compiler written successful Scheme (MesCC). Those let building the Tiny C Compiler (TCC), which "is a simple C compiler but overmuch much complete than MesCC". Modern development devices tin past beryllium built utilizing TCC.
Germ
That is the way taken by some Guix and live-bootstrap. "It works, [...] but everything is ace complicated." He is moving connected a different approach, called Germ (or Germ Lisp), which is introduced successful a blog post connected his site. In that post, he pointed retired that the existing mechanism goes from C to Scheme and backmost to C, each to extremity up successful Guix, which is Scheme-based. But, he recognized, that "a primitive Lisp expert is not overmuch much analyzable than a primitive assembler."
He useful connected Mes and likes it; "sometimes I get paid to activity connected Mes, Mes is great". But he is besides penning a Mes replacement, which is not all that uncommon. There are Mes replacements being written successful Haskell and ML, for example; everyone who looks astatine the problem instantly wants to write the replacement successful Forth, he said. Bootstrapping Forth via a hex show is an evident usage of the language, but astir developers do not want constitute the remainder of the codification in Forth, he thinks; "I would alternatively publication the binary". From the audience, Keith Packard said: "Assembly is easier to constitute than Forth."
Scheme folks are different, Sample said, and are consenting to constitute codification in that language. The intent of Germ is jump complete each of the intermediate steps and person a Scheme expert from the start. "It conscionable says: 'Scheme, go!', good it has 2 stages, but almost 'Scheme, go!'." It is how Mes was designed originally, he said; it took immoderate shortcuts that allowed it to win early, "but now it's getting stuck".
Germ is astir 2.25KB; he wanted it to beryllium 2KB, but missed that extremity by a little. It is simply a binary that "can tally almost-Scheme"; it is conscionable enough Scheme that it tin tally an assembler written successful Scheme. That assembler is used to build the 2nd stage, which is "kind of conscionable for illustration a Scheme interpreter". It has contiguous bytes and vectors, features for I/O and moving pinch the kernel, and it will almost run unmodified Guix build scripts (there are still a fewer dangling items to fully make that work). It uses MesCC to compile C codification and has a Scheme ammunition that he wrote years agone for handling ammunition scripts; "eventually it'll run awk scripts and sed scripts".
Sample said that attendees mightiness beryllium expecting a demo astatine that constituent successful his talk, but that he had been giving 1 throughout, arsenic his slides were running on his laptop utilizing Germ. He added an interface to SDL, provided a "draw pixel" function for Germ, and loaded successful the font information. As was guessed by an audience personnel (winning the 1000-nerd-point prize), the font he utilized was from the original Symbolics Lisp machine.
He took a little circuit of the Germ code, showing the Scheme-based assembly (like that successful memory.scm), while noting that he maintains a regular assembly type (memory.s) in parallel. There is simply a applicable broadside to that choice, arsenic well, since by utilizing a existent assembler "you get debugging symbols and everything, with the different 1 you astir surely don't", he said pinch a laugh.
Overall, Germ hits his goals well. It quickly rises to a precocious level of abstraction that precisely fits the Guix usage case. All of the Guix build scripts are written successful Scheme; Guix avoids utilizing ammunition scripts for the most part.
It's conceptually simple. Now I cognize not everyone loves Lisp or Scheme—somehow it's controversial—but regular old, plain Scheme has sewage to be amended than this building of bespoke assemblers and compilers for languages that don't rather exist.That connection was met pinch immoderate laughter from the assemblage arsenic mightiness be guessed—Lisp/Scheme are arguable and somewhat divisive, aft all. The biggest problem that Germ faces is not surprising, he said: performance. He is penning a Scheme successful the aforesaid measurement that the original Lisp interpreters were written successful the 1950s, utilizing assembly language. "I can't bring to carnivore each of the modern techniques because penning in assembly is difficult and keeping things mini is hard."
Germ is "faster than Mes, technically", astatine slightest connected a micro-benchmark of making usability calls. But whenever a existent programme is being run, Mes is overmuch faster because astir everything successful Germ runs in Scheme (e.g. loops). For a comparison, it takes astir 100 seconds for Mes to compile itself connected his desktop, aliases 60 seconds if the experimental bytecode compiler is used. Compiling Mes connected Germ, pinch a bunch of optimizations that he is testing enabled, takes astir 140-150 seconds. The problem pinch that is that Mes is "unbearably slow", truthful being worse than Mes is something of a non-starter.
In addition, Germ is little portable than Mes, which tin tally connected Arm and RISC-V, while Germ is x86_64-only astatine this point. Another problem Germ faces is that "people conscionable dislike parens", which is irrational, but he can relate because he was 1 of the haters until he ran into Guix. Scheme is a comparatively easy connection to implement, though, and, since it meshes good with Guix, makes a batch of consciousness for bootstrapping.
Future
Looking ahead, he would for illustration to merge Germ pinch Guix "in a way that's breathtaking for everyone". Currently, Guix depends on %bootstrap-guile, which is the statically linked Guile binary, but Germ could perchance switch that; it could besides beryllium replaced pinch Mes, but either measurement would beryllium a bully measurement forward.
He would besides for illustration to activity connected the capacity of Germ; moving immoderate of the looping constructs into the assembly codification is immoderate low-hanging fruit. "That feels for illustration band-aids", however, and he wonders if he should simply constitute a compiler; location is simply a request for a compiler backend for C, so maybe the 2 could beryllium combined. He has immoderate starting activity toward a RISC-V port that he would for illustration to decorativeness arsenic well.
He ended the talk there, but location was lively Q&A convention aft that. Packard asked really overmuch of Scheme was implemented successful Germ; was it R5RS compliant, for example? Sample said that it is simply a Guile Scheme, but does not person extras for illustration the Guile Object Oriented Programming System (GOOPS); it is efficaciously an R7RS Scheme, but he took immoderate shortcuts like removing floating-point numbers since he does not request them.
Mark Wielaard asked really galore of the 182 steps were removed by this work. Sample said that successful his "dreaming mind", Germ would service arsenic a wedge that others would usage to create Scheme-based shortcuts to region immoderate of the agelong chains of builds (e.g. Perl and autoconf) and trim the problem further. He acknowledged Wielaard's estimate of much than 80 steps still remaining; Wielaard pointed retired that personification could sabotage measurement 73 and it is apt that it would spell unnoticed. Sample agreed that it was a known flaw successful the approach, but that the number of steps was being reduced to slowly amended the expertise to verify everything.
The seed could beryllium smaller than the 2.25KB if he wanted, an attendee said. He agreed and noted that he could simply usage hex0 to load the first shape of Germ, but "I don't want to play games, I want to actually get results". He did not want to commencement immoderate fights and respected those who use hex0, but it feels a spot for illustration cheating to him.
The last mobility was whether Germ had a read-eval-print loop (REPL); the answer was yes, of course, since he had been displaying his slides using it. He showed the REPL and his usage of the (next-slide) and (prev-slide) functions; he besides demonstrated that it gives a backtrace connected errors. "I programme successful this each the time, it can't be driving maine crazy; it has to person a fewer animal comforts." He took some shortcuts (e.g. nary floating-point numbers), but it has immoderate extras too, specified arsenic delimited continuations.
He closed by noting that Germ has "the fanciest macros", including a working syntax-case form. He had to instrumentality that himself, since, ironically, location is no bootstrappable syntax-case—it is written utilizing syntax-case.
[I would for illustration to convey the Linux Foundation, LWN's recreation sponsor, for
helping pinch my recreation expenses to Vancouver for FOSSY.]
The LWN tract is presently nether precocious scraper load, truthful comment show has been suppressed for anonymous users. If you are a human, you whitethorn publication the comments by clicking the fastener below:
Note: you tin debar this measurement successful the early by logging into your LWN account.
English (US) ·
Indonesian (ID) ·