[PATCH core-updates 0/8] The Full Source Bootstrap

  • Done
  • quality assurance status badge
Details
4 participants
  • Thiago Jung Bauermann
  • Jan (janneke) Nieuwenhuizen
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Jan (janneke) Nieuwenhuizen
Severity
important
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:21
(address . guix-patches@gnu.org)
20220502182105.32068-1-janneke@gnu.org
About a year ago we cheered something like: WE DID IT!!!

Today I am very excited to finally have released GNU Mes 0.24 which supports
the Full Source Bootstrap. So we did what? As Carl Dong once so eloquently
put it

The holy grail of bootstrappability will be connecting mes to hex0

which is exactly what this patch series brings.

Starting from an 357-byte hex0 provided by the new bootstrap-seeds package,
the new stage0-posix package builds hex0, kaem, hex1, catm, hex2, M0, cc_x86,
M1, M2, get_machine, (mescc-tools), and M2-Planet. The 0.24 release of Mes
can now be built using this M2-Planet.

This means that the bootstrap binaries that were added as part of the Reduced
Binary Seed Bootstrap (see
%bootstrap-mescc-tools, %bootstrap-mes, are now removed again.

Greetings,
Janneke


Jan (janneke) Nieuwenhuizen (8):
commencement: Add bootstrap-seeds.
commencement: Add stage0-posix.
commencement: mes-boot: Update to 0.24, build with M2-Planet.
commencement: tcc-boot0: Use NYACC-1.00.2.
commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
commencement: Remove %bootstrap-mes-rewired.
doc: Add the "Full Source Bootstrap".

doc/guix.texi | 77 +++---
doc/images/gcc-core-mesboot0-graph.dot | 187 ++++++-------
gnu/packages/bootstrap.scm | 4 +-
gnu/packages/commencement.scm | 355 ++++++++++++++-----------
4 files changed, 315 insertions(+), 308 deletions(-)

--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 1/8] commencement: Add bootstrap-seeds.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-1-janneke@gnu.org
* gnu/packages/commencement.scm (bootstrap-seeds): New variable.
---
gnu/packages/commencement.scm | 42 ++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)

