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-12-09 06:26:16 +00:00
|
|
|
|
** Full source bootstrapping for the GNU System
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
2019-12-09 06:26:16 +00:00
|
|
|
|
A package in GNU 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-12-09 06:26:16 +00:00
|
|
|
|
*** From the GNU Guix manual
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
2019-12-09 06:26:16 +00:00
|
|
|
|
The distribution is fully “bootstrapped” and “self-contained”: each
|
2018-04-21 22:45:00 +00:00
|
|
|
|
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-12-09 06:26:16 +00:00
|
|
|
|
**** Guix v1.0 bootstrap binary seed
|
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
|
|
|
|
|
|
2019-12-09 06:26:16 +00:00
|
|
|
|
**** Guix Reduced Binary Seed bootstrap binary seed
|
|
|
|
|
|
|
|
|
|
$ du -schx $(readlink $(guix build bootstrap-tarballs)/*)
|
|
|
|
|
5.7M /gnu/store/9f8gi8raqfx9j3l9d00qrrc0jg3r1kyj-guile-static-stripped-tarball-2.2.6/guile-static-stripped-2.2.6-x86_64-linux.tar.xz
|
|
|
|
|
80K /gnu/store/b6rjl52hibhmvyw4dg8678pwryhla0h2-linux-libre-headers-stripped-tarball-4.19.56/linux-libre-headers-stripped-4.19.56-x86_64-linux.tar.xz
|
|
|
|
|
12K /gnu/store/d7zlxsjcnqilmvqwx7scija9x9bjw8cw-mescc-tools-static-stripped-tarball-0.5.2-0.bb062b0/mescc-tools-static-stripped-0.5.2-0.bb062b0-x86_64-linux.tar.xz
|
|
|
|
|
428K /gnu/store/n7zc4kpi8ny6jlfaikkzxlwhc5fvr1vr-mes-minimal-stripped-tarball-0.19/mes-minimal-stripped-0.19-x86_64-linux.tar.xz
|
|
|
|
|
6.0M /gnu/store/nv4djwlrljfqmynqr2cqvfwz0ydx7kxb-static-binaries-tarball-0/static-binaries-0-x86_64-linux.tar.xz
|
|
|
|
|
13M total
|
|
|
|
|
$ for i in $(readlink $(guix build bootstrap-tarballs)/*);\
|
|
|
|
|
do sudo tar xf $i; done
|
|
|
|
|
Password:
|
|
|
|
|
$ du -schx *
|
|
|
|
|
93M bin
|
|
|
|
|
700K include
|
|
|
|
|
38M lib
|
|
|
|
|
14M share
|
|
|
|
|
145M total
|
|
|
|
|
|
|
|
|
|
**** Guix Scheme-only bootstrap binary seed
|
|
|
|
|
|
|
|
|
|
$ du -schx $(readlink $(~/src/guix/wip-bootstrap/pre-inst-env guix build bootstrap-tarballs)/*)
|
|
|
|
|
5.7M /gnu/store/1mq2pcd2h7g54xpi2jrgj6ibbi4lgi3c-guile-static-stripped-tarball-2.2.6/guile-static-stripped-2.2.6-x86_64-linux.tar.xz
|
|
|
|
|
80K /gnu/store/bl1r2bpk6fam8r2gjvr5mvr48i3dm2hn-linux-libre-headers-stripped-tarball-4.19.56/linux-libre-headers-stripped-4.19.56-x86_64-linux.tar.xz
|
|
|
|
|
12K /gnu/store/w0dlz486dhb8aiq8pxm5akllz628fqin-mescc-tools-static-stripped-tarball-0.5.2-0.bb062b0/mescc-tools-static-stripped-0.5.2-0.bb062b0-x86_64-linux.tar.xz
|
|
|
|
|
428K /gnu/store/15j6l18q44ymlrh1cfp4s4hc9835xic5-mes-minimal-stripped-tarball-0.19/mes-minimal-stripped-0.19-x86_64-linux.tar.xz
|
|
|
|
|
6.2M total
|
|
|
|
|
$ for i in $(readlink $(~/src/guix/wip-bootstrap/pre-inst-env guix build bootstrap-tarballs)/*);\
|
|
|
|
|
do sudo tar xf $i; done
|
|
|
|
|
$ du -schx *
|
|
|
|
|
4.9M bin
|
|
|
|
|
700K include
|
|
|
|
|
38M lib
|
|
|
|
|
14M share
|
|
|
|
|
57M 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)
|
2019-12-09 06:26:16 +00:00
|
|
|
|
*** mes.M2: this Scheme interpreter in bootstrappable M2
|
2018-04-21 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
** TinyCC
|
|
|
|
|
|
|
|
|
|
https://gitlab.com/janneke/tinycc
|
2017-08-26 11:29:07 +00:00
|
|
|
|
|
|
|
|
|
* TODO
|
2019-12-09 06:26:16 +00:00
|
|
|
|
** merge scheme-only bootstrap into Guix.
|
|
|
|
|
** reduced binary seed bootstrap into NixOS, Debian.
|
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-12-09 06:26:16 +00:00
|
|
|
|
** reduced binary seed bootstrap into Guix.
|
2019-11-04 18:59:13 +00:00
|
|
|
|
** 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
|
2019-12-09 06:26:16 +00:00
|
|
|
|
** bug-mes@gnu.org
|
2017-08-26 11:29:07 +00:00
|
|
|
|
** #bootstrappable, #guix on freenode
|
|
|
|
|
** bootstrappable.org
|