Suivant: , Monter: Bootstrapping   [Table des matières][Index]


20.1 The Full-Source Bootstrap

Guix — comme les autres distributions GNU/Linux — est traditionnellement bootstrappé à partir d’un ensemble de binaires de boostrap : Bourne shell, des outils en ligne de commande fournis par GNU Coreutils, Awk, Findutils, « sed » et « grep » et Guile, GCC, Binutils et la bibliothèque C de NU (voir Bootstrapping). Habituellement, ces binaires de bootstrap sont « pris pour acquis ».

Prendre les binaires de bootstrap pour acquis signifie que nous les considérons comme des « sources » corrects et de confiance pour la construction d’un système complet. Là se trouve le problème : la taille de ces binaires de bootstrap est d’environ 250 Mo (voir Bootstrappable Builds dans GNU Mes). Auditer ou même inspecter ces binaires est presque impossible.

For i686-linux and x86_64-linux, Guix now features a full-source bootstrap. This bootstrap is rooted in hex0-seed from the Stage0 package. The hex0 program is minimalist assembler: it reads space-separated hexadecimal digits (nibbles) from a file, possibly including comments, and emits on standard output the bytes corresponding to those hexadecimal numbers. The source code of this initial hex0 program is a file called hex0_x86.hex0 and is written in the hex0 language.

Hex0 is self-hosting, which means that it can build itself:

./hex0-seed hex0_x86.hex0 hex0

Hex0 it is the ASCII-equivalent of the binary program and can be produced by doing something much like:

sed 's/[;#].*$//g' hex0_x86.hex0 | xxd -r -p > hex0
chmod +x hex0

It is because of this ASCII-binary equivalence that we can bless this initial 357-byte binary as source, and hence ‘full-source bootstrap”.

The bootstrap then continues: hex0 builds hex1 and then on to M0, hex2, M1, mescc-tools and finally M2-Planet. Then, using mescc-tools, M2-Planet we build Mes (voir GNU Mes Reference Manual dans GNU Mes, a Scheme interpreter and C compiler in Scheme). From here on starts the more traditional C-based bootstrap of the GNU System.

Another step that Guix has taken is to replace the shell and all its utilities with implementations in Guile Scheme, the Scheme-only bootstrap. Gash (voir Gash dans The Gash manual) is a POSIX-compatible shell that replaces Bash, and it comes with Gash Utils which has minimalist replacements for Awk, the GNU Core Utilities, Grep, Gzip, Sed, and Tar.

Construire le Système GNU à partir des sources est actuellement seulement possible en ajoutant certains paquets GNU historiques en tant qu’étapes intermédiaires43. Tandis que Gash et Gash Utils avancent, et que les paquets GNU deviennent de nouveau plus bootstrappables (p. ex. les nouvelles versions de GNU Sed proposeront de nouveau des archives gzip, en alternative à la compression xz difficile à boostrapper), on espère pouvoir réduire de nouveau cet ensemble de paquets supplémentaires.

Le graphe ci-dessous montre le graphe de dépendance résultant pour gcc-core-mesboot, le compilateur de bootstrap utilisé pour le bootstrap traditionnel du reste du système Guix.

Graphe de dépendance de
gcc-core-mesboot0

Work is ongoing to bring these bootstraps to the arm-linux and aarch64-linux architectures and to the Hurd.

Si vous êtes intéressé·e, rejoignez-nous sur ‘#bootstrappable’ sur le réseau IRC Libera.Chat ou discutez-en sur bug-mes@gnu.org ou gash-devel@nongnu.org.


Notes de bas de page

(43)

Les paquets comme gcc-2.95.3, binutils-2.14, glicb-2.2.5, gzip-1.2.4, tar-1.22 et certains autres. Pour les détails, voir gnu/packages/commencement.scm.


Suivant: Se préparer à utiliser les binaires de bootstrap, Monter: Bootstrapping   [Table des matières][Index]