Toggle diff (62 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 9d6ed5fd08..663ffacd56 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018, 2019, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018, 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
@@ -266,6 +266,46 @@ (define (%boot-gash-inputs)
("bootar" ,bootar)
("guile" ,%bootstrap-guile)))
+(define bootstrap-seeds
+ (package
+ (name "bootstrap-seeds")
+ (version "1.0.0")
+ (source
+ (bootstrap-origin
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://lilypond.org/janneke/guix/20220501/"
+ "bootstrap-seeds-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0scz2bx8fd8c821h6y1j3x6ywgxxns7iinyn9z32dnkiacfdcpfn")))))
+ (native-inputs `(("bootar" ,bootar)))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:guile ,%bootstrap-guile
+ #:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let ((source (assoc-ref %build-inputs "source"))
+ (tar (assoc-ref %build-inputs "bootar"))
+ (out (assoc-ref %outputs "out")))
+ (setenv "PATH" (string-append tar "/bin:"))
+ (invoke "tar" "xvf" source)
+ (mkdir-p out)
+ (copy-recursively "bootstrap-seeds" out)
+ #t))))
+ (home-page "https://github.com/oriansj/bootstrap-seeds")
+ (synopsis "The initial bootstrap seeds: 357-byte hex0 and kaem shell")
+ (description
+ "A prebuilt version of the initial bootstrap seeds. It contains a
+hex0-seed and an optional kaem-minimal shell. The size of the hex0 seeds are
+for knight: 250 bytes, x86-linux:(357 bytes, x86_64-linux: 431 bytes, and
+aarch64-linux 526 bytes. These can be used to build stage0: hex0, hex1, hex2,
+M1, and M2-Planet.")
+ (license license:gpl3+)))
+
(define %bootstrap-mes-rewired
(package
(inherit mes)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 2/8] commencement: Add stage0-posix.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-2-janneke@gnu.org
Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
get_machine, (mescc-tools), and M2-Planet.

* gnu/packages/commencement.scm (stage0-posix): New variable.
---
gnu/packages/commencement.scm | 109 ++++++++++++++++++++++++++++++++++
1 file changed, 109 insertions(+)

Toggle diff (122 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 663ffacd56..24e1e6ec8c 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -306,6 +306,115 @@ (define bootstrap-seeds
M1, and M2-Planet.")
(license license:gpl3+)))
+(define stage0-posix
+ ;; The initial bootstrap package: no binary inputs except those from
+ ;; `bootstrap-seeds, for x86 a 357 byte binary seed: `x86/hex0-seed'.
+ (let ((mescc-tools-version "1.4.0")
+ (m2-planet-version "1.9.0"))
+ (package
+ (name "stage0-posix")
+ (version "1.4")
+ (source (bootstrap-origin
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://lilypond.org/janneke/guix/20220502/"
+ "stage0-posix-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1ammifkj33205qrpfm84yb1c99lwgbn4jsl1hd08aab8c9ffz6p4")))))
+ (native-inputs
+ `(("bootstrap-seeds" ,bootstrap-seeds)
+ ("mescc-tools"
+ ,(bootstrap-origin
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://lilypond.org/janneke/guix/20220502/"
+ "mescc-tools-" mescc-tools-version ".tar.gz"))
+ (sha256
+ (base32
+ "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg")))))
+ ("m2-planet"
+ ,(bootstrap-origin
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://lilypond.org/janneke/guix/20220502/"
+ "M2-Planet-" m2-planet-version ".tar.gz"))
+ (sha256
+ (base32
+ "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g")))))
+ ,@(%boot-gash-inputs)))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:guile ,%bootstrap-guile
+ #:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds"))
+ (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
+ (m2-planet (assoc-ref %build-inputs "m2-planet"))
+ (source (assoc-ref %build-inputs "source"))
+ (tar (assoc-ref %build-inputs "bootar"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (coreutils (assoc-ref %build-inputs "coreutils"))
+ (guile (assoc-ref %build-inputs "guile"))
+ (out (assoc-ref %outputs "out"))
+ (bindir (string-append out "/bin"))
+ (target (or ,(%current-target-system)
+ ,(%current-system)))
+ (stage0-cpu
+ (cond
+ ((or (string-prefix? "x86_64-linux" target)
+ (string-prefix? "i686-linux" target))
+ "x86")
+ ((or (string-prefix? "aarch64-linux" target)
+ (string-prefix? "armhf-linux" target))
+ "armv7l")
+ (else
+ (error "stage0-posix: system not supported" target))))
+ (kaem (string-append "../bootstrap-seeds/POSIX/"
+ stage0-cpu "/kaem-optional-seed")))
+ (setenv "PATH" (string-append tar "/bin:"
+ coreutils "/bin:"
+ bash "/bin"))
+ (invoke "tar" "xvf" source)
+ (chdir (string-append "stage0-posix-" ,version))
+ (copy-recursively bootstrap-seeds "bootstrap-seeds")
+ (invoke "tar" "xvf" mescc-tools)
+ (rmdir "mescc-tools")
+ (symlink (string-append "mescc-tools-" ,mescc-tools-version)
+ "mescc-tools")
+ (invoke "tar" "xvf" m2-planet)
+ (rmdir "M2-Planet")
+ (symlink (string-append "M2-Planet-" ,m2-planet-version)
+ "M2-Planet")
+ (rmdir "M2libc")
+ (symlink "M2-Planet/M2libc" "M2libc")
+ (mkdir-p bindir)
+ (with-directory-excursion stage0-cpu
+ (with-output-to-file "mes-m2.kaem"
+ (lambda _ (display "")))
+ (with-output-to-file "mescc-tools-extra.kaem"
+ (lambda _ (display "")))
+ (invoke kaem "kaem.run"))
+ (with-directory-excursion "bin"
+ (install-file "hex2" bindir)
+ (install-file "M1" bindir)
+ (install-file "blood-elf" bindir)
+ (install-file "kaem" bindir)
+ (install-file "get_machine" bindir)
+ (install-file "M2-Planet" bindir))))))
+ (home-page "https://github.com/oriansj/stage0-posix/")
+ (synopsis "The initial bootstrap package, builds stage0 up to M2-Planet")
+ (description
+ "Starting from an 357-byte hex0 provided by the bootstrap-seeds,
+stage0-posix builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1,
+M2, get_machine, (mescc-tools), and M2-Planet.")
+ (license license:gpl3+))))
+
(define %bootstrap-mes-rewired
(package
(inherit mes)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-3-janneke@gnu.org
* gnu/packages/commencement.scm (mes-boot)[source]: Update to
0.24.
[native-inputs]: Add stage0-posix, remove %bootstrap-mescc-tools and
%bootstrap-mes-rewired, and update nyacc to 1.00.2.
---
gnu/packages/commencement.scm | 61 +++++++++++++++++------------------
1 file changed, 30 insertions(+), 31 deletions(-)

Toggle diff (109 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 24e1e6ec8c..468a846e76 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -527,27 +527,28 @@ (define mes-boot
(package
(inherit mes)
(name "mes-boot")
- (version "0.22")
- (source (origin
- (method url-fetch)
- (uri (string-append "mirror://gnu/mes/"
- "mes-" version ".tar.gz"))
- (sha256
- (base32
- "0p1jsrrmcbc0zrvbvnjbb6iyxr0in71km293q8qj6gnar6bw09av"))))
+ (version "0.24")
+ (source (bootstrap-origin
+ (origin
+ (method url-fetch)
+ (uri (string-append "mirror://gnu/mes/"
+ "mes-" version ".tar.gz"))
+ (sha256
+ (base32
+ "00lrpm4x5qg0l840zhbf9mr67mqhp8gljcl24j5dy0y109gf32w2")))))
(inputs '())
(propagated-inputs '())
(native-inputs
- `(("nyacc-source" ,(origin (inherit (package-source nyacc-0.99))
- (snippet #f)))
- ("mes" ,%bootstrap-mes-rewired)
- ("mescc-tools" ,%bootstrap-mescc-tools)
+ `(("m2-planet" ,stage0-posix)
+ ("nyacc-source" ,(bootstrap-origin
+ (origin (inherit (package-source nyacc-1.00.2))
+ (snippet #f))))
,@(%boot-gash-inputs)))
(arguments
`(#:implicit-inputs? #f
#:tests? #f
#:guile ,%bootstrap-guile
- #:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries
+ #:strip-binaries? #f ;no strip yet
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'unpack-seeds
@@ -556,44 +557,42 @@ (define mes-boot
(with-directory-excursion ".."
(invoke "tar" "-xvf" nyacc-source)))))
(replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref %outputs "out"))
- (gash (assoc-ref %build-inputs "bash"))
- (mes (assoc-ref %build-inputs "mes"))
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gash (assoc-ref inputs "bash"))
+ (mes (assoc-ref inputs "mes"))
(dir (with-directory-excursion ".." (getcwd))))
- (setenv "AR" (string-append "gash " (getcwd) "/scripts/mesar"))
- (setenv "BASH" (string-append gash "/bin/bash"))
- (setenv "CC" (string-append mes "/bin/mescc"))
- (setenv "GUILE_LOAD_PATH"
- (string-append
- mes "/share/mes/module"
- ":" dir "/nyacc-0.99.0/module"))
+ (setenv "GUILE_LOAD_PATH" (string-append
+ dir "/nyacc-1.00.2/module"))
(invoke "gash" "configure.sh"
(string-append "--prefix=" out)
- (string-append "--host=i686-linux-gnu")))))
+ "--host=i686-linux-gnu"))))
(replace 'build
(lambda _
- (invoke "sh" "bootstrap.sh")))
+ (invoke "gash" "bootstrap.sh")))
(delete 'check)
(replace 'install
- (lambda _
+ (lambda* (#:key outputs #:allow-other-keys)
(substitute* "install.sh" ; show some progress
((" -xf") " -xvf")
(("^( *)((cp|mkdir|tar) [^']*[^\\])\n" all space cmd)
(string-append space "echo '" cmd "'\n"
space cmd "\n")))
- (invoke "sh" "install.sh")
+ (invoke "gash" "install.sh")
;; Keep ASCII output, for friendlier comparison and bisection
- (let* ((out (assoc-ref %outputs "out"))
+ (let* ((out (assoc-ref outputs "out"))
(cache (string-append out "/lib/cache")))
(define (objects-in-dir dir)
(find-files dir
(lambda (name stat)
(and (equal? (dirname name) dir)
- (or (string-suffix? ".o" name)
+ (or (string-suffix? ".M1" name)
+ (string-suffix? ".hex2" name)
+ (string-suffix? ".o" name)
(string-suffix? ".s" name))))))
(for-each (lambda (x) (install-file x cache))
- (append (objects-in-dir ".")
+ (append (objects-in-dir "m2")
+ (objects-in-dir ".")
(objects-in-dir "mescc-lib")))))))))
(native-search-paths
(list (search-path-specification
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-4-janneke@gnu.org
* gnu/packages/commencement.scm (tcc-boot0): Call 'bootstrap-origin' on source
and on the source of NYACC-0.99. Use https source URL. Update NYACC to
1.00.2.
---
gnu/packages/commencement.scm | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

Toggle diff (50 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 468a846e76..7f1ba7aa6a 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018, 2019, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018, 2019, 2020, 2021, 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
@@ -618,22 +618,24 @@ (define tcc-boot0
(inherit tcc)
(name "tcc-boot0")
(version "0.9.26-1103-g6e62e0e")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://lilypond.org/janneke/mes/20191117/"
- "/tcc-" version ".tar.gz"))
- (sha256
- (base32
- "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng"))))
+ (source (bootstrap-origin
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://lilypond.org/janneke/mes/20191117/"
+ "/tcc-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng")))))
(build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(inputs '())
(propagated-inputs '())
(native-inputs
`(("mes" ,mes-boot)
- ("nyacc-source" ,(origin (inherit (package-source nyacc-0.99))
- (snippet #f)))
+ ("nyacc-source" ,(bootstrap-origin
+ (origin (inherit (package-source nyacc-1.00.2))
+ (snippet #f))))
("mescc-tools" ,%bootstrap-mescc-tools)
,@(%boot-gash-inputs)))
(arguments
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-6-janneke@gnu.org
* gnu/packages/bootstrap.scm (%bootstrap-inputs): Remove
%bootstrap-mescc-tools, %bootstrap-mes.
---
gnu/packages/bootstrap.scm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 8bd0c4eaf3..03242f0e7b 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -1035,9 +1035,7 @@ (define (%bootstrap-inputs)
;; own packages.
(match (%current-system)
((or "i686-linux" "x86_64-linux")
- `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)
- ("bootstrap-mescc-tools" ,%bootstrap-mescc-tools)
- ("mes" ,%bootstrap-mes)))
+ `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)))
(_
`(("libc" ,%bootstrap-glibc)
("gcc" ,%bootstrap-gcc)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-5-janneke@gnu.org
* gnu/packages/commencement.scm (tcc-boot0)[source]: Update to
0.9.26-1136-g0fbeb2dd.
[native-inputs]: Add stage0-posix and mes-boot, remove
%bootstrap-mescc-tools and %bootstrap-mes-rewired.
---
gnu/packages/commencement.scm | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)

Toggle diff (92 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 7f1ba7aa6a..8b8b243754 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -608,7 +608,7 @@ (define (objects-in-dir dir)
(define tcc-boot0
- ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 11
+ ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 30
;; patches. In a very early and rough form they were presented to the
;; TinyCC developers, who at the time showed no interest in supporting the
;; bootstrappable effort; we will try again later. These patches have been
@@ -617,26 +617,26 @@ (define tcc-boot0
(package
(inherit tcc)
(name "tcc-boot0")
- (version "0.9.26-1103-g6e62e0e")
+ (version "0.9.26-1136-g5bba73cc")
(source (bootstrap-origin
(origin
(method url-fetch)
(uri (string-append
- "https://lilypond.org/janneke/mes/20191117/"
+ "https://lilypond.org/janneke/tcc/"
"/tcc-" version ".tar.gz"))
(sha256
(base32
- "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng")))))
+ "1y2f04qwdqg7dgxiscbf0ibybx2gclniwbbcsxpayazzii2cvji3")))))
(build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(inputs '())
(propagated-inputs '())
(native-inputs
`(("mes" ,mes-boot)
+ ("mescc-tools" ,stage0-posix)
("nyacc-source" ,(bootstrap-origin
(origin (inherit (package-source nyacc-1.00.2))
(snippet #f))))
- ("mescc-tools" ,%bootstrap-mescc-tools)
,@(%boot-gash-inputs)))
(arguments
`(#:implicit-inputs? #f
@@ -651,18 +651,17 @@ (define tcc-boot0
(with-directory-excursion ".."
(invoke "tar" "-xvf" nyacc-source)))))
(replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref %outputs "out"))
(dir (with-directory-excursion ".." (getcwd)))
- (interpreter "/lib/mes-loader"))
-
- (setenv "prefix" out)
- (setenv "GUILE_LOAD_PATH"
- (string-append dir "/nyacc-0.99.0/module"))
-
+ (interpreter "/lib/mes-loader")
+ (mes (assoc-ref inputs "mes"))
+ (mescc (string-append mes "/bin/mescc")))
(substitute* "conftest.c"
(("volatile") ""))
-
+ (setenv "prefix" out)
+ (setenv "GUILE_LOAD_PATH"
+ (string-append dir "/nyacc-1.00.2/module"))
(invoke "sh" "configure"
"--cc=mescc"
(string-append "--prefix=" out)
@@ -672,7 +671,7 @@ (define tcc-boot0
(replace 'build
(lambda _
(substitute* "bootstrap.sh" ; Show some progress
- (("^( *)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{PROGRAM_PREFIX[}]tcc) [^\"]*[^\\])\n" all space cmd)
+ (("^( *)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{program_prefix[}]tcc) [^\"]*[^\\])\n" all space cmd)
(string-append space "echo \"" cmd "\"\n"
space cmd "\n")))
(invoke "sh" "bootstrap.sh")))
@@ -892,8 +891,8 @@ (define tcc-boot
(string-append out "/include"))
(copy-recursively (string-append tcc "/lib")
(string-append out "/lib"))
- (invoke "tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o" "libtcc1.o" "lib/libtcc1.c")
- (invoke "tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o")
+ (invoke "./tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o" "libtcc1.o" "lib/libtcc1.c")
+ (invoke "./tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o")
(copy-file "libtcc1.a" (string-append out "/lib/libtcc1.a"))
(delete-file (string-append out "/lib/tcc/libtcc1.a"))
(copy-file "libtcc1.a"
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap".
(address . 55227@debbugs.gnu.org)
20220502182434.32130-8-janneke@gnu.org
* doc/guix.texi (Reduced Binary Seed Bootstrap): Update and rename to...
(Full Source Bootstrap): ...this.
* doc/images/gcc-core-mesboot0-graph.dot: Regenerate.
---
doc/guix.texi | 77 +++++-----
doc/images/gcc-core-mesboot0-graph.dot | 187 ++++++++++---------------
2 files changed, 116 insertions(+), 148 deletions(-)

Toggle diff (322 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 7bd80a1592..3c08d6be1a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36,7 +36,7 @@ Copyright @copyright{} 2016, 2017, 2018, 2021 Chris Marusich@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner@*
Copyright @copyright{} 2016 John Darrington@*
Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
-Copyright @copyright{} 2016, 2017, 2018, 2019, 2020 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018, 2019, 2021 Jan Nieuwenhuizen@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller@*
Copyright @copyright{} 2016 Alex ter Weele@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines@*
@@ -394,7 +394,7 @@ Installing Debugging Files
Bootstrapping
-* Reduced Binary Seed Bootstrap:: A Bootstrap worthy of GNU.
+* Full Source Bootstrap:: A Bootstrap worthy of GNU.
* Preparing to Use the Bootstrap Binaries:: Building that what matters most.
@end detailmenu
@@ -39491,12 +39491,12 @@ re-create them if needed (@pxref{Preparing to Use the Bootstrap
Binaries}).
@menu
-* Reduced Binary Seed Bootstrap:: A Bootstrap worthy of GNU.
+* Full Source Bootstrap:: A Bootstrap worthy of GNU.
* Preparing to Use the Bootstrap Binaries:: Building that what matters most.
@end menu
-@node Reduced Binary Seed Bootstrap
-@section The Reduced Binary Seed Bootstrap
+@node Full Source Bootstrap
+@section The Full Source Bootstrap
Guix---like other GNU/Linux distributions---is traditionally bootstrapped from
a set of bootstrap binaries: Bourne shell, command-line tools provided by GNU
@@ -39511,28 +39511,43 @@ about 250MB (@pxref{Bootstrappable Builds,,, mes, GNU Mes}). Auditing
or even inspecting these is next to impossible.
For @code{i686-linux} and @code{x86_64-linux}, Guix now features a
-``Reduced Binary Seed'' bootstrap @footnote{We would like to say: ``Full
-Source Bootstrap'' and while we are working towards that goal it would
-be hyperbole to use that term for what we do now.}.
-
-The Reduced Binary Seed bootstrap removes the most critical tools---from a
-trust perspective---from the bootstrap binaries: GCC, Binutils and the GNU C
-Library are replaced by: @code{bootstrap-mescc-tools} (a tiny assembler and
-linker) and @code{bootstrap-mes} (a small Scheme Interpreter and a C compiler
-written in Scheme and the Mes C Library, built for TinyCC and for GCC).
-
-Using these new binary seeds the ``missing'' Binutils, GCC, and the GNU
-C Library are built from source. From here on the more traditional
-bootstrap process resumes. This approach has reduced the bootstrap
-binaries in size to about 145MB in Guix v1.1.
-
-The next step that Guix has taken is to replace the shell and all its
+``Full Source'' bootstrap. This bootstrap is rooted in @file{hex0-seed}
+from the @url{https://savannah.gnu.org/projects/stage0, Stage0} package.
+The source code of this initial hex0 program is a file called
+@c XXX TODO: udpate to savannah url, once accepted there
+@url{https://github.com/oriansj/bootstrap-seeds/blob/master/POSIX/x86/hex0_x86.hex0,@file{hex0_x86.hex0}}
+and is written in the @code{hex0} language.
+
+Hex0 is self hosting, which means that it can build itself:
+
+@example
+./hex0-seed hex0_x86.hex0 hex0
+@end example
+
+Hex0 it is the ASCII-equivalent of the binary program and can be
+produced by doing something much like:
+
+@example
+sed 's/[;#].*$//g' hex0_x86.hex0 | xxd -r -p > hex0
+chmod +x hex0
+@end example
+
+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: @code{hex0} builds @code{hex1} and then on
+to @code{M0}, @code{hex2}, @code{M1}, @code{mescc-tools} and finally
+@code{M2-Planet}. Then, using @code{mescc-tools}, @code{M2-Planet} we
+build Mes (@pxref{Top, GNU Mes Reference Manual,, mes, GNU Mes}, a
+Scheme interpreter and C compiler in Scheme). Frome here on starts
+the more traditional @code{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 @emph{Scheme-only
bootstrap}. Gash (@pxref{Gash,,, gash, 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. The rest of the bootstrap binary seeds that were
-removed are now built from source.
+Gzip, Sed, and Tar.
Building the GNU System from source is currently only possible by adding
some historical GNU packages as intermediate steps@footnote{Packages
@@ -39548,22 +39563,10 @@ The graph below shows the resulting dependency graph for
@code{gcc-core-mesboot0}, the bootstrap compiler used for the
traditional bootstrap of the rest of the Guix System.
-@c ./pre-inst-env guix graph -e '(@@ (gnu packages commencement) gcc-core-mesboot0)' | sed -re 's,((bootstrap-mescc-tools|bootstrap-mes|guile-bootstrap).*shape =) box,\1 ellipse,' > doc/images/gcc-core-mesboot0-graph.dot
+@c ./pre-inst-env guix graph -e '(@@ (gnu packages commencement) gcc-core-mesboot0)' | sed -re 's,((bootstrap-seeds|guile-bootstrap).*shape =) box,\1 ellipse,' > doc/images/gcc-core-mesboot0-graph.dot
@image{images/gcc-core-mesboot0-graph,6in,,Dependency graph of gcc-core-mesboot0}
-The only significant binary bootstrap seeds that remain@footnote{
-Ignoring the 68KB @code{mescc-tools}; that will be removed later,
-together with @code{mes}.} are a Scheme interpreter and a Scheme
-compiler: GNU Mes and GNU Guile@footnote{Not shown in this graph are the
-static binaries for @file{bash}, @code{tar}, and @code{xz} that are used
-to get Guile running.}.
-
-This further reduction has brought down the size of the binary seed to
-about 60MB for @code{i686-linux} and @code{x86_64-linux}.
-
-Work is ongoing to remove all binary blobs from our free software
-bootstrap stack, working towards a Full Source Bootstrap. Also ongoing
-is work to bring these bootstraps to the @code{arm-linux} and
+Work is ongoing to to bring these bootstraps to the @code{arm-linux} and
@code{aarch64-linux} architectures and to the Hurd.
If you are interested, join us on @samp{#bootstrappable} on the Freenode
diff --git a/doc/images/gcc-core-mesboot0-graph.dot b/doc/images/gcc-core-mesboot0-graph.dot
index 191582ed4c..ef4e3a441e 100644
--- a/doc/images/gcc-core-mesboot0-graph.dot
+++ b/doc/images/gcc-core-mesboot0-graph.dot
@@ -1,114 +1,79 @@
digraph "Guix package" {
- "139781154519456" [label = "gcc-core-mesboot0@2.95.3", shape = box, fontname = Helvetica];
- "139781154519456" -> "139781154519632" [color = darkgoldenrod];
- "139781154519456" -> "139781154520688" [color = darkgoldenrod];
- "139781154519456" -> "139781034971312" [color = darkgoldenrod];
- "139781154519456" -> "139781154520160" [color = darkgoldenrod];
- "139781154519456" -> "139781034971664" [color = darkgoldenrod];
- "139781154519456" -> "139781154519984" [color = darkgoldenrod];
- "139781154519456" -> "139781154519808" [color = darkgoldenrod];
- "139781154519456" -> "139781154520512" [color = darkgoldenrod];
- "139781154519456" -> "139781034971488" [color = darkgoldenrod];
- "139781154519456" -> "139781034972896" [color = darkgoldenrod];
- "139781154519456" -> "139781034972368" [color = darkgoldenrod];
- "139781154519456" -> "139781034973072" [color = darkgoldenrod];
- "139781154519456" -> "139781131267872" [color = darkgoldenrod];
- "139781154519632" [label = "binutils-mesboot0@2.14", shape = box, fontname = Helvetica];
- "139781154519632" -> "139781154520688" [color = peachpuff4];
- "139781154519632" -> "139781034971312" [color = peachpuff4];
- "139781154519632" -> "139781154520160" [color = peachpuff4];
- "139781154519632" -> "139781034971664" [color = peachpuff4];
- "139781154519632" -> "139781154519984" [color = peachpuff4];
- "139781154519632" -> "139781154519808" [color = peachpuff4];
- "139781154519632" -> "139781154520512" [color = peachpuff4];
- "139781154519632" -> "139781034971488" [color = peachpuff4];
- "139781154519632" -> "139781034972896" [color = peachpuff4];
- "139781154519632" -> "139781034972368" [color = peachpuff4];
- "139781154519632" -> "139781034973072" [color = peachpuff4];
- "139781154519632" -> "139781131267872" [color = peachpuff4];
- "139781154520688" [label = "bash-mesboot0@2.05b", shape = box, fontname = Helvetica];
- "139781154520688" -> "139781034971488" [color = magenta];
- "139781154520688" -> "139781034971840" [color = magenta];
- "139781154520688" -> "139781034972896" [color = magenta];
- "139781154520688" -> "139781034972368" [color = magenta];
- "139781154520688" -> "139781034973072" [color = magenta];
- "139781154520688" -> "139781131267872" [color = magenta];
- "139781034971488" [label = "make-mesboot0@3.80", shape = box, fontname = Helvetica];
- "139781034971488" -> "139781034971840" [color = dimgrey];
- "139781034971488" -> "139781034972896" [color = dimgrey];
- "139781034971488" -> "139781034972368" [color = dimgrey];
- "139781034971488" -> "139781034973072" [color = dimgrey];
- "139781034971488" -> "139781131267872" [color = dimgrey];
- "139781034971840" [label = "tcc-boot0@0.9.26-1103-g6e62e0e", shape = box, fontname = Helvetica];
- "139781034971840" -> "139781034972016" [color = magenta];
- "139781034971840" -> "139781131266816" [color = magenta];
- "139781034971840" -> "139781034972896" [color = magenta];
- "139781034971840" -> "139781034972368" [color = magenta];
- "139781034971840" -> "139781034973072" [color = magenta];
- "139781034971840" -> "139781131267872" [color = magenta];
- "139781034972016" [label = "mes-boot@0.22", shape = box, fontname = Helvetica];
- "139781034972016" -> "139781034972192" [color = cyan3];
- "139781034972016" -> "139781131266816" [color = cyan3];
- "139781034972016" -> "139781034972896" [color = cyan3];
- "139781034972016" -> "139781034972368" [color = cyan3];
- "139781034972016" -> "139781034973072" [color = cyan3];
- "139781034972016" -> "139781131267872" [color = cyan3];
- "139781034972192" [label = "bootstrap-mes-rewired@0.19", shape = ellipse, fontname = Helvetica];
- "139781034972192" -> "139781131266640" [color = darkseagreen];
- "139781034972192" -> "139781034972896" [color = darkseagreen];
- "139781131266640" [label = "bootstrap-mes@0", shape = ellipse, fontname = Helvetica];
- "139781034972896" [label = "gash-boot@0.2.0", shape = box, fontname = Helvetica];
- "139781034972896" -> "139781034973072" [color = darkviolet];
- "139781034972896" -> "139781131267872" [color = darkviolet];
- "139781034973072" [label = "bootar@1", shape = box, fontname = Helvetica];
- "139781034973072" -> "139781131267872" [color = darkviolet];
- "139781131267872" [label = "guile-bootstrap@2.0", shape = ellipse, fontname = Helvetica];
- "139781131266816" [label = "bootstrap-mescc-tools@0.5.2", shape = ellipse, fontname = Helvetica];
- "139781034972368" [label = "gash-utils-boot@0.1.0", shape = box, fontname = Helvetica];
- "139781034972368" -> "139781034973072" [color = darkseagreen];
- "139781034972368" -> "139781034972896" [color = darkseagreen];
- "139781034972368" -> "139781131267872" [color = darkseagreen];
- "139781034971312" [label = "bzip2-mesboot@1.0.8", shape = box, fontname = Helvetica];
- "139781034971312" -> "139781034971488" [color = cyan3];
- "139781034971312" -> "139781034971840" [color = cyan3];
- "139781034971312" -> "139781034972896" [color = cyan3];
- "139781034971312" -> "139781034972368" [color = cyan3];
- "139781034971312" -> "139781034973072" [color = cyan3];
- "139781034971312" -> "139781131267872" [color = cyan3];
- "139781154520160" [label = "diffutils-mesboot@2.7", shape = box, fontname = Helvetica];
- "139781154520160" -> "139781034971488" [color = red];
- "139781154520160" -> "139781034971840" [color = red];
- "139781154520160" -> "139781034972896" [color = red];
- "139781154520160" -> "139781034972368" [color = red];
- "139781154520160" -> "139781034973072" [color = red];
- "139781154520160" -> "139781131267872" [color = red];
- "139781034971664" [label = "gzip-mesboot@1.2.4", shape = box, fontname = Helvetica];
- "139781034971664" -> "139781034971840" [color = red];
- "139781034971664" -> "139781034972896" [color = red];
- "139781034971664" -> "139781034972368" [color = red];
- "139781034971664" -> "139781034973072" [color = red];
- "139781034971664" -> "139781131267872" [color = red];
- "139781154519984" [label = "patch-mesboot@2.5.9", shape = box, fontname = Helvetica];
- "139781154519984" -> "139781034971488" [color = blue];
- "139781154519984" -> "139781034971840" [color = blue];
- "139781154519984" -> "139781034972896" [color = blue];
- "139781154519984" -> "139781034972368" [color = blue];
- "139781154519984" -> "139781034973072" [color = blue];
- "139781154519984" -> "139781131267872" [color = blue];
- "139781154519808" [label = "sed-mesboot0@1.18", shape = box, fontname = Helvetica];
- "139781154519808" -> "139781034971488" [color = red];
- "139781154519808" -> "139781034971840" [color = red];
- "139781154519808" -> "139781034972896" [color = red];
- "139781154519808" -> "139781034972368" [color = red];
- "139781154519808" -> "139781034973072" [color = red];
- "139781154519808" -> "139781131267872" [color = red];
- "139781154520512" [label = "tcc-boot@0.9.27", shape = box, fontname = Helvetica];
- "139781154520512" -> "139781034971312" [color = darkviolet];
- "139781154520512" -> "139781034971488" [color = darkviolet];
- "139781154520512" -> "139781034971840" [color = darkviolet];
- "139781154520512" -> "139781034972896" [color = darkviolet];
- "139781154520512" -> "139781034972368" [color = darkviolet];
- "139781154520512" -> "139781034973072" [color = darkviolet];
- "139781154520512" -> "139781131267872" [color = darkviolet];
+ "139803511371136" [label = "gcc-core-mesboot0@2.95.3", shape = box, fontname = sans];
+ "139803511371136" -> "139803511371312" [color = red];
+ "139803511371136" -> "139803511372016" [color = red];
+ "139803511371136" -> "139803511371488" [color = red];
+ "139803511371136" -> "139803511371664" [color = red];
+ "139803511371136" -> "139803511371840" [color = red];
+ "139803511371136" -> "139803507105792" [color = red];
+ "139803511371136" -> "139803511373600" [color = red];
+ "139803511371136" -> "139803507105968" [color = red];
+ "139803511371136" -> "139803749199472" [color = red];
+ "139803511371312" [label = "binutils-mesboot0@2.20.1a", shape = box, fontname = sans];
+ "139803511371312" -> "139803511372016" [color = dimgrey];
+ "139803511371312" -> "139803511371488" [color = dimgrey];
+ "139803511371312" -> "139803511371664" [color = dimgrey];
+ "139803511371312" -> "139803511371840" [color = dimgrey];
+ "139803511371312" -> "139803507105792" [color = dimgrey];
+ "139803511371312" -> "139803511373600" [color = dimgrey];
+ "139803511371312" -> "139803507105968" [color = dimgrey];
+ "139803511371312" -> "139803749199472" [color = dimgrey];
+ "139803511372016" [label = "gzip-mesboot@1.2.4", shape = box, fontname = sans];
+ "139803511372016" -> "139803511372192" [color = magenta];
+ "139803511372016" -> "139803507105792" [color = magenta];
+ "139803511372016" -> "139803511373600" [color = magenta];
+ "139803511372016" -> "139803507105968" [color = magenta];
+ "139803511372016" -> "139803749199472" [color = magenta];
+ "139803511372192" [label = "tcc-boot0@0.9.26-1136-g5bba73cc", shape = box, fontname = sans];
+ "139803511372192" -> "139803511372368" [color = magenta];
+ "139803511372192" -> "139803511372544" [color = magenta];
+ "139803511372192" -> "139803507105792" [color = magenta];
+ "139803511372192" -> "139803511373600" [color = magenta];
+ "139803511372192" -> "139803507105968" [color = magenta];
+ "139803511372192" -> "139803749199472" [color = magenta];
+ "139803511372368" [label = "mes-boot@0.24", shape = box, fontname = sans];
+ "139803511372368" -> "139803511372544" [color = darkviolet];
+ "139803511372368" -> "139803507105792" [color = darkviolet];
+ "139803511372368" -> "139803511373600" [color = darkviolet];
+ "139803511372368" -> "139803507105968" [color = darkviolet];
+ "139803511372368" -> "139803749199472" [color = darkviolet];
+ "139803511372544" [label = "stage0-posix@1.4", shape = box, fontname = sans];
+ "139803511372544" -> "139803511373072" [color = peachpuff4];
+ "139803511372544" -> "139803507105792" [color = peachpuff4];
+ "139803511372544" -> "139803511373600" [color = peachpuff4];
+ "139803511372544" -> "139803507105968" [color = peachpuff4];
+ "139803511372544" -> "139803749199472" [color = peachpuff4];
+ "139803511373072" [label = "bootstrap-seeds@1.0.0", shape = ellipse, fontname = sans];
+ "139803511373072" -> "139803507105968" [color = cyan3];
+ "139803507105968" [label = "bootar@1b", shape = box, fontname = sans];
+ "139803507105968" -> "139803749199472" [color = dimgrey];
+ "139803749199472" [label = "guile-bootstrap@2.0", shape = ellipse, fontname = sans];
+ "139803507105792" [label = "gash-boot@0.3.0", shape = box, fontname = sans];
+ "139803507105792" -> "139803507105968" [color = darkviolet];
+ "139803507105792" -> "139803749199472" [color = darkviolet];
+ "139803511373600" [label = "gash-utils-boot@0.2.0", shape = box, fontname = sans];
+ "139803511373600" -> "139803507105968" [color = red];
+ "139803511373600" -> "139803507105792" [color = red];
+ "139803511373600" -> "139803749199472" [color = red];
+ "139803511371488" [label = "patch-mesboot@2.5.9", shape = box, fontname = sans];
+ "139803511371488" -> "139803511371840" [color = darkseagreen];
+ "139803511371488" -> "139803511372192" [color = darkseagreen];
+ "139803511371488" -> "139803507105792" [color = darkseagreen];
+ "139803511371488" -> "139803511373600" [color = darkseagreen];
+ "139803511371488" -> "139803507105968" [color = darkseagreen];
+ "139803511371488" -> "139803749199472" [color = darkseagreen];
+ "139803511371840" [label = "make-mesboot0@3.80", shape = box, fontname = sans];
+ "139803511371840" -> "139803511372192" [color = blue];
+ "139803511371840" -> "139803507105792" [color = blue];
+ "139803511371840" -> "139803511373600" [color = blue];
+ "139803511371840" -> "139803507105968" [color = blue];
+ "139803511371840" -> "139803749199472" [color = blue];
+ "139803511371664" [label = "tcc-boot@0.9.27", shape = box, fontname = sans];
+ "139803511371664" -> "139803511371840" [color = peachpuff4];
+ "139803511371664" -> "139803511372192" [color = peachpuff4];
+ "139803511371664" -> "139803507105792" [color = peachpuff4];
+ "139803511371664" -> "139803511373600" [color = peachpuff4];
+ "139803511371664" -> "139803507105968" [color = peachpuff4];
+ "139803511371664" -> "139803749199472" [color = peachpuff4];
}
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 2 May 2022 20:24
[PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired.
(address . 55227@debbugs.gnu.org)
20220502182434.32130-7-janneke@gnu.org
* gnu/packages/commencement.scm (%bootstrap-mes-rewired): Remove.
---
gnu/packages/commencement.scm | 108 ----------------------------------
1 file changed, 108 deletions(-)

Toggle diff (121 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 8b8b243754..ffc8a5dd37 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -415,114 +415,6 @@ (define stage0-posix
M2, get_machine, (mescc-tools), and M2-Planet.")
(license license:gpl3+))))
-(define %bootstrap-mes-rewired
- (package
- (inherit mes)
- (name "bootstrap-mes-rewired")
- (version "0.19")
- (source #f)
- (native-inputs `(("mes" ,%bootstrap-mes)
- ("gash" ,gash-boot)))
- (inputs '())
- (propagated-inputs '())
- (outputs '("out"))
- (build-system trivial-build-system)
- (arguments
- `(#:guile ,%bootstrap-guile
- #:modules ((guix build utils))
-
- #:builder (begin
- (use-modules (guix build utils)
- (srfi srfi-26))
-
- (let* ((mes (assoc-ref %build-inputs "mes"))
- (gash (assoc-ref %build-inputs "gash"))
- (mes-bin (string-append mes "/bin"))
- (guile (string-append mes-bin "/mes"))
- (mes-module (string-append mes "/share/mes/module"))
- (out (assoc-ref %outputs "out"))
- (bin (string-append out "/bin"))
- (mescc (string-append bin "/mescc"))
- (module (string-append out "/share/mes/module")))
- (define (rewire file)
- (substitute* file
- ((mes) out)
- (("/gnu/store[^ ]+mes-minimal-[^/)}\"]*") out)
- (("/gnu/store[^ ]+guile-[^/]*/bin/guile") guile)
- (("/gnu/store[^ ]+bash-[^/)}\"]*") gash)))
-
- (mkdir-p bin)
- (for-each (lambda (file) (install-file file bin))
- (find-files mes-bin))
- (mkdir-p module)
- (copy-recursively (string-append mes-module "/mes")
- (string-append module "/mes"))
- (copy-recursively (string-append mes-module "/srfi")
- (string-append module "/srfi"))
- (for-each rewire
- ;; Cannot easily rewire "mes" because it
- ;; contains NUL characters; would require
- ;; remove-store-references alike trick
- (filter (negate (cut string-suffix? "/mes" <>))
- (find-files bin)))
- (rewire (string-append module "/mes/boot-0.scm"))
-
- (delete-file mescc)
- (with-output-to-file mescc
- (lambda _
- (display (string-append
- "\
-#! " gash "/bin/sh
-LANG=C
-LC_ALL=C
-export LANG LC_ALL
-
-MES_PREFIX=${MES_REWIRED_PREFIX-" out "/share/mes}
-MES=" bin "/mes
-export MES MES_PREFIX
-
-MES_ARENA=${MES_REWIRED_ARENA-10000000}
-MES_MAX_ARENA=${MES_REWIRED_ARENA-10000000}
-MES_STACK=${MES_REWIRED_STACK-1000000}
-export MES_ARENA MES_MAX_ARENA MES_STACK
-
-$MES -e '(mescc)' module/mescc.scm -- \"$@\"
-"))))
- (chmod mescc #o555)
-
- (with-directory-excursion module
- (chmod "mes/base.mes" #o644)
- (copy-file "mes/base.mes" "mes/base.mes.orig")
- (let ((base.mes (open-file "mes/base.mes" "a")))
- (display "
-;; A fixed map, from Mes 0.21, required to bootstrap Mes 0.21
-(define (map f h . t)
- (if (or (null? h)
- (and (pair? t) (null? (car t)))
- (and (pair? t) (pair? (cdr t)) (null? (cadr t)))) '()
- (if (null? t) (cons (f (car h)) (map f (cdr h)))
- (if (null? (cdr t))
- (cons (f (car h) (caar t)) (map f (cdr h) (cdar t)))
- (if (null? (cddr t))
- (cons (f (car h) (caar t) (caadr t)) (map f (cdr h) (cdar t) (cdadr t)))
- (error 'unsupported (cons* 'map-4: f h t))b )))))
-" base.mes)
- (close base.mes))
-
- (chmod "mes/guile.mes" #o644)
- (copy-file "mes/guile.mes" "mes/guile.mes.orig")
- (let ((guile.mes (open-file "mes/guile.mes" "a")))
- (display "
-;; After booting guile.scm; use Mes 0.21; especially: MesCC 0.21
-(let* ((self (car (command-line)))
- (prefix (dirname (dirname self))))
- (set! %moduledir (string-append prefix \"/mes/module/\"))
- (setenv \"%numbered_arch\" \"true\"))
-
-" guile.mes)
- (close guile.mes)))
- #t))))))
-
(define mes-boot
(package
(inherit mes)
--
2.35.1
L
L
Ludovic Courtès wrote on 6 May 2022 16:16
control message for bug #55227
(address . control@debbugs.gnu.org)
871qx64ugd.fsf@gnu.org
severity 55227 important
quit
T
T
Thiago Jung Bauermann wrote on 9 May 2022 05:49
Re: [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix.
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)
87ee13nyho.fsf@kolabnow.com
Hello Jan,

This is great work! This is not an area I have experience in, so I
didn't read it closely, at least as of yet. I have only one minor
comment:

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:

Toggle quote (81 lines)
> Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
> On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
> builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
> get_machine, (mescc-tools), and M2-Planet.
>
> * gnu/packages/commencement.scm (stage0-posix): New variable.
> ---
> gnu/packages/commencement.scm | 109 ++++++++++++++++++++++++++++++++++
> 1 file changed, 109 insertions(+)
>
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 663ffacd56..24e1e6ec8c 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -306,6 +306,115 @@ (define bootstrap-seeds
> M1, and M2-Planet.")
> (license license:gpl3+)))
>
> +(define stage0-posix
> + ;; The initial bootstrap package: no binary inputs except those from
> + ;; `bootstrap-seeds, for x86 a 357 byte binary seed: `x86/hex0-seed'.
> + (let ((mescc-tools-version "1.4.0")
> + (m2-planet-version "1.9.0"))
> + (package
> + (name "stage0-posix")
> + (version "1.4")
> + (source (bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220502/"
> + "stage0-posix-" version ".tar.gz"))
> + (sha256
> + (base32
> + "1ammifkj33205qrpfm84yb1c99lwgbn4jsl1hd08aab8c9ffz6p4")))))
> + (native-inputs
> + `(("bootstrap-seeds" ,bootstrap-seeds)
> + ("mescc-tools"
> + ,(bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220502/"
> + "mescc-tools-" mescc-tools-version ".tar.gz"))
> + (sha256
> + (base32
> + "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg")))))
> + ("m2-planet"
> + ,(bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220502/"
> + "M2-Planet-" m2-planet-version ".tar.gz"))
> + (sha256
> + (base32
> + "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g")))))
> + ,@(%boot-gash-inputs)))
> + (build-system trivial-build-system)
> + (arguments
> + `(#:guile ,%bootstrap-guile
> + #:modules ((guix build utils))
> + #:builder
> + (begin
> + (use-modules (guix build utils))
> + (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds"))
> + (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
> + (m2-planet (assoc-ref %build-inputs "m2-planet"))
> + (source (assoc-ref %build-inputs "source"))
> + (tar (assoc-ref %build-inputs "bootar"))
> + (bash (assoc-ref %build-inputs "bash"))
> + (coreutils (assoc-ref %build-inputs "coreutils"))
> + (guile (assoc-ref %build-inputs "guile"))
> + (out (assoc-ref %outputs "out"))
> + (bindir (string-append out "/bin"))
> + (target (or ,(%current-target-system)
> + ,(%current-system)))
> + (stage0-cpu
> + (cond
> + ((or (string-prefix? "x86_64-linux" target)

IMHO the code is clearer and less error prone if the (guix utils)
convenience functions are used to test the target rather than directly
doing string pattern matching.

In this case, ‘target-x86-64?’ is the one. There's no need to even pass
an argument to it since the default is what you need.

The check for Linux could be done separately in the body of the builder
with ‘target-linux?’. What do you think?

Toggle quote (2 lines)
> + (string-prefix? "i686-linux" target))

Here it would be ‘target-x86-32?’.

Toggle quote (4 lines)
> + "x86")
> + ((or (string-prefix? "aarch64-linux" target)
> + (string-prefix? "armhf-linux" target))

This is a good case in point. There's a bug above: “armhf-linux” matches
32-bit ARM when building natively because that's what's in
%current-target, but when cross-building %current-target-system will
contain “arm-unknown-linux-gnueabihf” and this branch won't be taken.

Using ‘target-arm32?’ avoids the bug.

Toggle quote (4 lines)
> + "armv7l")
> + (else
> + (error "stage0-posix: system not supported" target))))

--
Thanks
Thiago
J
J
Jan Nieuwenhuizen wrote on 9 May 2022 10:14
(name . Thiago Jung Bauermann)(address . bauermann@kolabnow.com)
87y1zbcecx.fsf@gnu.org
Thiago Jung Bauermann writes:

Hello Thiago,

Toggle quote (2 lines)
> This is great work!

Thanks!

Toggle quote (7 lines)
> This is not an area I have experience in, so I didn't read it closely,
> at least as of yet. I have only one minor comment:

>> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
>> index 663ffacd56..24e1e6ec8c 100644
>> --- a/gnu/packages/commencement.scm
>> +++ b/gnu/packages/commencement.scm
[..]
Toggle quote (29 lines)
>> + (stage0-cpu
>> + (cond
>> + ((or (string-prefix? "x86_64-linux" target)
>
> IMHO the code is clearer and less error prone if the (guix utils)
> convenience functions are used to test the target rather than directly
> doing string pattern matching.
>
> In this case, ‘target-x86-64?’ is the one. There's no need to even pass
> an argument to it since the default is what you need.
>
> The check for Linux could be done separately in the body of the builder
> with ‘target-linux?’. What do you think?
>
>> + (string-prefix? "i686-linux" target))
>
> Here it would be ‘target-x86-32?’.
>
>> + "x86")
>> + ((or (string-prefix? "aarch64-linux" target)
>> + (string-prefix? "armhf-linux" target))
>
> This is a good case in point. There's a bug above: “armhf-linux” matches
> 32-bit ARM when building natively because that's what's in
> %current-target, but when cross-building %current-target-system will
> contain “arm-unknown-linux-gnueabihf” and this branch won't be taken.
>
> Using ‘target-arm32?’ avoids the bug.

Nice catch and good suggestion. Find a new version attached.

Greetings
Janneke
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 12 May 2022 12:38
Re: bug#55227: [PATCH core-updates 0/8] The Full Source Bootstrap
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87r14zkpcz.fsf_-_@gnu.org
Hi!

Starting a dive through this amazing patch series…

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (2 lines)
> * gnu/packages/commencement.scm (bootstrap-seeds): New variable.

[...]

Toggle quote (3 lines)
> + (source
> + (bootstrap-origin

You can remove the ‘bootstrap-origin’ call: it’s only useful when there
are patches or snippets.

Toggle quote (6 lines)
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220501/"
> + "bootstrap-seeds-" version ".tar.gz"))

You can add a mirror://gnu/guix/mirror URL and we’ll copy it to
ftp.gnu.org.

Toggle quote (2 lines)
> + (native-inputs `(("bootar" ,bootar)))

-> (list boottar)

Toggle quote (11 lines)
> + (build-system trivial-build-system)
> + (arguments
> + `(#:guile ,%bootstrap-guile
> + #:modules ((guix build utils))
> + #:builder
> + (begin
> + (use-modules (guix build utils))
> + (let ((source (assoc-ref %build-inputs "source"))
> + (tar (assoc-ref %build-inputs "bootar"))
> + (out (assoc-ref %outputs "out")))

You can make it a gexp like so:

(arguments
(list #:guile …
#:builder
#~(begin
(use-modules …)

(let ((source #$(package-source this-package))
(tar #$(this-package-input "boottar"))
(out #$output))
…))))

Toggle quote (6 lines)
> + (setenv "PATH" (string-append tar "/bin:"))
> + (invoke "tar" "xvf" source)
> + (mkdir-p out)
> + (copy-recursively "bootstrap-seeds" out)
> + #t))))

You can remove the trailing #t.

Toggle quote (3 lines)
> + (description
> + "A prebuilt version of the initial bootstrap seeds. It contains a

The first thing could be a sentence, say: “This package provides
pre-built binaries of the bootstrap seeds.”

Toggle quote (2 lines)
> +hex0-seed and an optional kaem-minimal shell. The size of the hex0 seeds are
> +for knight: 250 bytes, x86-linux:(357 bytes, x86_64-linux: 431 bytes, and
^
Extra paren.

Ludo’.
L
L
Ludovic Courtès wrote on 12 May 2022 12:45
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87ilqbkp1l.fsf_-_@gnu.org
Jan Nieuwenhuizen <janneke@gnu.org> skribis:

Toggle quote (12 lines)
>>From f013e88563f73a7513faa330c79eef2f653daf28 Mon Sep 17 00:00:00 2001
> From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
> Date: Thu, 31 Dec 2020 18:25:21 +0100
> Subject: [PATCH core-updates v2 2/8] commencement: Add stage0-posix.
>
> Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
> On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
> builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
> get_machine, (mescc-tools), and M2-Planet.
>
> * gnu/packages/commencement.scm (stage0-posix): New variable.

[...]

Toggle quote (9 lines)
> + (name "stage0-posix")
> + (version "1.4")
> + (source (bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220502/"
> + "stage0-posix-" version ".tar.gz"))

Same comment as earlier regarding ‘bootstrap-origin’ and the URL.

Toggle quote (4 lines)
> + (supported-systems '("i686-linux" "x86_64-linux"
> + "arm-linux" "aarch64-linux"
> + "riscv64-linux"))

Woow. :-)

s/arm-linux/armhf-linux/

Toggle quote (24 lines)
> + (native-inputs
> + `(("bootstrap-seeds" ,bootstrap-seeds)
> + ("mescc-tools"
> + ,(bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220502/"
> + "mescc-tools-" mescc-tools-version ".tar.gz"))
> + (sha256
> + (base32
> + "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg")))))
> + ("m2-planet"
> + ,(bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220502/"
> + "M2-Planet-" m2-planet-version ".tar.gz"))
> + (sha256
> + (base32
> + "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g")))))
> + ,@(%boot-gash-inputs)))

Here you can avoid ‘bootstrap-origin’ too and add mirror://gnu URLs.

The “new style” (with gexps) doesn’t work well with non-package inputs
in the sense that you cannot use ‘this-package-input’ to access them.

However, it might be simpler to not have them in ‘native-inputs’ and to
instead refer to them in the code, as in:

#~(begin
(invoke "tar" "xvf" #$mescc-tools)
…)

where:

(define mescc-tools
(origin …))

Toggle quote (6 lines)
> + (synopsis "The initial bootstrap package, builds stage0 up to M2-Planet")
> + (description
> + "Starting from an 357-byte hex0 provided by the bootstrap-seeds,
> +stage0-posix builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1,
> +M2, get_machine, (mescc-tools), and M2-Planet.")

Bonus points if you can make it a full sentence. :-)

(I feel ridiculous commenting on this on a patch series that’s this
important, but hey!)

Ludo’.
L
L
Ludovic Courtès wrote on 12 May 2022 12:46
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87ee0zkoze.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (5 lines)
> * gnu/packages/commencement.scm (mes-boot)[source]: Update to
> 0.24.
> [native-inputs]: Add stage0-posix, remove %bootstrap-mescc-tools and
> %bootstrap-mes-rewired, and update nyacc to 1.00.2.

[...]

Toggle quote (9 lines)
> + (source (bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append "mirror://gnu/mes/"
> + "mes-" version ".tar.gz"))
> + (sha256
> + (base32
> + "00lrpm4x5qg0l840zhbf9mr67mqhp8gljcl24j5dy0y109gf32w2")))))

No need for ‘bootstrap-origin’.

Otherwise LGTM!
L
L
Ludovic Courtès wrote on 12 May 2022 12:47
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87a6bnkox6.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (4 lines)
> * gnu/packages/commencement.scm (tcc-boot0): Call 'bootstrap-origin' on source
> and on the source of NYACC-0.99. Use https source URL. Update NYACC to
> 1.00.2.

[...]

Toggle quote (10 lines)
> + (source (bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/mes/20191117/"
> + "/tcc-" version ".tar.gz"))
> + (sha256
> + (base32
> + "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng")))))

Same here for ‘bootstrap-origin’ and the URL.

Otherwise LGTM.

Toggle quote (10 lines)
> (native-inputs
> `(("mes" ,mes-boot)
> - ("nyacc-source" ,(origin (inherit (package-source nyacc-0.99))
> - (snippet #f)))
> + ("nyacc-source" ,(bootstrap-origin
> + (origin (inherit (package-source nyacc-1.00.2))
> + (snippet #f))))
> ("mescc-tools" ,%bootstrap-mescc-tools)
> ,@(%boot-gash-inputs)))

In a subsequent patch (not a blocker), we can look at removing input
labels.

Ludo’.
L
L
Ludovic Courtès wrote on 12 May 2022 12:50
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
875ymbkot8.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (5 lines)
> * gnu/packages/commencement.scm (tcc-boot0)[source]: Update to
> 0.9.26-1136-g0fbeb2dd.
> [native-inputs]: Add stage0-posix and mes-boot, remove
> %bootstrap-mescc-tools and %bootstrap-mes-rewired.

[...]

Toggle quote (4 lines)
> (define tcc-boot0
> - ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 11
> + ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 30

Slowly increasing. :-)

Toggle quote (12 lines)
> (source (bootstrap-origin
> (origin
> (method url-fetch)
> (uri (string-append
> - "https://lilypond.org/janneke/mes/20191117/"
> + "https://lilypond.org/janneke/tcc/"
> "/tcc-" version ".tar.gz"))
> (sha256
> (base32
> - "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng")))))
> + "1y2f04qwdqg7dgxiscbf0ibybx2gclniwbbcsxpayazzii2cvji3")))))

Eventually we should have that on ftp.gnu.org too, but I realize we
might be better off addressing it afterwards since we’ll have to agree
on the whole file tree we’re going to upload there.

So… LGTM!
L
L
Ludovic Courtès wrote on 12 May 2022 12:50
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
871qwzkosk.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (3 lines)
> * gnu/packages/bootstrap.scm (%bootstrap-inputs): Remove
> %bootstrap-mescc-tools, %bootstrap-mes.

OK!
L
L
Ludovic Courtès wrote on 12 May 2022 12:50
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87wnerja7g.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (5 lines)
> * gnu/packages/commencement.scm (%bootstrap-mes-rewired): Remove.
> ---
> gnu/packages/commencement.scm | 108 ----------------------------------
> 1 file changed, 108 deletions(-)

Yay!
L
L
Ludovic Courtès wrote on 12 May 2022 13:03
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87o803j9mx.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (4 lines)
> * doc/guix.texi (Reduced Binary Seed Bootstrap): Update and rename to...
> (Full Source Bootstrap): ...this.
> * doc/images/gcc-core-mesboot0-graph.dot: Regenerate.

Nice!


[...]

Toggle quote (3 lines)
> -Copyright @copyright{} 2016, 2017, 2018, 2019, 2020 Jan Nieuwenhuizen@*
> +Copyright @copyright{} 2016, 2017, 2018, 2019, 2021 Jan Nieuwenhuizen@*

2022 even. :-)

Toggle quote (2 lines)
> For @code{i686-linux} and @code{x86_64-linux}, Guix now features a

[...]

Toggle quote (2 lines)
> +``Full Source'' bootstrap. This bootstrap is rooted in @file{hex0-seed}

Maybe: @dfn{full-source bootstrap}.

(I’d tend to avoid capitals, not sure.)

Toggle quote (8 lines)
> +from the @url{https://savannah.gnu.org/projects/stage0,Stage0} package.
> +The source code of this initial hex0 program is a file called
> +@c XXX TODO: udpate to savannah url, once accepted there
> +@url{https://github.com/oriansj/bootstrap-seeds/blob/master/POSIX/x86/hex0_x86.hex0,@file{hex0_x86.hex0}}
> +and is written in the @code{hex0} language.
> +
> +Hex0 is self hosting, which means that it can build itself:

Before “The source code of this initial …”, perhaps add a sentence like:
The hex0 program is minimalist assembler: it reads space-separated
hexadecimal digits from a file, possibly including comments, and emits
on standard output the bytes corresponding to those hexadecimal
numbers.

(Is that a fine description? I think it’d be nice if the stage0 site
and repo could describe things in simple terms like that.)

s/self hosting/self-hosting/

Toggle quote (7 lines)
> -The only significant binary bootstrap seeds that remain@footnote{
> -Ignoring the 68KB @code{mescc-tools}; that will be removed later,
> -together with @code{mes}.} are a Scheme interpreter and a Scheme
> -compiler: GNU Mes and GNU Guile@footnote{Not shown in this graph are the
> -static binaries for @file{bash}, @code{tar}, and @code{xz} that are used
> -to get Guile running.}.

\o/

Otherwise LGTM!

Ludo’.
L
L
Ludovic Courtès wrote on 12 May 2022 13:09
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87bkw3j9cj.fsf@gnu.org
Hello!

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (10 lines)
> About a year ago we cheered something like: WE DID IT!!!
>
> Today I am very excited to finally have released GNU Mes 0.24 which supports
> the Full Source Bootstrap. So we did what? As Carl Dong once so eloquently
> put it
>
> The holy grail of bootstrappability will be connecting mes to hex0
>
> which is exactly what this patch series brings.

Woohoo!! Truly amazing. I just can’t believe it’s become a reality!

Toggle quote (10 lines)
> Starting from an 357-byte hex0 provided by the new bootstrap-seeds package,
> the new stage0-posix package builds hex0, kaem, hex1, catm, hex2, M0, cc_x86,
> M1, M2, get_machine, (mescc-tools), and M2-Planet. The 0.24 release of Mes
> can now be built using this M2-Planet.
>
> This means that the bootstrap binaries that were added as part of the Reduced
> Binary Seed Bootstrap (see
> https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25):
> %bootstrap-mescc-tools, %bootstrap-mes, are now removed again.

Yay! (And we’ll need a new blog post once that’s merged!)

Toggle quote (9 lines)
> commencement: Add bootstrap-seeds.
> commencement: Add stage0-posix.
> commencement: mes-boot: Update to 0.24, build with M2-Planet.
> commencement: tcc-boot0: Use NYACC-1.00.2.
> commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
> bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
> commencement: Remove %bootstrap-mes-rewired.
> doc: Add the "Full Source Bootstrap".

I haven’t checked but if you confirm that ‘guix build coreutils’ or
similar passes (and that the output of ‘guix build coreutils -s
powerpc64le -d’, for example, is unaffected), this can go on
‘core-updates’.

Please add “gnu:” as a prefix to the commit log of patches that modify
gnu/packages/*.

Toggle quote (2 lines)
> 4 files changed, 315 insertions(+), 308 deletions(-)

And on top of that, it comes almost for free in terms of lines of code
on our side. :-)

One last thing: *thank you*. Thank you for bringing it to completion,
for never giving up in the face of a mountain of challenges of all
sorts; thank you for inspiring us!

Ludo’.
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:07
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87bkw16ejy.fsf@gnu.org
Ludovic Courtès writes:

Hello!

Toggle quote (14 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> About a year ago we cheered something like: WE DID IT!!!
>>
>> Today I am very excited to finally have released GNU Mes 0.24 which supports
>> the Full Source Bootstrap. So we did what? As Carl Dong once so eloquently
>> put it
>>
>> The holy grail of bootstrappability will be connecting mes to hex0
>>
>> which is exactly what this patch series brings.
>
> Woohoo!! Truly amazing. I just can’t believe it’s become a reality!

My thoughts exactly, and very nice to hear you say it too!

Toggle quote (12 lines)
>> Starting from an 357-byte hex0 provided by the new bootstrap-seeds package,
>> the new stage0-posix package builds hex0, kaem, hex1, catm, hex2, M0, cc_x86,
>> M1, M2, get_machine, (mescc-tools), and M2-Planet. The 0.24 release of Mes
>> can now be built using this M2-Planet.
>>
>> This means that the bootstrap binaries that were added as part of the Reduced
>> Binary Seed Bootstrap (see
>> https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25):
>> %bootstrap-mescc-tools, %bootstrap-mes, are now removed again.
>
> Yay! (And we’ll need a new blog post once that’s merged!)

Sure!

Toggle quote (3 lines)
> I haven’t checked but if you confirm that ‘guix build coreutils’ or
> similar passes

Re-confirming this now, "already" up to...

building /gnu/store/1kj9y2qkd7nc7jhyfa0ywqkbmbv4a8ki-gcc-mesboot-4.9.4.drv...

Toggle quote (3 lines)
> (and that the output of ‘guix build coreutils -s powerpc64le -d’, for
> example, is unaffected),

Ah that's a nice trick. No changes!

$ ./pre-inst-env guix build coreutils -s powerpc64le-linux -d
/gnu/store/rsg7k7rih8giz2a3gbd281ygzixzg5yn-coreutils-8.32.drv

Toggle quote (2 lines)
> this can go on ‘core-updates’.

OK. I have reset wip-full-source-bootstrap and will send a v3 patch
series. We probably want to think about/change the actual mirror spell
"mirror://gnu/guix/mirror/" (?) to use (see other mails).

Toggle quote (3 lines)
> Please add “gnu:” as a prefix to the commit log of patches that modify
> gnu/packages/*.

Done.

Toggle quote (5 lines)
>> 4 files changed, 315 insertions(+), 308 deletions(-)
>
> And on top of that, it comes almost for free in terms of lines of code
> on our side. :-)

Yeah, what a bonus. The thing is that stage0-posix includes mescc-tools
and m2-planet; we were expecting at least two extra packages...

Toggle quote (4 lines)
> One last thing: *thank you*. Thank you for bringing it to completion,
> for never giving up in the face of a mountain of challenges of all
> sorts; thank you for inspiring us!

Thats really great to hear, it means a lot to me. I'm very grateful for
all your support in this journey and for Guix, that presented me with a
beautiful piece of code to play with and prototype the bootstraps. And
also, many thanks for the opportunity to stepwise introduce these
changes. Time to start thinking about the next big step for
bootstrappable!

Greetings,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:08
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
874k1t6eim.fsf@gnu.org
Ludovic Courtès writes:

Hi!

Toggle quote (2 lines)
> Starting a dive through this amazing patch series…

Yay, and thanks again for your careful review.

Toggle quote (6 lines)
>> + (source
>> + (bootstrap-origin
>
> You can remove the ‘bootstrap-origin’ call: it’s only useful when there
> are patches or snippets.

Ah, right. Removed.

Toggle quote (9 lines)
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "https://lilypond.org/janneke/guix/20220501/"
>> + "bootstrap-seeds-" version ".tar.gz"))
>
> You can add a mirror://gnu/guix/mirror URL and we’ll copy it to
> ftp.gnu.org.

Changed to:

(uri (list
(string-append
"mirror://gnu/guix/mirror/"
"bootstrap-seeds-" version ".tar.gz")
(string-append
"bootstrap-seeds-" version ".tar.gz")))

Toggle quote (4 lines)
>> + (native-inputs `(("bootar" ,bootar)))
>
> -> (list boottar)

Ok.

Toggle quote (18 lines)
>> + (build-system trivial-build-system)
>> + (arguments
>> + `(#:guile ,%bootstrap-guile
>> + #:modules ((guix build utils))
>> + #:builder
>> + (begin
>> + (use-modules (guix build utils))
>> + (let ((source (assoc-ref %build-inputs "source"))
>> + (tar (assoc-ref %build-inputs "bootar"))
>> + (out (assoc-ref %outputs "out")))
>
> You can make it a gexp like so:
>
> (arguments
> (list #:guile …
> #:builder
> #~(begin

Ok.

Toggle quote (4 lines)
>> + #t))))
>
> You can remove the trailing #t.

Ok.

Toggle quote (11 lines)
>> + (description
>> + "A prebuilt version of the initial bootstrap seeds. It contains a
>
> The first thing could be a sentence, say: “This package provides
> pre-built binaries of the bootstrap seeds.”

>> +hex0-seed and an optional kaem-minimal shell. The size of the hex0 seeds are
>> +for knight: 250 bytes, x86-linux:(357 bytes, x86_64-linux: 431 bytes, and
> ^
> Extra paren.

Removed.

Greetings,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:09
(name . Ludovic Courtès)(address . ludo@gnu.org)
87wnep4zxd.fsf@gnu.org
Ludovic Courtès writes:

Hi,

Toggle quote (7 lines)
> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>>>From f013e88563f73a7513faa330c79eef2f653daf28 Mon Sep 17 00:00:00 2001
>> * gnu/packages/commencement.scm (stage0-posix): New variable.

> Same comment as earlier regarding ‘bootstrap-origin’ and the URL.

bootstrap-origin removed and URL changed to:

(uri (list
(string-append
"mirror://gnu/guix/mirror/"
"stage0-posix-" version ".tar.gz")
(string-append
"stage0-posix-" version ".tar.gz")))
Toggle quote (7 lines)
>
>> + (supported-systems '("i686-linux" "x86_64-linux"
>> + "arm-linux" "aarch64-linux"
>> + "riscv64-linux"))
>
> Woow. :-)

:-) Yeah, that will mean some work for us to come...

Toggle quote (2 lines)
> s/arm-linux/armhf-linux/

Oops.

Toggle quote (26 lines)
>> + (native-inputs
>> + `(("bootstrap-seeds" ,bootstrap-seeds)
>> + ("mescc-tools"
>> + ,(bootstrap-origin
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "https://lilypond.org/janneke/guix/20220502/"
>> + "mescc-tools-" mescc-tools-version ".tar.gz"))
>> + (sha256
>> + (base32
>> + "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg")))))
>> + ("m2-planet"
>> + ,(bootstrap-origin
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "https://lilypond.org/janneke/guix/20220502/"
>> + "M2-Planet-" m2-planet-version ".tar.gz"))
>> + (sha256
>> + (base32
>> + "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g")))))
>> + ,@(%boot-gash-inputs)))
>
> Here you can avoid ‘bootstrap-origin’ too and add mirror://gnu URLs.

Ok.

Toggle quote (16 lines)
> The “new style” (with gexps) doesn’t work well with non-package inputs
> in the sense that you cannot use ‘this-package-input’ to access them.
>
> However, it might be simpler to not have them in ‘native-inputs’ and to
> instead refer to them in the code, as in:
>
> #~(begin
> …
> (invoke "tar" "xvf" #$mescc-tools)
> …)
>
> where:
>
> (define mescc-tools
> (origin …))

Ok. I put the mescc-tools and m2-planet in the initial let.

Toggle quote (8 lines)
>> + (synopsis "The initial bootstrap package, builds stage0 up to M2-Planet")
>> + (description
>> + "Starting from an 357-byte hex0 provided by the bootstrap-seeds,
>> +stage0-posix builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1,
>> +M2, get_machine, (mescc-tools), and M2-Planet.")
>
> Bonus points if you can make it a full sentence. :-)

I tried:

"Starting from the 357-byte hex0-seed binary provided by the
bootstrap-seeds, the stage0-posix package first builds hex0 and then all
the way up: hex1, catm, hex2, M0, cc_x86, M1, M2, get_machine (that's
all of MesCC-Tools), and finally M2-Planet."

Toggle quote (3 lines)
> (I feel ridiculous commenting on this on a patch series that’s this
> important, but hey!)

(otoh, after putting in all this work, some polishing doesn't hurt, so:
thanks!)

Greetings,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:09
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87pmkh4zx5.fsf@gnu.org
Ludovic Courtès writes:

Toggle quote (4 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/packages/commencement.scm (mes-boot)[source]: Update to
>> 0.24.
[..]
Toggle quote (4 lines)
>> + (source (bootstrap-origin
>
> No need for ‘bootstrap-origin’.

Ok.

Toggle quote (2 lines)
> Otherwise LGTM!

Yay! :)

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:09
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87ilq94zww.fsf@gnu.org
Ludovic Courtès writes:

Hi,

Toggle quote (18 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/packages/commencement.scm (tcc-boot0): Call 'bootstrap-origin' on source
>> and on the source of NYACC-0.99. Use https source URL. Update NYACC to
>> 1.00.2.
>
> [...]
>
>> + (source (bootstrap-origin
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "https://lilypond.org/janneke/mes/20191117/"
>
> Same here for ‘bootstrap-origin’ and the URL.
>
> Otherwise LGTM.

Done.

Toggle quote (13 lines)
>> (native-inputs
>> `(("mes" ,mes-boot)
>> - ("nyacc-source" ,(origin (inherit (package-source nyacc-0.99))
>> - (snippet #f)))
>> + ("nyacc-source" ,(bootstrap-origin
>> + (origin (inherit (package-source nyacc-1.00.2))
>> + (snippet #f))))
>> ("mescc-tools" ,%bootstrap-mescc-tools)
>> ,@(%boot-gash-inputs)))
>
> In a subsequent patch (not a blocker), we can look at removing input
> labels.

Okay, that would be nice.
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:09
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87bkw14zwe.fsf@gnu.org
Ludovic Courtès writes:

Hi,

Toggle quote (10 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/packages/commencement.scm (tcc-boot0)[source]: Update to
>> 0.9.26-1136-g0fbeb2dd.
>>
>> - ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 11
>> + ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 30
>
> Slowly increasing. :-)

Yeah...

Toggle quote (16 lines)
>> (source (bootstrap-origin
>> (origin
>> (method url-fetch)
>> (uri (string-append
>> - "https://lilypond.org/janneke/mes/20191117/"
>> + "https://lilypond.org/janneke/tcc/"
>> "/tcc-" version ".tar.gz"))
>> (sha256
>> (base32
>> - "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng")))))
>> + "1y2f04qwdqg7dgxiscbf0ibybx2gclniwbbcsxpayazzii2cvji3")))))
>
> Eventually we should have that on ftp.gnu.org too, but I realize we
> might be better off addressing it afterwards since we’ll have to agree
> on the whole file tree we’re going to upload there.

Okay. I've kept the mirror:// put in place in the previous patch, it
now looks like

(uri (list
(string-append "mirror://gnu/guix/mirror/"
"tcc-" version ".tar.gz")
"tcc-" version ".tar.gz")))

Yeah, we may want to change them all to something like

"mirror://gnu/guix/mirror/20220512/"

? The bootstrap-seeds may last a while, but stage0-posix and tcc will
see more updates.

After pushing all changes to wip-full-source-bootstrap I'm going to
update test a new build, so we have some time to decide on this :-)

Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 10:10
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87zgjl3lb9.fsf@gnu.org
Ludovic Courtès writes:

Hi,

Toggle quote (8 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * doc/guix.texi (Reduced Binary Seed Bootstrap): Update and rename to...
>> (Full Source Bootstrap): ...this.
>> * doc/images/gcc-core-mesboot0-graph.dot: Regenerate.
>
> Nice!

Yeah, I really like this too.

Toggle quote (5 lines)
>> -Copyright @copyright{} 2016, 2017, 2018, 2019, 2020 Jan Nieuwenhuizen@*
>> +Copyright @copyright{} 2016, 2017, 2018, 2019, 2021 Jan Nieuwenhuizen@*
>
> 2022 even. :-)

Oh my, that's right!

Toggle quote (6 lines)
>> +``Full Source'' bootstrap. This bootstrap is rooted in @file{hex0-seed}
>
> Maybe: @dfn{full-source bootstrap}.
>
> (I’d tend to avoid capitals, not sure.)

Nice.

Toggle quote (18 lines)
>> +from the @url{https://savannah.gnu.org/projects/stage0,Stage0} package.
>> +The source code of this initial hex0 program is a file called
>> +@c XXX TODO: udpate to savannah url, once accepted there
>> +@url{https://github.com/oriansj/bootstrap-seeds/blob/master/POSIX/x86/hex0_x86.hex0,@file{hex0_x86.hex0}}
>> +and is written in the @code{hex0} language.
>> +
>> +Hex0 is self hosting, which means that it can build itself:
>
> Before “The source code of this initial …”, perhaps add a sentence like:
>
> The hex0 program is minimalist assembler: it reads space-separated
> hexadecimal digits from a file, possibly including comments, and emits
> on standard output the bytes corresponding to those hexadecimal
> numbers.
>
> (Is that a fine description? I think it’d be nice if the stage0 site
> and repo could describe things in simple terms like that.)

Yes, that's nice.

Toggle quote (2 lines)
> s/self hosting/self-hosting/

Ok.

Toggle quote (11 lines)
>> -The only significant binary bootstrap seeds that remain@footnote{
>> -Ignoring the 68KB @code{mescc-tools}; that will be removed later,
>> -together with @code{mes}.} are a Scheme interpreter and a Scheme
>> -compiler: GNU Mes and GNU Guile@footnote{Not shown in this graph are the
>> -static binaries for @file{bash}, @code{tar}, and @code{xz} that are used
>> -to get Guile running.}.
>
> \o/
>
> Otherwise LGTM!

\o/ Phew!
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 13 May 2022 15:56
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87lev5h6y4.fsf@gnu.org
Hullo!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

Toggle quote (16 lines)
> Okay. I've kept the mirror:// put in place in the previous patch, it
> now looks like
>
> (uri (list
> (string-append "mirror://gnu/guix/mirror/"
> "tcc-" version ".tar.gz")
> (string-append "https://lilypond.org/janneke/tcc/"
> "tcc-" version ".tar.gz")))
>
> Yeah, we may want to change them all to something like
>
> "mirror://gnu/guix/mirror/20220512/"
>
> ? The bootstrap-seeds may last a while, but stage0-posix and tcc will
> see more updates.

Source code tarballs (like tcc here) can go to:


For “binary” seeds (which in fact are no longer “binary”!), we can
follow the scheme at:


… which looks like this:

/gnu/guix/bootstrap/SYSTEM/DATE

Or we could use /mirror as well, but then I’m not sure what that should
look like. WDYT?

See, the most difficult issues are yet to be solved. :-)

Ludo’.
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-1-janneke@gnu.org
* gnu/packages/commencement.scm (bootstrap-seeds): New variable.
---
gnu/packages/commencement.scm | 42 ++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)

Toggle diff (62 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 9d6ed5fd08..ebb4ea98f1 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018, 2019, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018, 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
@@ -266,6 +266,46 @@ (define (%boot-gash-inputs)
("bootar" ,bootar)
("guile" ,%bootstrap-guile)))
+(define bootstrap-seeds
+ (package
+ (name "bootstrap-seeds")
+ (version "1.0.0")
+ (source (origin
+ (method url-fetch)
+ (uri (list
+ (string-append "mirror://gnu/guix/mirror/"
+ "bootstrap-seeds-" version ".tar.gz")
+ (string-append
+ "https://lilypond.org/janneke/guix/20220501/"
+ "bootstrap-seeds-" version ".tar.gz")))
+ (sha256
+ (base32
+ "0scz2bx8fd8c821h6y1j3x6ywgxxns7iinyn9z32dnkiacfdcpfn"))))
+ (native-inputs (list bootar))
+ (build-system trivial-build-system)
+ (arguments
+ (list #:guile %bootstrap-guile
+ #:modules '((guix build utils))
+ #:builder
+ #~(begin
+ (use-modules (guix build utils))
+ (let ((source (assoc-ref %build-inputs "source"))
+ (tar (assoc-ref %build-inputs "bootar"))
+ (out (assoc-ref %outputs "out")))
+ (setenv "PATH" (string-append tar "/bin:"))
+ (invoke "tar" "xvf" source)
+ (mkdir-p out)
+ (copy-recursively "bootstrap-seeds" out)))))
+ (home-page "https://github.com/oriansj/bootstrap-seeds")
+ (synopsis "The initial bootstrap seeds: 357-byte hex0 and kaem shell")
+ (description
+ "This package provides pre-built binaries of the bootstrap seeds. It
+contains a hex0-seed and an optional kaem-minimal shell. The size of the hex0
+seeds are for knight: 250 bytes, x86-linux: 357 bytes, x86_64-linux: 431
+bytes, and aarch64-linux 526 bytes. These can be used to build stage0: hex0,
+hex1, hex2, M1, and M2-Planet.")
+ (license license:gpl3+)))
+
(define %bootstrap-mes-rewired
(package
(inherit mes)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 3/8] gnu: commencement: mes-boot: Update to 0.24, build with M2-Planet.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-3-janneke@gnu.org
* gnu/packages/commencement.scm (mes-boot)[source]: Update to
0.24.
[native-inputs]: Add stage0-posix, remove %bootstrap-mescc-tools and
%bootstrap-mes-rewired, and update nyacc to 1.00.2.
---
gnu/packages/commencement.scm | 48 +++++++++++++++++------------------
1 file changed, 23 insertions(+), 25 deletions(-)

Toggle diff (102 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index cf3b356543..8a9bc3565f 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -535,27 +535,27 @@ (define mes-boot
(package
(inherit mes)
(name "mes-boot")
- (version "0.22")
+ (version "0.24")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/mes/"
"mes-" version ".tar.gz"))
(sha256
(base32
- "0p1jsrrmcbc0zrvbvnjbb6iyxr0in71km293q8qj6gnar6bw09av"))))
+ "00lrpm4x5qg0l840zhbf9mr67mqhp8gljcl24j5dy0y109gf32w2"))))
(inputs '())
(propagated-inputs '())
(native-inputs
- `(("nyacc-source" ,(origin (inherit (package-source nyacc-0.99))
- (snippet #f)))
- ("mes" ,%bootstrap-mes-rewired)
- ("mescc-tools" ,%bootstrap-mescc-tools)
+ `(("m2-planet" ,stage0-posix)
+ ("nyacc-source" ,(bootstrap-origin
+ (origin (inherit (package-source nyacc-1.00.2))
+ (snippet #f))))
,@(%boot-gash-inputs)))
(arguments
`(#:implicit-inputs? #f
#:tests? #f
#:guile ,%bootstrap-guile
- #:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries
+ #:strip-binaries? #f ;no strip yet
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'unpack-seeds
@@ -564,44 +564,42 @@ (define mes-boot
(with-directory-excursion ".."
(invoke "tar" "-xvf" nyacc-source)))))
(replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref %outputs "out"))
- (gash (assoc-ref %build-inputs "bash"))
- (mes (assoc-ref %build-inputs "mes"))
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gash (assoc-ref inputs "bash"))
+ (mes (assoc-ref inputs "mes"))
(dir (with-directory-excursion ".." (getcwd))))
- (setenv "AR" (string-append "gash " (getcwd) "/scripts/mesar"))
- (setenv "BASH" (string-append gash "/bin/bash"))
- (setenv "CC" (string-append mes "/bin/mescc"))
- (setenv "GUILE_LOAD_PATH"
- (string-append
- mes "/share/mes/module"
- ":" dir "/nyacc-0.99.0/module"))
+ (setenv "GUILE_LOAD_PATH" (string-append
+ dir "/nyacc-1.00.2/module"))
(invoke "gash" "configure.sh"
(string-append "--prefix=" out)
- (string-append "--host=i686-linux-gnu")))))
+ "--host=i686-linux-gnu"))))
(replace 'build
(lambda _
- (invoke "sh" "bootstrap.sh")))
+ (invoke "gash" "bootstrap.sh")))
(delete 'check)
(replace 'install
- (lambda _
+ (lambda* (#:key outputs #:allow-other-keys)
(substitute* "install.sh" ; show some progress
((" -xf") " -xvf")
(("^( *)((cp|mkdir|tar) [^']*[^\\])\n" all space cmd)
(string-append space "echo '" cmd "'\n"
space cmd "\n")))
- (invoke "sh" "install.sh")
+ (invoke "gash" "install.sh")
;; Keep ASCII output, for friendlier comparison and bisection
- (let* ((out (assoc-ref %outputs "out"))
+ (let* ((out (assoc-ref outputs "out"))
(cache (string-append out "/lib/cache")))
(define (objects-in-dir dir)
(find-files dir
(lambda (name stat)
(and (equal? (dirname name) dir)
- (or (string-suffix? ".o" name)
+ (or (string-suffix? ".M1" name)
+ (string-suffix? ".hex2" name)
+ (string-suffix? ".o" name)
(string-suffix? ".s" name))))))
(for-each (lambda (x) (install-file x cache))
- (append (objects-in-dir ".")
+ (append (objects-in-dir "m2")
+ (objects-in-dir ".")
(objects-in-dir "mescc-lib")))))))))
(native-search-paths
(list (search-path-specification
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-2-janneke@gnu.org
Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
get_machine, (mescc-tools), and M2-Planet.

* gnu/packages/commencement.scm (stage0-posix): New variable.
---
gnu/packages/commencement.scm | 117 ++++++++++++++++++++++++++++++++++
1 file changed, 117 insertions(+)

Toggle diff (130 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ebb4ea98f1..cf3b356543 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -306,6 +306,123 @@ (define bootstrap-seeds
hex1, hex2, M1, and M2-Planet.")
(license license:gpl3+)))
+(define stage0-posix
+ ;; The initial bootstrap package: no binary inputs except those from
+ ;; `bootstrap-seeds, for x86 a 357 byte binary seed: `x86/hex0-seed'.
+ (let* ((mescc-tools-version "1.4.0")
+ (m2-planet-version "1.9.0")
+ (mescc-tools
+ (origin
+ (method url-fetch)
+ (uri (list
+ (string-append
+ "mirror://gnu/guix/mirror/"
+ "mescc-tools-" mescc-tools-version ".tar.gz")
+ (string-append
+ "https://lilypond.org/janneke/guix/20220502/"
+ "mescc-tools-" mescc-tools-version ".tar.gz")))
+ (sha256
+ (base32
+ "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg"))))
+ (m2-planet
+ (origin
+ (method url-fetch)
+ (uri (list
+ (string-append
+ "mirror://gnu/guix/mirror/"
+ "M2-Planet-" m2-planet-version ".tar.gz")
+ (string-append
+ "https://lilypond.org/janneke/guix/20220502/"
+ "M2-Planet-" m2-planet-version ".tar.gz")))
+ (sha256
+ (base32
+ "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g")))))
+ (package
+ (name "stage0-posix")
+ (version "1.4")
+ (source (origin
+ (method url-fetch)
+ (uri (list
+ (string-append "mirror://gnu/guix/mirror/"
+ "stage0-posix-" version ".tar.gz")
+ (string-append
+ "https://lilypond.org/janneke/guix/20220502/"
+ "stage0-posix-" version ".tar.gz")))
+ (sha256
+ (base32
+ "1ammifkj33205qrpfm84yb1c99lwgbn4jsl1hd08aab8c9ffz6p4"))))
+ (supported-systems '("i686-linux" "x86_64-linux"
+ "armhf-linux" "aarch64-linux"
+ "riscv64-linux"))
+ (native-inputs
+ `(("bootstrap-seeds" ,bootstrap-seeds)
+ ,@(%boot-gash-inputs)))
+ (build-system trivial-build-system)
+ (arguments
+ (list
+ #:guile %bootstrap-guile
+ #:modules '((guix build utils))
+ #:builder
+ #~(begin
+ (use-modules (guix build utils))
+ (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds"))
+ (source (assoc-ref %build-inputs "source"))
+ (tar (assoc-ref %build-inputs "bootar"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (coreutils (assoc-ref %build-inputs "coreutils"))
+ (guile (assoc-ref %build-inputs "guile"))
+ (out (assoc-ref %outputs "out"))
+ (bindir (string-append out "/bin"))
+ (target (or #$(%current-target-system)
+ #$(%current-system)))
+ (stage0-cpu
+ (cond
+ ((or #$(target-x86-64?) #$(target-x86-32?))
+ "x86")
+ (#$(target-arm?)
+ "armv7l")
+ (else
+ (error "stage0-posix: system not supported" target))))
+ (kaem (string-append "../bootstrap-seeds/POSIX/"
+ stage0-cpu "/kaem-optional-seed")))
+ (setenv "PATH" (string-append tar "/bin:"
+ coreutils "/bin:"
+ bash "/bin"))
+ (invoke "tar" "xvf" source)
+ (chdir (string-append "stage0-posix-" #$version))
+ (copy-recursively bootstrap-seeds "bootstrap-seeds")
+ (invoke "tar" "xvf" #$mescc-tools)
+ (rmdir "mescc-tools")
+ (symlink (string-append "mescc-tools-" #$mescc-tools-version)
+ "mescc-tools")
+ (invoke "tar" "xvf" #$m2-planet)
+ (rmdir "M2-Planet")
+ (symlink (string-append "M2-Planet-" #$m2-planet-version)
+ "M2-Planet")
+ (rmdir "M2libc")
+ (symlink "M2-Planet/M2libc" "M2libc")
+ (mkdir-p bindir)
+ (with-directory-excursion stage0-cpu
+ (with-output-to-file "mes-m2.kaem"
+ (lambda _ (display "")))
+ (with-output-to-file "mescc-tools-extra.kaem"
+ (lambda _ (display "")))
+ (invoke kaem "kaem.run"))
+ (with-directory-excursion "bin"
+ (install-file "hex2" bindir)
+ (install-file "M1" bindir)
+ (install-file "blood-elf" bindir)
+ (install-file "kaem" bindir)
+ (install-file "get_machine" bindir)
+ (install-file "M2-Planet" bindir))))))
+ (home-page "https://github.com/oriansj/stage0-posix/")
+ (synopsis "The initial bootstrap package, builds stage0 up to M2-Planet")
+ (description "Starting from the 357-byte hex0-seed binary provided by
+the bootstrap-seeds, the stage0-posix package first builds hex0 and then all
+the way up: hex1, catm, hex2, M0, cc_x86, M1, M2, get_machine (that's all of
+MesCC-Tools), and finally M2-Planet.")
+ (license license:gpl3+))))
+
(define %bootstrap-mes-rewired
(package
(inherit mes)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 5/8] gnu: commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-5-janneke@gnu.org
* gnu/packages/commencement.scm (tcc-boot0)[source]: Update to
0.9.26-1136-g0fbeb2dd.
[native-inputs]: Add stage0-posix and mes-boot, remove
%bootstrap-mescc-tools and %bootstrap-mes-rewired.
---
gnu/packages/commencement.scm | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)

Toggle diff (95 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 776f5955a2..d01b0ef8c9 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -615,7 +615,7 @@ (define (objects-in-dir dir)
(define tcc-boot0
- ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 11
+ ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 30
;; patches. In a very early and rough form they were presented to the
;; TinyCC developers, who at the time showed no interest in supporting the
;; bootstrappable effort; we will try again later. These patches have been
@@ -624,28 +624,27 @@ (define tcc-boot0
(package
(inherit tcc)
(name "tcc-boot0")
- (version "0.9.26-1103-g6e62e0e")
+ (version "0.9.26-1136-g5bba73cc")
(source (origin
(method url-fetch)
(uri (list
(string-append "mirror://gnu/guix/mirror/"
"tcc-" version ".tar.gz")
- (string-append
- "https://lilypond.org/janneke/mes/20191117/"
- "/tcc-" version ".tar.gz")))
+ (string-append "https://lilypond.org/janneke/tcc/"
+ "tcc-" version ".tar.gz")))
(sha256
(base32
- "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng"))))
+ "1y2f04qwdqg7dgxiscbf0ibybx2gclniwbbcsxpayazzii2cvji3"))))
(build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(inputs '())
(propagated-inputs '())
(native-inputs
`(("mes" ,mes-boot)
+ ("mescc-tools" ,stage0-posix)
("nyacc-source" ,(bootstrap-origin
(origin (inherit (package-source nyacc-1.00.2))
(snippet #f))))
- ("mescc-tools" ,%bootstrap-mescc-tools)
,@(%boot-gash-inputs)))
(arguments
`(#:implicit-inputs? #f
@@ -660,18 +659,17 @@ (define tcc-boot0
(with-directory-excursion ".."
(invoke "tar" "-xvf" nyacc-source)))))
(replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref %outputs "out"))
(dir (with-directory-excursion ".." (getcwd)))
- (interpreter "/lib/mes-loader"))
-
- (setenv "prefix" out)
- (setenv "GUILE_LOAD_PATH"
- (string-append dir "/nyacc-0.99.0/module"))
-
+ (interpreter "/lib/mes-loader")
+ (mes (assoc-ref inputs "mes"))
+ (mescc (string-append mes "/bin/mescc")))
(substitute* "conftest.c"
(("volatile") ""))
-
+ (setenv "prefix" out)
+ (setenv "GUILE_LOAD_PATH"
+ (string-append dir "/nyacc-1.00.2/module"))
(invoke "sh" "configure"
"--cc=mescc"
(string-append "--prefix=" out)
@@ -681,7 +679,7 @@ (define tcc-boot0
(replace 'build
(lambda _
(substitute* "bootstrap.sh" ; Show some progress
- (("^( *)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{PROGRAM_PREFIX[}]tcc) [^\"]*[^\\])\n" all space cmd)
+ (("^( *)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{program_prefix[}]tcc) [^\"]*[^\\])\n" all space cmd)
(string-append space "echo \"" cmd "\"\n"
space cmd "\n")))
(invoke "sh" "bootstrap.sh")))
@@ -901,8 +899,8 @@ (define tcc-boot
(string-append out "/include"))
(copy-recursively (string-append tcc "/lib")
(string-append out "/lib"))
- (invoke "tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o" "libtcc1.o" "lib/libtcc1.c")
- (invoke "tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o")
+ (invoke "./tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o" "libtcc1.o" "lib/libtcc1.c")
+ (invoke "./tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o")
(copy-file "libtcc1.a" (string-append out "/lib/libtcc1.a"))
(delete-file (string-append out "/lib/tcc/libtcc1.a"))
(copy-file "libtcc1.a"
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 6/8] gnu: bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-6-janneke@gnu.org
* gnu/packages/bootstrap.scm (%bootstrap-inputs): Remove
%bootstrap-mescc-tools, %bootstrap-mes.
---
gnu/packages/bootstrap.scm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 8bd0c4eaf3..03242f0e7b 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -1035,9 +1035,7 @@ (define (%bootstrap-inputs)
;; own packages.
(match (%current-system)
((or "i686-linux" "x86_64-linux")
- `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)
- ("bootstrap-mescc-tools" ,%bootstrap-mescc-tools)
- ("mes" ,%bootstrap-mes)))
+ `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)))
(_
`(("libc" ,%bootstrap-glibc)
("gcc" ,%bootstrap-gcc)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 7/8] gnu: commencement: Remove %bootstrap-mes-rewired.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-7-janneke@gnu.org
* gnu/packages/commencement.scm (%bootstrap-mes-rewired): Remove.
---
gnu/packages/commencement.scm | 108 ----------------------------------
1 file changed, 108 deletions(-)

Toggle diff (121 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d01b0ef8c9..0390c43023 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -423,114 +423,6 @@ (define stage0-posix
MesCC-Tools), and finally M2-Planet.")
(license license:gpl3+))))
-(define %bootstrap-mes-rewired
- (package
- (inherit mes)
- (name "bootstrap-mes-rewired")
- (version "0.19")
- (source #f)
- (native-inputs `(("mes" ,%bootstrap-mes)
- ("gash" ,gash-boot)))
- (inputs '())
- (propagated-inputs '())
- (outputs '("out"))
- (build-system trivial-build-system)
- (arguments
- `(#:guile ,%bootstrap-guile
- #:modules ((guix build utils))
-
- #:builder (begin
- (use-modules (guix build utils)
- (srfi srfi-26))
-
- (let* ((mes (assoc-ref %build-inputs "mes"))
- (gash (assoc-ref %build-inputs "gash"))
- (mes-bin (string-append mes "/bin"))
- (guile (string-append mes-bin "/mes"))
- (mes-module (string-append mes "/share/mes/module"))
- (out (assoc-ref %outputs "out"))
- (bin (string-append out "/bin"))
- (mescc (string-append bin "/mescc"))
- (module (string-append out "/share/mes/module")))
- (define (rewire file)
- (substitute* file
- ((mes) out)
- (("/gnu/store[^ ]+mes-minimal-[^/)}\"]*") out)
- (("/gnu/store[^ ]+guile-[^/]*/bin/guile") guile)
- (("/gnu/store[^ ]+bash-[^/)}\"]*") gash)))
-
- (mkdir-p bin)
- (for-each (lambda (file) (install-file file bin))
- (find-files mes-bin))
- (mkdir-p module)
- (copy-recursively (string-append mes-module "/mes")
- (string-append module "/mes"))
- (copy-recursively (string-append mes-module "/srfi")
- (string-append module "/srfi"))
- (for-each rewire
- ;; Cannot easily rewire "mes" because it
- ;; contains NUL characters; would require
- ;; remove-store-references alike trick
- (filter (negate (cut string-suffix? "/mes" <>))
- (find-files bin)))
- (rewire (string-append module "/mes/boot-0.scm"))
-
- (delete-file mescc)
- (with-output-to-file mescc
- (lambda _
- (display (string-append
- "\
-#! " gash "/bin/sh
-LANG=C
-LC_ALL=C
-export LANG LC_ALL
-
-MES_PREFIX=${MES_REWIRED_PREFIX-" out "/share/mes}
-MES=" bin "/mes
-export MES MES_PREFIX
-
-MES_ARENA=${MES_REWIRED_ARENA-10000000}
-MES_MAX_ARENA=${MES_REWIRED_ARENA-10000000}
-MES_STACK=${MES_REWIRED_STACK-1000000}
-export MES_ARENA MES_MAX_ARENA MES_STACK
-
-$MES -e '(mescc)' module/mescc.scm -- \"$@\"
-"))))
- (chmod mescc #o555)
-
- (with-directory-excursion module
- (chmod "mes/base.mes" #o644)
- (copy-file "mes/base.mes" "mes/base.mes.orig")
- (let ((base.mes (open-file "mes/base.mes" "a")))
- (display "
-;; A fixed map, from Mes 0.21, required to bootstrap Mes 0.21
-(define (map f h . t)
- (if (or (null? h)
- (and (pair? t) (null? (car t)))
- (and (pair? t) (pair? (cdr t)) (null? (cadr t)))) '()
- (if (null? t) (cons (f (car h)) (map f (cdr h)))
- (if (null? (cdr t))
- (cons (f (car h) (caar t)) (map f (cdr h) (cdar t)))
- (if (null? (cddr t))
- (cons (f (car h) (caar t) (caadr t)) (map f (cdr h) (cdar t) (cdadr t)))
- (error 'unsupported (cons* 'map-4: f h t))b )))))
-" base.mes)
- (close base.mes))
-
- (chmod "mes/guile.mes" #o644)
- (copy-file "mes/guile.mes" "mes/guile.mes.orig")
- (let ((guile.mes (open-file "mes/guile.mes" "a")))
- (display "
-;; After booting guile.scm; use Mes 0.21; especially: MesCC 0.21
-(let* ((self (car (command-line)))
- (prefix (dirname (dirname self))))
- (set! %moduledir (string-append prefix \"/mes/module/\"))
- (setenv \"%numbered_arch\" \"true\"))
-
-" guile.mes)
- (close guile.mes)))
- #t))))))
-
(define mes-boot
(package
(inherit mes)
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 4/8] gnu: commencement: tcc-boot0: Use nyacc-1.00.2.
(address . 55227@debbugs.gnu.org)
20220513153631.13052-4-janneke@gnu.org
* gnu/packages/commencement.scm (tcc-boot0): Use https source URL with
mirror://. Update NYACC to 1.00.2 and call 'bootstrap-origin' on the source.
---
gnu/packages/commencement.scm | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

Toggle diff (43 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 8a9bc3565f..776f5955a2 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018, 2019, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018, 2019, 2020, 2021, 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
@@ -627,9 +627,12 @@ (define tcc-boot0
(version "0.9.26-1103-g6e62e0e")
(source (origin
(method url-fetch)
- (uri (string-append
- "http://lilypond.org/janneke/mes/20191117/"
- "/tcc-" version ".tar.gz"))
+ (uri (list
+ (string-append "mirror://gnu/guix/mirror/"
+ "tcc-" version ".tar.gz")
+ (string-append
+ "https://lilypond.org/janneke/mes/20191117/"
+ "/tcc-" version ".tar.gz")))
(sha256
(base32
"1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng"))))
@@ -639,8 +642,9 @@ (define tcc-boot0
(propagated-inputs '())
(native-inputs
`(("mes" ,mes-boot)
- ("nyacc-source" ,(origin (inherit (package-source nyacc-0.99))
- (snippet #f)))
+ ("nyacc-source" ,(bootstrap-origin
+ (origin (inherit (package-source nyacc-1.00.2))
+ (snippet #f))))
("mescc-tools" ,%bootstrap-mescc-tools)
,@(%boot-gash-inputs)))
(arguments
--
2.35.1
J
J
Jan (janneke) Nieuwenhuizen wrote on 13 May 2022 17:36
[PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap".
(address . 55227@debbugs.gnu.org)
20220513153631.13052-8-janneke@gnu.org
* doc/guix.texi (Reduced Binary Seed Bootstrap): Update and rename to...
(Full-Source Bootstrap): ...this.
* doc/images/gcc-core-mesboot0-graph.dot: Regenerate.
---
doc/guix.texi | 81 ++++++-----
doc/images/gcc-core-mesboot0-graph.dot | 187 ++++++++++---------------
2 files changed, 120 insertions(+), 148 deletions(-)

Toggle diff (326 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 7bd80a1592..c612a5cec1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36,7 +36,7 @@ Copyright @copyright{} 2016, 2017, 2018, 2021 Chris Marusich@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner@*
Copyright @copyright{} 2016 John Darrington@*
Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
-Copyright @copyright{} 2016, 2017, 2018, 2019, 2020 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018, 2019, 2021, 2022 Jan Nieuwenhuizen@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller@*
Copyright @copyright{} 2016 Alex ter Weele@*
Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines@*
@@ -394,7 +394,7 @@ Installing Debugging Files
Bootstrapping
-* Reduced Binary Seed Bootstrap:: A Bootstrap worthy of GNU.
+* Full-source Bootstrap:: A Bootstrap worthy of GNU.
* Preparing to Use the Bootstrap Binaries:: Building that what matters most.
@end detailmenu
@@ -39491,12 +39491,12 @@ re-create them if needed (@pxref{Preparing to Use the Bootstrap
Binaries}).
@menu
-* Reduced Binary Seed Bootstrap:: A Bootstrap worthy of GNU.
+* Full-source Bootstrap:: A Bootstrap worthy of GNU.
* Preparing to Use the Bootstrap Binaries:: Building that what matters most.
@end menu
-@node Reduced Binary Seed Bootstrap
-@section The Reduced Binary Seed Bootstrap
+@node Full-source Bootstrap
+@section The Full-source Bootstrap
Guix---like other GNU/Linux distributions---is traditionally bootstrapped from
a set of bootstrap binaries: Bourne shell, command-line tools provided by GNU
@@ -39511,28 +39511,47 @@ about 250MB (@pxref{Bootstrappable Builds,,, mes, GNU Mes}). Auditing
or even inspecting these is next to impossible.
For @code{i686-linux} and @code{x86_64-linux}, Guix now features a
-``Reduced Binary Seed'' bootstrap @footnote{We would like to say: ``Full
-Source Bootstrap'' and while we are working towards that goal it would
-be hyperbole to use that term for what we do now.}.
-
-The Reduced Binary Seed bootstrap removes the most critical tools---from a
-trust perspective---from the bootstrap binaries: GCC, Binutils and the GNU C
-Library are replaced by: @code{bootstrap-mescc-tools} (a tiny assembler and
-linker) and @code{bootstrap-mes} (a small Scheme Interpreter and a C compiler
-written in Scheme and the Mes C Library, built for TinyCC and for GCC).
-
-Using these new binary seeds the ``missing'' Binutils, GCC, and the GNU
-C Library are built from source. From here on the more traditional
-bootstrap process resumes. This approach has reduced the bootstrap
-binaries in size to about 145MB in Guix v1.1.
-
-The next step that Guix has taken is to replace the shell and all its
+@dfn{full-source bootstrap}. This bootstrap is rooted in
+@file{hex0-seed} from the @url{https://savannah.gnu.org/projects/stage0,
+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
+@c XXX TODO: udpate to savannah url, once accepted there
+@url{https://github.com/oriansj/bootstrap-seeds/blob/master/POSIX/x86/hex0_x86.hex0,@file{hex0_x86.hex0}}
+and is written in the @code{hex0} language.
+
+Hex0 is self-hosting, which means that it can build itself:
+
+@example
+./hex0-seed hex0_x86.hex0 hex0
+@end example
+
+Hex0 it is the ASCII-equivalent of the binary program and can be
+produced by doing something much like:
+
+@example
+sed 's/[;#].*$//g' hex0_x86.hex0 | xxd -r -p > hex0
+chmod +x hex0
+@end example
+
+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: @code{hex0} builds @code{hex1} and then on
+to @code{M0}, @code{hex2}, @code{M1}, @code{mescc-tools} and finally
+@code{M2-Planet}. Then, using @code{mescc-tools}, @code{M2-Planet} we
+build Mes (@pxref{Top, GNU Mes Reference Manual,, mes, GNU Mes}, a
+Scheme interpreter and C compiler in Scheme). Frome here on starts
+the more traditional @code{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 @emph{Scheme-only
bootstrap}. Gash (@pxref{Gash,,, gash, 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. The rest of the bootstrap binary seeds that were
-removed are now built from source.
+Gzip, Sed, and Tar.
Building the GNU System from source is currently only possible by adding
some historical GNU packages as intermediate steps@footnote{Packages
@@ -39548,22 +39567,10 @@ The graph below shows the resulting dependency graph for
@code{gcc-core-mesboot0}, the bootstrap compiler used for the
traditional bootstrap of the rest of the Guix System.
-@c ./pre-inst-env guix graph -e '(@@ (gnu packages commencement) gcc-core-mesboot0)' | sed -re 's,((bootstrap-mescc-tools|bootstrap-mes|guile-bootstrap).*shape =) box,\1 ellipse,' > doc/images/gcc-core-mesboot0-graph.dot
+@c ./pre-inst-env guix graph -e '(@@ (gnu packages commencement) gcc-core-mesboot0)' | sed -re 's,((bootstrap-seeds|guile-bootstrap).*shape =) box,\1 ellipse,' > doc/images/gcc-core-mesboot0-graph.dot
@image{images/gcc-core-mesboot0-graph,6in,,Dependency graph of gcc-core-mesboot0}
-The only significant binary bootstrap seeds that remain@footnote{
-Ignoring the 68KB @code{mescc-tools}; that will be removed later,
-together with @code{mes}.} are a Scheme interpreter and a Scheme
-compiler: GNU Mes and GNU Guile@footnote{Not shown in this graph are the
-static binaries for @file{bash}, @code{tar}, and @code{xz} that are used
-to get Guile running.}.
-
-This further reduction has brought down the size of the binary seed to
-about 60MB for @code{i686-linux} and @code{x86_64-linux}.
-
-Work is ongoing to remove all binary blobs from our free software
-bootstrap stack, working towards a Full Source Bootstrap. Also ongoing
-is work to bring these bootstraps to the @code{arm-linux} and
+Work is ongoing to to bring these bootstraps to the @code{arm-linux} and
@code{aarch64-linux} architectures and to the Hurd.
If you are interested, join us on @samp{#bootstrappable} on the Freenode
diff --git a/doc/images/gcc-core-mesboot0-graph.dot b/doc/images/gcc-core-mesboot0-graph.dot
index 191582ed4c..ef4e3a441e 100644
--- a/doc/images/gcc-core-mesboot0-graph.dot
+++ b/doc/images/gcc-core-mesboot0-graph.dot
@@ -1,114 +1,79 @@
digraph "Guix package" {
- "139781154519456" [label = "gcc-core-mesboot0@2.95.3", shape = box, fontname = Helvetica];
- "139781154519456" -> "139781154519632" [color = darkgoldenrod];
- "139781154519456" -> "139781154520688" [color = darkgoldenrod];
- "139781154519456" -> "139781034971312" [color = darkgoldenrod];
- "139781154519456" -> "139781154520160" [color = darkgoldenrod];
- "139781154519456" -> "139781034971664" [color = darkgoldenrod];
- "139781154519456" -> "139781154519984" [color = darkgoldenrod];
- "139781154519456" -> "139781154519808" [color = darkgoldenrod];
- "139781154519456" -> "139781154520512" [color = darkgoldenrod];
- "139781154519456" -> "139781034971488" [color = darkgoldenrod];
- "139781154519456" -> "139781034972896" [color = darkgoldenrod];
- "139781154519456" -> "139781034972368" [color = darkgoldenrod];
- "139781154519456" -> "139781034973072" [color = darkgoldenrod];
- "139781154519456" -> "139781131267872" [color = darkgoldenrod];
- "139781154519632" [label = "binutils-mesboot0@2.14", shape = box, fontname = Helvetica];
- "139781154519632" -> "139781154520688" [color = peachpuff4];
- "139781154519632" -> "139781034971312" [color = peachpuff4];
- "139781154519632" -> "139781154520160" [color = peachpuff4];
- "139781154519632" -> "139781034971664" [color = peachpuff4];
- "139781154519632" -> "139781154519984" [color = peachpuff4];
- "139781154519632" -> "139781154519808" [color = peachpuff4];
- "139781154519632" -> "139781154520512" [color = peachpuff4];
- "139781154519632" -> "139781034971488" [color = peachpuff4];
- "139781154519632" -> "139781034972896" [color = peachpuff4];
- "139781154519632" -> "139781034972368" [color = peachpuff4];
- "139781154519632" -> "139781034973072" [color = peachpuff4];
- "139781154519632" -> "139781131267872" [color = peachpuff4];
- "139781154520688" [label = "bash-mesboot0@2.05b", shape = box, fontname = Helvetica];
- "139781154520688" -> "139781034971488" [color = magenta];
- "139781154520688" -> "139781034971840" [color = magenta];
- "139781154520688" -> "139781034972896" [color = magenta];
- "139781154520688" -> "139781034972368" [color = magenta];
- "139781154520688" -> "139781034973072" [color = magenta];
- "139781154520688" -> "139781131267872" [color = magenta];
- "139781034971488" [label = "make-mesboot0@3.80", shape = box, fontname = Helvetica];
- "139781034971488" -> "139781034971840" [color = dimgrey];
- "139781034971488" -> "139781034972896" [color = dimgrey];
- "139781034971488" -> "139781034972368" [color = dimgrey];
- "139781034971488" -> "139781034973072" [color = dimgrey];
- "139781034971488" -> "139781131267872" [color = dimgrey];
- "139781034971840" [label = "tcc-boot0@0.9.26-1103-g6e62e0e", shape = box, fontname = Helvetica];
- "139781034971840" -> "139781034972016" [color = magenta];
- "139781034971840" -> "139781131266816" [color = magenta];
- "139781034971840" -> "139781034972896" [color = magenta];
- "139781034971840" -> "139781034972368" [color = magenta];
- "139781034971840" -> "139781034973072" [color = magenta];
- "139781034971840" -> "139781131267872" [color = magenta];
- "139781034972016" [label = "mes-boot@0.22", shape = box, fontname = Helvetica];
- "139781034972016" -> "139781034972192" [color = cyan3];
- "139781034972016" -> "139781131266816" [color = cyan3];
- "139781034972016" -> "139781034972896" [color = cyan3];
- "139781034972016" -> "139781034972368" [color = cyan3];
- "139781034972016" -> "139781034973072" [color = cyan3];
- "139781034972016" -> "139781131267872" [color = cyan3];
- "139781034972192" [label = "bootstrap-mes-rewired@0.19", shape = ellipse, fontname = Helvetica];
- "139781034972192" -> "139781131266640" [color = darkseagreen];
- "139781034972192" -> "139781034972896" [color = darkseagreen];
- "139781131266640" [label = "bootstrap-mes@0", shape = ellipse, fontname = Helvetica];
- "139781034972896" [label = "gash-boot@0.2.0", shape = box, fontname = Helvetica];
- "139781034972896" -> "139781034973072" [color = darkviolet];
- "139781034972896" -> "139781131267872" [color = darkviolet];
- "139781034973072" [label = "bootar@1", shape = box, fontname = Helvetica];
- "139781034973072" -> "139781131267872" [color = darkviolet];
- "139781131267872" [label = "guile-bootstrap@2.0", shape = ellipse, fontname = Helvetica];
- "139781131266816" [label = "bootstrap-mescc-tools@0.5.2", shape = ellipse, fontname = Helvetica];
- "139781034972368" [label = "gash-utils-boot@0.1.0", shape = box, fontname = Helvetica];
- "139781034972368" -> "139781034973072" [color = darkseagreen];
- "139781034972368" -> "139781034972896" [color = darkseagreen];
- "139781034972368" -> "139781131267872" [color = darkseagreen];
- "139781034971312" [label = "bzip2-mesboot@1.0.8", shape = box, fontname = Helvetica];
- "139781034971312" -> "139781034971488" [color = cyan3];
- "139781034971312" -> "139781034971840" [color = cyan3];
- "139781034971312" -> "139781034972896" [color = cyan3];
- "139781034971312" -> "139781034972368" [color = cyan3];
- "139781034971312" -> "139781034973072" [color = cyan3];
- "139781034971312" -> "139781131267872" [color = cyan3];
- "139781154520160" [label = "diffutils-mesboot@2.7", shape = box, fontname = Helvetica];
- "139781154520160" -> "139781034971488" [color = red];
- "139781154520160" -> "139781034971840" [color = red];
- "139781154520160" -> "139781034972896" [color = red];
- "139781154520160" -> "139781034972368" [color = red];
- "139781154520160" -> "139781034973072" [color = red];
- "139781154520160" -> "139781131267872" [color = red];
- "139781034971664" [label = "gzip-mesboot@1.2.4", shape = box, fontname = Helvetica];
- "139781034971664" -> "139781034971840" [color = red];
- "139781034971664" -> "139781034972896" [color = red];
- "139781034971664" -> "139781034972368" [color = red];
- "139781034971664" -> "139781034973072" [color = red];
- "139781034971664" -> "139781131267872" [color = red];
- "139781154519984" [label = "patch-mesboot@2.5.9", shape = box, fontname = Helvetica];
- "139781154519984" -> "139781034971488" [color = blue];
- "139781154519984" -> "139781034971840" [color = blue];
- "139781154519984" -> "139781034972896" [color = blue];
- "139781154519984" -> "139781034972368" [color = blue];
- "139781154519984" -> "139781034973072" [color = blue];
- "139781154519984" -> "139781131267872" [color = blue];
- "139781154519808" [label = "sed-mesboot0@1.18", shape = box, fontname = Helvetica];
- "139781154519808" -> "139781034971488" [color = red];
- "139781154519808" -> "139781034971840" [color = red];
- "139781154519808" -> "139781034972896" [color = red];
- "139781154519808" -> "139781034972368" [color = red];
- "139781154519808" -> "139781034973072" [color = red];
- "139781154519808" -> "139781131267872" [color = red];
- "139781154520512" [label = "tcc-boot@0.9.27", shape = box, fontname = Helvetica];
- "139781154520512" -> "139781034971312" [color = darkviolet];
- "139781154520512" -> "139781034971488" [color = darkviolet];
- "139781154520512" -> "139781034971840" [color = darkviolet];
- "139781154520512" -> "139781034972896" [color = darkviolet];
- "139781154520512" -> "139781034972368" [color = darkviolet];
- "139781154520512" -> "139781034973072" [color = darkviolet];
- "139781154520512" -> "139781131267872" [color = darkviolet];
+ "139803511371136" [label = "gcc-core-mesboot0@2.95.3", shape = box, fontname = sans];
+ "139803511371136" -> "139803511371312" [color = red];
+ "139803511371136" -> "139803511372016" [color = red];
+ "139803511371136" -> "139803511371488" [color = red];
+ "139803511371136" -> "139803511371664" [color = red];
+ "139803511371136" -> "139803511371840" [color = red];
+ "139803511371136" -> "139803507105792" [color = red];
+ "139803511371136" -> "139803511373600" [color = red];
+ "139803511371136" -> "139803507105968" [color = red];
+ "139803511371136" -> "139803749199472" [color = red];
+ "139803511371312" [label = "binutils-mesboot0@2.20.1a", shape = box, fontname = sans];
+ "139803511371312" -> "139803511372016" [color = dimgrey];
+ "139803511371312" -> "139803511371488" [color = dimgrey];
+ "139803511371312" -> "139803511371664" [color = dimgrey];
+ "139803511371312" -> "139803511371840" [color = dimgrey];
+ "139803511371312" -> "139803507105792" [color = dimgrey];
+ "139803511371312" -> "139803511373600" [color = dimgrey];
+ "139803511371312" -> "139803507105968" [color = dimgrey];
+ "139803511371312" -> "139803749199472" [color = dimgrey];
+ "139803511372016" [label = "gzip-mesboot@1.2.4", shape = box, fontname = sans];
+ "139803511372016" -> "139803511372192" [color = magenta];
+ "139803511372016" -> "139803507105792" [color = magenta];
+ "139803511372016" -> "139803511373600" [color = magenta];
+ "139803511372016" -> "139803507105968" [color = magenta];
+ "139803511372016" -> "139803749199472" [color = magenta];
+ "139803511372192" [label = "tcc-boot0@0.9.26-1136-g5bba73cc", shape = box, fontname = sans];
+ "139803511372192" -> "139803511372368" [color = magenta];
+ "139803511372192" -> "139803511372544" [color = magenta];
+ "139803511372192" -> "139803507105792" [color = magenta];
+ "139803511372192" -> "139803511373600" [color = magenta];
+ "139803511372192" -> "139803507105968" [color = magenta];
+ "139803511372192" -> "139803749199472" [color = magenta];
+ "139803511372368" [label = "mes-boot@0.24", shape = box, fontname = sans];
+ "139803511372368" -> "139803511372544" [color = darkviolet];
+ "139803511372368" -> "139803507105792" [color = darkviolet];
+ "139803511372368" -> "139803511373600" [color = darkviolet];
+ "139803511372368" -> "139803507105968" [color = darkviolet];
+ "139803511372368" -> "139803749199472" [color = darkviolet];
+ "139803511372544" [label = "stage0-posix@1.4", shape = box, fontname = sans];
+ "139803511372544" -> "139803511373072" [color = peachpuff4];
+ "139803511372544" -> "139803507105792" [color = peachpuff4];
+ "139803511372544" -> "139803511373600" [color = peachpuff4];
+ "139803511372544" -> "139803507105968" [color = peachpuff4];
+ "139803511372544" -> "139803749199472" [color = peachpuff4];
+ "139803511373072" [label = "bootstrap-seeds@1.0.0", shape = ellipse, fontname = sans];
+ "139803511373072" -> "139803507105968" [color = cyan3];
+ "139803507105968" [label = "bootar@1b", shape = box, fontname = sans];
+ "139803507105968" -> "139803749199472" [color = dimgrey];
+ "139803749199472" [label = "guile-bootstrap@2.0", shape = ellipse, fontname = sans];
+ "139803507105792" [label = "gash-boot@0.3.0", shape = box, fontname = sans];
+ "139803507105792" -> "139803507105968" [color = darkviolet];
+ "139803507105792" -> "139803749199472" [color = darkviolet];
+ "139803511373600" [label = "gash-utils-boot@0.2.0", shape = box, fontname = sans];
+ "139803511373600" -> "139803507105968" [color = red];
+ "139803511373600" -> "139803507105792" [color = red];
+ "139803511373600" -> "139803749199472" [color = red];
+ "139803511371488" [label = "patch-mesboot@2.5.9", shape = box, fontname = sans];
+ "139803511371488" -> "139803511371840" [color = darkseagreen];
+ "139803511371488" -> "139803511372192" [color = darkseagreen];
+ "139803511371488" -> "139803507105792" [color = darkseagreen];
+ "139803511371488" -> "139803511373600" [color = darkseagreen];
+ "139803511371488" -> "139803507105968" [color = darkseagreen];
+ "139803511371488" -> "139803749199472" [color = darkseagreen];
+ "139803511371840" [label = "make-mesboot0@3.80", shape = box, fontname = sans];
+ "139803511371840" -> "139803511372192" [color = blue];
+ "139803511371840" -> "139803507105792" [color = blue];
+ "139803511371840" -> "139803511373600" [color = blue];
+ "139803511371840" -> "139803507105968" [color = blue];
+ "139803511371840" -> "139803749199472" [color = blue];
+ "139803511371664" [label = "tcc-boot@0.9.27", shape = box, fontname = sans];
+ "139803511371664" -> "139803511371840" [color = peachpuff4];
+ "139803511371664" -> "139803511372192" [color = peachpuff4];
+ "139803511371664" -> "139803507105792" [color = peachpuff4];
+ "139803511371664" -> "139803511373600" [color = peachpuff4];
+ "139803511371664" -> "139803507105968" [color = peachpuff4];
+ "139803511371664" -> "139803749199472" [color = peachpuff4];
}
--
2.35.1
J
J
Jan Nieuwenhuizen wrote on 13 May 2022 17:39
Re: bug#55227: [PATCH core-updates 0/8] The Full Source Bootstrap
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87h75t30hr.fsf@gnu.org
Ludovic Courtès writes:

Hi,

Toggle quote (15 lines)
> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> Okay. I've kept the mirror:// put in place in the previous patch, it
>> now looks like
>>
>> (uri (list
>> (string-append "mirror://gnu/guix/mirror/"
>> "tcc-" version ".tar.gz")
>> (string-append "https://lilypond.org/janneke/tcc/"
>> "tcc-" version ".tar.gz")))
>
> Source code tarballs (like tcc here) can go to:
>
> https://ftp.gnu.org/gnu/guix/mirror

Okay, I have that for all tarballs right now.

Toggle quote (12 lines)
> For “binary” seeds (which in fact are no longer “binary”!), we can
> follow the scheme at:
>
> https://ftp.gnu.org/gnu/guix/bootstrap/
>
> … which looks like this:
>
> /gnu/guix/bootstrap/SYSTEM/DATE
>
> Or we could use /mirror as well, but then I’m not sure what that
> should look like. WDYT?

Yes, the only thing sort of "binary" is bootstrap-seeds-1.0.tar.gz,
which is not "really" a binary package. The SYSTEM bit is not relevant
and the date is neither.

(I guess that this


could get a follow-up, some time.)

Toggle quote (2 lines)
> See, the most difficult issues are yet to be solved. :-)

I see! Just when I thought the hardest bits were done :-)

Meanwhile,

building /gnu/store/7il52fh6m0pa9lvzqpxkzpq68pb4svcl-gcc-10.3.0.drv...

so I guess we're okay. I'll be waiting for it to finish, though.

Greetings,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 14 May 2022 16:09
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87a6bkgq9u.fsf_-_@gnu.org
Hi!

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (7 lines)
> Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
> On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
> builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
> get_machine, (mescc-tools), and M2-Planet.
>
> * gnu/packages/commencement.scm (stage0-posix): New variable.

[...]

Toggle quote (11 lines)
> + #~(begin
> + (use-modules (guix build utils))
> + (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds"))
> + (source (assoc-ref %build-inputs "source"))
> + (tar (assoc-ref %build-inputs "bootar"))
> + (bash (assoc-ref %build-inputs "bash"))
> + (coreutils (assoc-ref %build-inputs "coreutils"))
> + (guile (assoc-ref %build-inputs "guile"))
> + (out (assoc-ref %outputs "out"))
> + (bindir (string-append out "/bin"))

We could get rid of the remaining (assoc-ref …) expressions, along the
lines of:


But let’s not block the whole series just for that. We can fix it
later.

Thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 14 May 2022 16:10
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
875ym8gq7g.fsf_-_@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

Toggle quote (3 lines)
> +@node Full-source Bootstrap
> +@section The Full-source Bootstrap

Nitpick: I think that would be “Full-Source Bootstrap” in title case. :-)
L
L
Ludovic Courtès wrote on 14 May 2022 16:11
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
871qwwgq4w.fsf_-_@gnu.org
Hi!

So I think this v3 is ready to go in ‘core-updates’, woohoo!

Like I wrote, there are minor cosmetic improvements we could make, but
we can always do that afterwards.

Thank you!

Ludo’.
J
J
Jan Nieuwenhuizen wrote on 14 May 2022 22:36
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87fslbdf72.fsf@gnu.org
Ludovic Courtès writes:

Toggle quote (7 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> +@node Full-source Bootstrap
>> +@section The Full-source Bootstrap
>
> Nitpick: I think that would be “Full-Source Bootstrap” in title case. :-)

Yes, you're right, thanks. Fixed!
J
J
Jan Nieuwenhuizen wrote on 14 May 2022 22:38
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87bkvzdf44.fsf@gnu.org
Ludovic Courtès writes:

Toggle quote (5 lines)
> So I think this v3 is ready to go in ‘core-updates’, woohoo!
>
> Like I wrote, there are minor cosmetic improvements we could make, but
> we can always do that afterwards.

Pushed as 33253b562a73ef008f178b18c3dc10389baa4fc7.

Some improvements to come soon on wip-full-source-bootstrap.

Greetings,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 15 May 2022 08:31
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 55227@debbugs.gnu.org)
87tu9rqpcc.fsf@gnu.org
Ludovic Courtès writes:

Hey

Toggle quote (16 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
>> On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
>> builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
>> get_machine, (mescc-tools), and M2-Planet.
>>
>> * gnu/packages/commencement.scm (stage0-posix): New variable.
>
> [...]
>
> We could get rid of the remaining (assoc-ref …) expressions, along the
> lines of:
>
> https://issues.guix.gnu.org/55227#12-lineno40

Ah yes. I have pushed the patches below to wip-full-source-bootstrap,
WYDT?

Is there a way yet to change things like these:

(native-inputs
`(("bootstrap-seeds" ,bootstrap-seeds)
,@(%boot-gash-inputs)))

I didn't really find an example or way to do this.

Janneke
From 02874b2a43a6255c83d67d40c88742b2a4234c27 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Sat, 14 May 2022 21:27:55 +0200
Subject: [PATCH 1/3] gnu: commencement: bootstrap-seeds: Use new package
style.

* gnu/packages/commencement.scm (bootstrap-seeds)[arguments]: Also use gexps
for inputs and output.
---
gnu/packages/commencement.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 0390c43023..ffaa5f03de 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -289,9 +289,9 @@ (define bootstrap-seeds
#:builder
#~(begin
(use-modules (guix build utils))
- (let ((source (assoc-ref %build-inputs "source"))
- (tar (assoc-ref %build-inputs "bootar"))
- (out (assoc-ref %outputs "out")))
+ (let ((source #$(package-source this-package))
+ (tar #$(this-package-native-input "bootar"))
+ (out #$output))
(setenv "PATH" (string-append tar "/bin:"))
(invoke "tar" "xvf" source)
(mkdir-p out)
--
2.35.1
From f99f4a2257ceaf3b555e284d241d897da43b2868 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Sat, 14 May 2022 21:24:52 +0200
Subject: [PATCH 2/3] gnu: commencement: stage0-posix: Use new package style.

* gnu/packages/commencement.scm (stage0-posix)[arguments]: Also use gexps for
inputs and output.
---
gnu/packages/commencement.scm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ffaa5f03de..0089c2607c 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -365,13 +365,14 @@ (define stage0-posix
#:builder
#~(begin
(use-modules (guix build utils))
- (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds"))
- (source (assoc-ref %build-inputs "source"))
- (tar (assoc-ref %build-inputs "bootar"))
- (bash (assoc-ref %build-inputs "bash"))
- (coreutils (assoc-ref %build-inputs "coreutils"))
- (guile (assoc-ref %build-inputs "guile"))
- (out (assoc-ref %outputs "out"))
+ (let* ((bootstrap-seeds #$(this-package-native-input
+ "bootstrap-seeds"))
+ (source #$(package-source this-package))
+ (tar #$(this-package-native-input "bootar"))
+ (bash #$(this-package-native-input "bash"))
+ (coreutils #$(this-package-native-input "coreutils"))
+ (guile #$(this-package-input "guile"))
+ (out #$output)
(bindir (string-append out "/bin"))
(target (or #$(%current-target-system)
#$(%current-system)))
--
2.35.1
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
M
M
Maxim Cournoyer wrote on 16 May 2022 06:58
Re: [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
87pmkejcpc.fsf@gmail.com
Hi Jan,

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:

Toggle quote (34 lines)
> About a year ago we cheered something like: WE DID IT!!!
>
> Today I am very excited to finally have released GNU Mes 0.24 which supports
> the Full Source Bootstrap. So we did what? As Carl Dong once so eloquently
> put it
>
> The holy grail of bootstrappability will be connecting mes to hex0
>
> which is exactly what this patch series brings.
>
> Starting from an 357-byte hex0 provided by the new bootstrap-seeds package,
> the new stage0-posix package builds hex0, kaem, hex1, catm, hex2, M0, cc_x86,
> M1, M2, get_machine, (mescc-tools), and M2-Planet. The 0.24 release of Mes
> can now be built using this M2-Planet.
>
> This means that the bootstrap binaries that were added as part of the Reduced
> Binary Seed Bootstrap (see
> https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25):
> %bootstrap-mescc-tools, %bootstrap-mes, are now removed again.
>
> Greetings,
> Janneke
>
>
> Jan (janneke) Nieuwenhuizen (8):
> commencement: Add bootstrap-seeds.
> commencement: Add stage0-posix.
> commencement: mes-boot: Update to 0.24, build with M2-Planet.
> commencement: tcc-boot0: Use NYACC-1.00.2.
> commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
> bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
> commencement: Remove %bootstrap-mes-rewired.
> doc: Add the "Full Source Bootstrap".

Woohoo! Thank you for dedicating lots of your energy to this noble
cause! :-) I'll try to enjoy the finer details when I have a chance
but... a blog post could be nice to shine a light on this amazing
achievement!

Thank you, and happy continuation!

Maxim
J
J
Jan Nieuwenhuizen wrote on 16 May 2022 07:17
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 55227@debbugs.gnu.org)
87czgeys36.fsf@gnu.org
Maxim Cournoyer writes:

Hello Maxim,

Toggle quote (3 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:
>
>> About a year ago we cheered something like: WE DID IT!!!
[..]
Toggle quote (14 lines)
>> commencement: Add bootstrap-seeds.
>> commencement: Add stage0-posix.
>> commencement: mes-boot: Update to 0.24, build with M2-Planet.
>> commencement: tcc-boot0: Use NYACC-1.00.2.
>> commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
>> bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
>> commencement: Remove %bootstrap-mes-rewired.
>> doc: Add the "Full Source Bootstrap".
>
> Woohoo! Thank you for dedicating lots of your energy to this noble
> cause! :-) I'll try to enjoy the finer details when I have a chance
> but... a blog post could be nice to shine a light on this amazing
> achievement!

Thanks for your appreciation, that means a lot to me! It's been quite
some work and also a lot of fun, most of the time ;). And it feels very
good when the work is so welcomed. I am grateful for having the
opportunity to work on this, and Guix makes it so easy!

There will definately be a blog-post; I have already started to work on
it. I think it's probably best to time it after core-utils has been
merged into master, when "guix pull; guix system init .." actually
installs a system built from 357 bytes.

Toggle quote (2 lines)
> Thank you, and happy continuation!

Very welcome, thanks,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
M
M
Maxim Cournoyer wrote on 22 May 2022 06:42
Re: [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds.
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 55227@debbugs.gnu.org)
877d6e6uvs.fsf@gmail.com
Hi Jan,

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:

Toggle quote (34 lines)
> * gnu/packages/commencement.scm (bootstrap-seeds): New variable.
> ---
> gnu/packages/commencement.scm | 42 ++++++++++++++++++++++++++++++++++-
> 1 file changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 9d6ed5fd08..663ffacd56 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -5,7 +5,7 @@
> ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
> ;;; Copyright © 2017, 2018, 2019, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
> -;;; Copyright © 2018, 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
> +;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
> ;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
> ;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
> ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
> @@ -266,6 +266,46 @@ (define (%boot-gash-inputs)
> ("bootar" ,bootar)
> ("guile" ,%bootstrap-guile)))
>
> +(define bootstrap-seeds
> + (package
> + (name "bootstrap-seeds")
> + (version "1.0.0")
> + (source
> + (bootstrap-origin
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://lilypond.org/janneke/guix/20220501/"
> + "bootstrap-seeds-" version ".tar.gz"))

It'd be best to put the bootstrap binaries on the GNU FTP; we already
have a directory here: https://ftp.gnu.org/gnu/guix/bootstrap/. I can
assist with that if you need.

Toggle quote (20 lines)
> + (sha256
> + (base32
> + "0scz2bx8fd8c821h6y1j3x6ywgxxns7iinyn9z32dnkiacfdcpfn")))))
> + (native-inputs `(("bootar" ,bootar)))
> + (build-system trivial-build-system)
> + (arguments
> + `(#:guile ,%bootstrap-guile
> + #:modules ((guix build utils))
> + #:builder
> + (begin
> + (use-modules (guix build utils))
> + (let ((source (assoc-ref %build-inputs "source"))
> + (tar (assoc-ref %build-inputs "bootar"))
> + (out (assoc-ref %outputs "out")))
> + (setenv "PATH" (string-append tar "/bin:"))
> + (invoke "tar" "xvf" source)
> + (mkdir-p out)
> + (copy-recursively "bootstrap-seeds" out)
> + #t))))

We no longer need to add #t to build phases, so you can omit it here
too.

Toggle quote (7 lines)
> + (synopsis "The initial bootstrap seeds: 357-byte hex0 and kaem shell")
> + (description
> + "A prebuilt version of the initial bootstrap seeds. It contains a
> +hex0-seed and an optional kaem-minimal shell. The size of the hex0 seeds are
> +for knight: 250 bytes, x86-linux:(357 bytes, x86_64-linux: 431 bytes, and

What does "for knight" mean here? Is there an architecture called
"knight"? You could use a @table here with the arch as first column and
size as second column.

Hope that helps,

Maxim
J
J
Jan Nieuwenhuizen wrote on 22 May 2022 08:05
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 55227@debbugs.gnu.org)
87k0ae6r1b.fsf@gnu.org
Maxim Cournoyer writes:

Hi Maxim!

Toggle quote (3 lines)
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:
>
>> * gnu/packages/commencement.scm (bootstrap-seeds): New variable.
]..]
Toggle quote (16 lines)
>> +(define bootstrap-seeds
>> + (package
>> + (name "bootstrap-seeds")
>> + (version "1.0.0")
>> + (source
>> + (bootstrap-origin
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "https://lilypond.org/janneke/guix/20220501/"
>> + "bootstrap-seeds-" version ".tar.gz"))
>
> It'd be best to put the bootstrap binaries on the GNU FTP; we already
> have a directory here: https://ftp.gnu.org/gnu/guix/bootstrap/. I can
> assist with that if you need.

Thanks. Ludo already made that remark

and it has been changed in the v3 patch series


which has already been installed in core-updates. The only puzzle that
remains is the coding of some of the native-inputs.

Toggle quote (15 lines)
>> + #:builder
>> + (begin
>> + (use-modules (guix build utils))
>> + (let ((source (assoc-ref %build-inputs "source"))
>> + (tar (assoc-ref %build-inputs "bootar"))
>> + (out (assoc-ref %outputs "out")))
>> + (setenv "PATH" (string-append tar "/bin:"))
>> + (invoke "tar" "xvf" source)
>> + (mkdir-p out)
>> + (copy-recursively "bootstrap-seeds" out)
>> + #t))))
>
> We no longer need to add #t to build phases, so you can omit it here
> too.

Right, same remark.

Toggle quote (6 lines)
>> +hex0-seed and an optional kaem-minimal shell. The size of the hex0 seeds are
>> +for knight: 250 bytes, x86-linux:(357 bytes, x86_64-linux: 431 bytes, and
>
> What does "for knight" mean here? Is there an architecture called
> "knight"?

Yes, it's a simple/ancient machine from the 70s (?) I belief, and having
a working VM for Knight is/was one of the goals of the Stage0 project
(to eleminate the dependency on a kernel like Linux).

Toggle quote (4 lines)
> You could use a @table here with the arch as first column and
> size as second column.
> Hope that helps,

Thanks, I'll consider that.
Greetings,
Janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 18 Aug 2023 16:04
control message for bug #55227
(address . control@debbugs.gnu.org)
87y1i8qwf2.fsf@gnu.org
close 55227
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 55227@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 55227
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch