2018-07-26 17:17:12 +00:00
|
|
|
|
-*- org -*-
|
|
|
|
|
#+TITLE: bootstrappable.org project
|
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
|
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-07-26 17:17:12 +00:00
|
|
|
|
|
|
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
|
notice and this notice are preserved.
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
|
|
|
|
* What?
|
2019-11-04 18:59:13 +00:00
|
|
|
|
** Full source bootstrapping for GNU Guix
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
|
A package in Guix is uniquely identified by the hash of its source code,
|
|
|
|
|
its dependencies, and its build recipe.
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
Every package can be built from source, except for the bootstrap
|
|
|
|
|
binaries.
|
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
|
*** From the Guix manual
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
The distribution is fully “bootstrapped” and “self-contained”: each
|
|
|
|
|
package is built based solely on other packages in the distribution.
|
|
|
|
|
|
|
|
|
|
The root of this dependency graph is a small set of “bootstrap
|
|
|
|
|
binaries”, provided by the ‘(gnu packages bootstrap)’ module. For more
|
|
|
|
|
information on bootstrapping, *note Bootstrapping::.
|
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
|
**** Guix bootstrap tarballs
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
$ du -schx $(readlink $(guix build bootstrap-tarballs)/*)
|
|
|
|
|
2.1M /gnu/store/9623n4bq6iq5c8cwwdq99qb7d0xj93ym-binutils-static-stripped-tarball-2.28.1/binutils-static-stripped-2.28.1-x86_64-linux.tar.xz
|
|
|
|
|
18M /gnu/store/437xwygmmwwpkddcyy1qvjcv4hak89pb-gcc-stripped-tarball-5.5.0/gcc-stripped-5.5.0-x86_64-linux.tar.xz
|
|
|
|
|
1.8M /gnu/store/55ccx18a0d1x5y6a575jf1yr0ywizvdg-glibc-stripped-tarball-2.26.105-g0890d5379c/glibc-stripped-2.26.105-g0890d5379c-x86_64-linux.tar.xz
|
|
|
|
|
5.7M /gnu/store/bqf0ajclbvnbm0a46819f30804y3ilx0-guile-static-stripped-tarball-2.2.3/guile-static-stripped-2.2.3-x86_64-linux.tar.xz
|
|
|
|
|
5.8M /gnu/store/j8yzjmh9sy4gbdfwjrhw46zca43aah6x-static-binaries-tarball-0/static-binaries-0-x86_64-linux.tar.xz
|
|
|
|
|
33M total
|
|
|
|
|
$ for i in $(readlink $(guix build bootstrap-tarballs)/*);\
|
|
|
|
|
do sudo tar xf $i; done
|
|
|
|
|
$ du -schx *
|
|
|
|
|
130M bin
|
|
|
|
|
13M include
|
|
|
|
|
54M lib
|
|
|
|
|
51M libexec
|
|
|
|
|
5.2M share
|
|
|
|
|
252M total
|
|
|
|
|
|
2017-08-26 11:29:07 +00:00
|
|
|
|
* Why?
|
|
|
|
|
** Reproducibility is essential to Software Freedom
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
2017-08-26 11:29:07 +00:00
|
|
|
|
Reproducible builds are a set of software development practices that
|
|
|
|
|
create a verifiable path from human readable source code to the binary
|
|
|
|
|
code used by computers.
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
*** What about the bootstrap binaries and the compilers?
|
|
|
|
|
|
2017-08-26 11:29:07 +00:00
|
|
|
|
We have the sources: they always lead to bitwise-same binary, but what
|
2018-04-21 22:45:00 +00:00
|
|
|
|
about the bootstrap binaries and compilers?
|
|
|
|
|
|
2017-08-26 11:29:07 +00:00
|
|
|
|
*** The current way out: Ignore the problem
|
|
|
|
|
|
2018-06-27 11:42:47 +00:00
|
|
|
|
``recipe for yogurt: add yogurt to milk''
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-04-21 22:45:00 +00:00
|
|
|
|
*** New solution: Full source bootstrapping path
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-04-21 22:45:00 +00:00
|
|
|
|
* How?
|
2018-07-22 12:24:36 +00:00
|
|
|
|
** Software: MesCC-tools, M2-Planet, GNU Mes and MesCC
|
2018-04-21 22:45:00 +00:00
|
|
|
|
** MesCC-tools
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2019-11-04 18:59:13 +00:00
|
|
|
|
https://savannah.gnu.org/projects/mescc-tools
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-04-21 22:45:00 +00:00
|
|
|
|
*** hex.0: ~500 byte well-documented, self-hosting hex assembler
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-04-21 22:45:00 +00:00
|
|
|
|
This 500 byte program is written in ASCII hex. When converted
|
|
|
|
|
byte-for-byte from ASCCI to binary we have the only binary seed that
|
|
|
|
|
our full source bootstrap path needs.
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-04-21 22:45:00 +00:00
|
|
|
|
We bless this simple and easily verifyable binary and consider it to
|
|
|
|
|
be source.
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-04-21 22:45:00 +00:00
|
|
|
|
*** hex1: next level hex assembler written in hex.0
|
|
|
|
|
*** M0: a macro assembler written in hex.1
|
|
|
|
|
*** M1: a macro assembler written in M0
|
|
|
|
|
*** hex2: a hex2 linker written in M0
|
|
|
|
|
*** M2-Planet: a self-hosting M2 (C-with-structs) transpiler written in M1
|
2018-07-22 12:24:36 +00:00
|
|
|
|
*** GNU Mes: A Scheme interpreter written in C, with cpp transformed into M2
|
2018-04-21 22:45:00 +00:00
|
|
|
|
*** MesCC: A C compiler written in Scheme
|
|
|
|
|
*** tcc-boot: a patched version of TinyCC
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-07-22 12:24:36 +00:00
|
|
|
|
** GNU Mes and MesCC
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-07-22 12:24:36 +00:00
|
|
|
|
https://www.gnu.org/software/mes
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
2018-06-26 20:22:56 +00:00
|
|
|
|
*** mes.c: a Scheme interpreter in ~5,000LOC of simple C
|
2018-04-21 22:45:00 +00:00
|
|
|
|
*** mescc: a C compiler written in Scheme (uses Nyacc C99 parser in Scheme)
|
|
|
|
|
*** mes.M2: this Scheme interpreter in preprocessed M2
|
|
|
|
|
|
|
|
|
|
** TinyCC
|
|
|
|
|
|
|
|
|
|
https://gitlab.com/janneke/tinycc
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
|
|
|
|
* TODO
|
2018-05-19 18:52:24 +00:00
|
|
|
|
** remove or upstream patches from tcc-boot
|
|
|
|
|
** prepare src/mes.c for M2-Planet transpiler.
|
2019-11-04 18:59:13 +00:00
|
|
|
|
** ARM, the Hurd
|
2018-05-19 18:52:24 +00:00
|
|
|
|
** fix bootstrap-loops: (Nyacc?, mes.M2, psyntax.pp?)
|
2017-08-26 11:29:07 +00:00
|
|
|
|
** make GNU gcc (8.0?) bootstrappable again, remove [need for] tcc stage
|
2018-04-21 22:45:00 +00:00
|
|
|
|
* DONE
|
2019-11-04 18:59:13 +00:00
|
|
|
|
** upstream mes-boot to Guix.
|
|
|
|
|
** replace Guix bootstrap for x86_64.
|
|
|
|
|
** replace Guix bootstrap for x86.
|
2018-07-26 17:17:12 +00:00
|
|
|
|
** add full source gcc-4.7 package build.
|
2018-06-24 11:13:13 +00:00
|
|
|
|
** bootstrap gcc+glibc-built binutils-20.1, gcc-4.1.0.
|
2018-05-23 20:48:00 +00:00
|
|
|
|
** have tcc-boot compile gnutools triplet: binutils-2.14, gcc-2.95.3, glibc-2.2.5.
|
2018-05-19 18:52:24 +00:00
|
|
|
|
** have tcc-boot's mes-tcc compile a fully functional tcc
|
2018-04-21 22:45:00 +00:00
|
|
|
|
** hex.0, hex.1, M0
|
2018-06-26 20:22:56 +00:00
|
|
|
|
** M1, hex2_linker in simple C
|
2018-04-21 22:45:00 +00:00
|
|
|
|
** M2-Planet is now self-hosting, written in M2
|
|
|
|
|
** mes+mescc are mutual self-hosting
|
|
|
|
|
** patched tcc compiled with mes+mescc
|
|
|
|
|
** during development we run mescc on Guile (mes is ~30 times slower)
|
|
|
|
|
** tcc compiled with gcc is known to compile gcc
|
|
|
|
|
|
2017-08-26 11:29:07 +00:00
|
|
|
|
* Contact
|
|
|
|
|
** #bootstrappable, #guix on freenode
|
|
|
|
|
** bootstrappable.org
|