doc: Release udpate.
[mes.git] / BOOTSTRAP
1 bootstrappable.org project                                           -*- org -*-
2
3 * What?
4 ** Full source bootstrapping for GuixSD
5
6 A package in GuixSD is can be uniquely identified by the hash of its
7 source code, its dependencies and its build recipe.
8
9 Every package can be built from source, except for the bootstrap
10 binaries.
11
12 *** From the GuixSD manual
13
14    The distribution is fully “bootstrapped” and “self-contained”: each
15 package is built based solely on other packages in the distribution.
16
17 The root of this dependency graph is a small set of “bootstrap
18 binaries”, provided by the ‘(gnu packages bootstrap)’ module.  For more
19 information on bootstrapping, *note Bootstrapping::.
20
21 **** GuixSD bootstrap tarballs
22
23 $ du -schx $(readlink $(guix build bootstrap-tarballs)/*)
24 2.1M    /gnu/store/9623n4bq6iq5c8cwwdq99qb7d0xj93ym-binutils-static-stripped-tarball-2.28.1/binutils-static-stripped-2.28.1-x86_64-linux.tar.xz
25 18M     /gnu/store/437xwygmmwwpkddcyy1qvjcv4hak89pb-gcc-stripped-tarball-5.5.0/gcc-stripped-5.5.0-x86_64-linux.tar.xz
26 1.8M    /gnu/store/55ccx18a0d1x5y6a575jf1yr0ywizvdg-glibc-stripped-tarball-2.26.105-g0890d5379c/glibc-stripped-2.26.105-g0890d5379c-x86_64-linux.tar.xz
27 5.7M    /gnu/store/bqf0ajclbvnbm0a46819f30804y3ilx0-guile-static-stripped-tarball-2.2.3/guile-static-stripped-2.2.3-x86_64-linux.tar.xz
28 5.8M    /gnu/store/j8yzjmh9sy4gbdfwjrhw46zca43aah6x-static-binaries-tarball-0/static-binaries-0-x86_64-linux.tar.xz
29 33M     total
30 $ for i in $(readlink $(guix build bootstrap-tarballs)/*);\
31   do sudo tar xf $i; done
32 $ du -schx *
33 130M    bin
34 13M     include
35 54M     lib
36 51M     libexec
37 5.2M    share
38 252M    total
39
40 * Why?
41 ** Reproducibility is essential to Software Freedom
42
43 Reproducible builds are a set of software development practices that
44 create a verifiable path from human readable source code to the binary
45 code used by computers.
46
47 *** What about the bootstrap binaries and the compilers?
48
49 We have the sources: they always lead to bitwise-same binary, but what
50 about the bootstrap binaries and compilers?
51
52 *** The current way out: Ignore the problem
53
54  ``recipe for yoghurt: add yoghurt to milk''
55
56 *** New solution: Full source bootstrapping path
57
58 * How?
59 ** Software: MesCC-tools, M2-Planet, Mes and MesCC
60 ** MesCC-tools
61
62     https://github.com/oriansj/mescc-tools
63
64 *** hex.0: ~500 byte well-documented, self-hosting hex assembler
65
66 This 500 byte program is written in ASCII hex.  When converted
67 byte-for-byte from ASCCI to binary we have the only binary seed that
68 our full source bootstrap path needs.
69
70 We bless this simple and easily verifyable binary and consider it to
71 be source.
72
73 *** hex1: next level hex assembler written in hex.0
74 *** M0: a macro assembler written in hex.1
75 *** M1: a macro assembler written in M0
76 *** hex2: a hex2 linker written in M0
77 *** M2-Planet: a self-hosting M2 (C-with-structs) transpiler written in M1
78 *** Mes: A Scheme interpreter written in C, with cpp transformed into M2
79 *** MesCC: A C compiler written in Scheme
80 *** tcc-boot: a patched version of TinyCC
81
82 ** Mes and MesCC
83
84     https://gitlab.com/janneke/mes
85
86 *** mes.c: a Scheme interpreter prototyped in C ~3000 Lines
87 *** mescc: a C compiler written in Scheme (uses Nyacc C99 parser in Scheme)
88 *** mes.M2: this Scheme interpreter in preprocessed M2
89
90 ** TinyCC
91
92     https://gitlab.com/janneke/tinycc
93
94 * TODO
95 ** upstream mes-boot to GuixSD.
96 ** add full source gcc-4.7 package build.
97 ** replace GuixSD bootstrap for x86.
98 ** remove or upstream patches from tcc-boot
99 ** prepare src/mes.c for M2-Planet transpiler.
100 ** fix bootstrap-loops: (Nyacc?, mes.M2, psyntax.pp?)
101 ** make GNU gcc (8.0?) bootstrappable again, remove [need for] tcc stage
102 ** integrate with GuixSD
103 ** x86_64, arm, the Hurd
104
105 * DONE
106 ** have tcc-boot compile gnutools triplet: binutils-2.14, gcc-2.95.3, glibc-2.2.5.
107 ** have tcc-boot's mes-tcc compile a fully functional tcc
108 ** hex.0, hex.1, M0
109 ** M1, hex2_linker prototyped in C
110 ** M2-Planet is now self-hosting, written in M2
111 ** mes+mescc are mutual self-hosting
112 ** patched tcc compiled with mes+mescc
113 ** during development we run mescc on Guile (mes is ~30 times slower)
114 ** tcc compiled with gcc is known to compile gcc
115
116 * Contact
117 ** #bootstrappable, #guix on freenode
118 ** bootstrappable.org