all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
@ 2022-05-02 18:21 Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                   ` (8 more replies)
  0 siblings, 9 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:21 UTC (permalink / raw)
  To: 55227

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".

 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





^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds.
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24 ` Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
                     ` (8 more replies)
  2022-05-12 11:09 ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
                   ` (7 subsequent siblings)
  8 siblings, 9 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

* 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"))
+        (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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-09  3:49     ` Thiago Jung Bauermann via Guix-patches via
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
                     ` (7 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

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)
+                         (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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-12 10:46     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2 Jan (janneke) Nieuwenhuizen
                     ` (6 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-12 10:47     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
                     ` (5 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (2 preceding siblings ...)
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2 Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
                     ` (4 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (3 preceding siblings ...)
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
                     ` (3 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

* gnu/packages/bootstrap.scm (%bootstrap-inputs): Remove
%bootstrap-mescc-tools, %bootstrap-mes.
---
 gnu/packages/bootstrap.scm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (4 preceding siblings ...)
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap" Jan (janneke) Nieuwenhuizen
                     ` (2 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

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

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap".
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (5 preceding siblings ...)
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
@ 2022-05-02 18:24   ` Jan (janneke) Nieuwenhuizen
  2022-05-12 11:03     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-12 10:38   ` Ludovic Courtès
  2022-05-22  4:42   ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Maxim Cournoyer
  8 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-02 18:24 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix.
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
@ 2022-05-09  3:49     ` Thiago Jung Bauermann via Guix-patches via
  2022-05-09  8:14       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 47+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2022-05-09  3:49 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227


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:

> 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?

> +                         (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.

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

-- 
Thanks
Thiago




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix.
  2022-05-09  3:49     ` Thiago Jung Bauermann via Guix-patches via
@ 2022-05-09  8:14       ` Jan Nieuwenhuizen
  2022-05-12 10:45         ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  0 siblings, 1 reply; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-09  8:14 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: 55227

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

Thiago Jung Bauermann writes:

Hello Thiago,

> This is great work!

Thanks!

> 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
[..]
>> +                  (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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0002-commencement-Add-stage0-posix.patch --]
[-- Type: text/x-patch, Size: 6089 bytes --]

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.
---
 gnu/packages/commencement.scm | 110 ++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 663ffacd56..7cb972f3bd 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -306,6 +306,116 @@ (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")))))
+      (supported-systems '("i686-linux" "x86_64-linux"
+                           "arm-linux" "aarch64-linux"
+                           "riscv64-linux"))
+      (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 ,(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 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


[-- Attachment #3: Type: text/plain, Size: 156 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com | Avatar® https://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (6 preceding siblings ...)
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap" Jan (janneke) Nieuwenhuizen
@ 2022-05-12 10:38   ` Ludovic Courtès
  2022-05-13  8:08     ` Jan Nieuwenhuizen
  2022-05-22  4:42   ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Maxim Cournoyer
  8 siblings, 1 reply; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:38 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

Hi!

Starting a dive through this amazing patch series…

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

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

[...]

> +    (source
> +     (bootstrap-origin

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

> +      (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.

> +    (native-inputs `(("bootar" ,bootar)))

-> (list boottar)

> +    (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))
                …))))

> +           (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.

> +    (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.

Ludo’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-09  8:14       ` Jan Nieuwenhuizen
@ 2022-05-12 10:45         ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:45 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 55227, Thiago Jung Bauermann

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

>>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.

[...]

> +      (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.

> +      (supported-systems '("i686-linux" "x86_64-linux"
> +                           "arm-linux" "aarch64-linux"
> +                           "riscv64-linux"))

Woow.  :-)

s/arm-linux/armhf-linux/

> +      (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 …))

> +      (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’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
@ 2022-05-12 10:46     ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:46 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

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

> * 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.

[...]

> +    (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!




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2 Jan (janneke) Nieuwenhuizen
@ 2022-05-12 10:47     ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:47 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

"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/"
> +                     "/tcc-" version ".tar.gz"))
> +               (sha256
> +                (base32
> +                 "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng")))))

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

Otherwise LGTM.

>      (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’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
@ 2022-05-12 10:50     ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:50 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

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

> * 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.

[...]

>  (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.  :-)

>      (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!




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
@ 2022-05-12 10:50     ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:50 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

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

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

OK!




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
@ 2022-05-12 10:50     ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 10:50 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

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

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

Yay!




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap" Jan (janneke) Nieuwenhuizen
@ 2022-05-12 11:03     ` Ludovic Courtès
  0 siblings, 0 replies; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 11:03 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

"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!


[...]

> -Copyright @copyright{} 2016, 2017, 2018, 2019, 2020 Jan Nieuwenhuizen@*
> +Copyright @copyright{} 2016, 2017, 2018, 2019, 2021 Jan Nieuwenhuizen@*

2022 even.  :-)

>  For @code{i686-linux} and @code{x86_64-linux}, Guix now features a

[...]

> +``Full Source'' bootstrap.  This bootstrap is rooted in @file{hex0-seed}

Maybe: @dfn{full-source bootstrap}.

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

> +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/

> -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’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
@ 2022-05-12 11:09 ` Ludovic Courtès
  2022-05-13  8:07   ` Jan Nieuwenhuizen
  2022-05-13  8:09 ` Jan Nieuwenhuizen
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-12 11:09 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

Hello!

"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!

> 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!)

>   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/*.

>  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’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-12 11:09 ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
@ 2022-05-13  8:07   ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:07 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

Hello!

> "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!

>> 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!

> 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...

> (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

> 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).

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

Done.

>>  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...

> 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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-12 10:38   ` Ludovic Courtès
@ 2022-05-13  8:08     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

Hi!

> Starting a dive through this amazing patch series…

Yay, and thanks again for your careful review.

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

Ah, right.  Removed.

>> +      (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
              "https://lilypond.org/janneke/guix/20220501/"
              "bootstrap-seeds-" version ".tar.gz")))

>> +    (native-inputs `(("bootar" ,bootar)))
>
> -> (list boottar)

Ok.

>> +    (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.

>> +           #t))))
>
> You can remove the trailing #t.

Ok.

>> +    (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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
  2022-05-12 11:09 ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
@ 2022-05-13  8:09 ` Jan Nieuwenhuizen
  2022-05-13  8:09 ` Jan Nieuwenhuizen
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227, Thiago Jung Bauermann

Ludovic Courtès writes:

Hi,

> 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
                "https://lilypond.org/janneke/guix/20220502/"
                "stage0-posix-" version ".tar.gz")))
>
>> +      (supported-systems '("i686-linux" "x86_64-linux"
>> +                           "arm-linux" "aarch64-linux"
>> +                           "riscv64-linux"))
>
> Woow.  :-)

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

> s/arm-linux/armhf-linux/

Oops.

>> +      (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.

> 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.

>> +      (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."

> (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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
                   ` (2 preceding siblings ...)
  2022-05-13  8:09 ` Jan Nieuwenhuizen
@ 2022-05-13  8:09 ` Jan Nieuwenhuizen
  2022-05-13  8:09 ` Jan Nieuwenhuizen
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

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

Ok.

> Otherwise LGTM!

Yay! :)

-- 
Jan Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
                   ` (3 preceding siblings ...)
  2022-05-13  8:09 ` Jan Nieuwenhuizen
@ 2022-05-13  8:09 ` Jan Nieuwenhuizen
  2022-05-13  8:09 ` Jan Nieuwenhuizen
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

Hi,

> "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.

>>      (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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
                   ` (4 preceding siblings ...)
  2022-05-13  8:09 ` Jan Nieuwenhuizen
@ 2022-05-13  8:09 ` Jan Nieuwenhuizen
  2022-05-13 13:56   ` Ludovic Courtès
  2022-05-13  8:10 ` Jan Nieuwenhuizen
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

Hi,

> "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...

>>      (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")
                    (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.

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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
                   ` (5 preceding siblings ...)
  2022-05-13  8:09 ` Jan Nieuwenhuizen
@ 2022-05-13  8:10 ` Jan Nieuwenhuizen
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
  2022-05-16  4:58 ` Maxim Cournoyer
  8 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13  8:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

Hi,

> "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.

>> -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!

>> +``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.

>> +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.

> s/self hosting/self-hosting/

Ok.

>> -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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-13  8:09 ` Jan Nieuwenhuizen
@ 2022-05-13 13:56   ` Ludovic Courtès
  2022-05-13 15:39     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-13 13:56 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 55227

Hullo!

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")))
>
> 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:

  https://ftp.gnu.org/gnu/guix/mirror

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?

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

Ludo’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds.
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
                   ` (6 preceding siblings ...)
  2022-05-13  8:10 ` Jan Nieuwenhuizen
@ 2022-05-13 15:36 ` Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
                     ` (7 more replies)
  2022-05-16  4:58 ` Maxim Cournoyer
  8 siblings, 8 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

* 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..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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix.
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-14 14:09     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 3/8] gnu: commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

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(+)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 3/8] gnu: commencement: mes-boot: Update to 0.24, build with M2-Planet.
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 4/8] gnu: commencement: tcc-boot0: Use nyacc-1.00.2 Jan (janneke) Nieuwenhuizen
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 4/8] gnu: commencement: tcc-boot0: Use nyacc-1.00.2.
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 3/8] gnu: commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 5/8] gnu: commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 5/8] gnu: commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd.
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (2 preceding siblings ...)
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 4/8] gnu: commencement: tcc-boot0: Use nyacc-1.00.2 Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 6/8] gnu: bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 6/8] gnu: bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes.
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (3 preceding siblings ...)
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 5/8] gnu: commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 7/8] gnu: commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

* gnu/packages/bootstrap.scm (%bootstrap-inputs): Remove
%bootstrap-mescc-tools, %bootstrap-mes.
---
 gnu/packages/bootstrap.scm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 7/8] gnu: commencement: Remove %bootstrap-mes-rewired.
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (4 preceding siblings ...)
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 6/8] gnu: bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap" Jan (janneke) Nieuwenhuizen
  2022-05-14 14:11   ` Ludovic Courtès
  7 siblings, 0 replies; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

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

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap".
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (5 preceding siblings ...)
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 7/8] gnu: commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
@ 2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen
  2022-05-14 14:10     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
  2022-05-14 14:11   ` Ludovic Courtès
  7 siblings, 1 reply; 47+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2022-05-13 15:36 UTC (permalink / raw)
  To: 55227

* 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(-)

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





^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-13 13:56   ` Ludovic Courtès
@ 2022-05-13 15:39     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-13 15:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

Hi,

> 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.

> 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

    https://savannah.nongnu.org/task/?func=detailitem&item_id=15859#options

could get a follow-up, some time.)

> 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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
@ 2022-05-14 14:09     ` Ludovic Courtès
  2022-05-15  6:31       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-14 14:09 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

Hi!

"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.

[...]

> +        #~(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:

  https://issues.guix.gnu.org/55227#12-lineno40

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

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap" Jan (janneke) Nieuwenhuizen
@ 2022-05-14 14:10     ` Ludovic Courtès
  2022-05-14 20:36       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-14 14:10 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

"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.  :-)




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (6 preceding siblings ...)
  2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap" Jan (janneke) Nieuwenhuizen
@ 2022-05-14 14:11   ` Ludovic Courtès
  2022-05-14 20:38     ` Jan Nieuwenhuizen
  7 siblings, 1 reply; 47+ messages in thread
From: Ludovic Courtès @ 2022-05-14 14:11 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

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’.




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-14 14:10     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
@ 2022-05-14 20:36       ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-14 20:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

> "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!




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-14 14:11   ` Ludovic Courtès
@ 2022-05-14 20:38     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-14 20:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

Ludovic Courtès writes:

> 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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-14 14:09     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
@ 2022-05-15  6:31       ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-15  6:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55227

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]

Ludovic Courtès writes:

Hey

> "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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-commencement-bootstrap-seeds-Use-new-package-sty.patch --]
[-- Type: text/x-patch, Size: 1265 bytes --]

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(-)

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-commencement-stage0-posix-Use-new-package-style.patch --]
[-- Type: text/x-patch, Size: 1870 bytes --]

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(-)

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-commencement-mes-boot-Use-new-package-style.patch --]
[-- Type: text/x-patch, Size: 5815 bytes --]

From 89a8bd925774911f225713de6bf2e4c94319b640 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Sat, 14 May 2022 21:39:06 +0200
Subject: [PATCH 3/3] gnu: commencement: mes-boot: Use new package style.

* gnu/packages/commencement.scm (mes-boot)[arguments]: Use gexp for modify
phases.
---
 gnu/packages/commencement.scm | 98 +++++++++++++++++------------------
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 0089c2607c..268dfe9795 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -445,55 +445,55 @@ (define mes-boot
                                  (snippet #f))))
        ,@(%boot-gash-inputs)))
     (arguments
-     `(#:implicit-inputs? #f
-       #:tests? #f
-       #:guile ,%bootstrap-guile
-       #:strip-binaries? #f             ;no strip yet
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'unpack-seeds
-           (lambda _
-             (let ((nyacc-source (assoc-ref %build-inputs "nyacc-source")))
-               (with-directory-excursion ".."
-                 (invoke "tar" "-xvf" nyacc-source)))))
-         (replace 'configure
-           (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 "GUILE_LOAD_PATH" (string-append
-                                          dir "/nyacc-1.00.2/module"))
-               (invoke "gash" "configure.sh"
-                       (string-append "--prefix=" out)
-                       "--host=i686-linux-gnu"))))
-         (replace 'build
-           (lambda _
-             (invoke "gash" "bootstrap.sh")))
-         (delete 'check)
-         (replace 'install
-           (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 "gash" "install.sh")
-             ;; Keep ASCII output, for friendlier comparison and bisection
-             (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? ".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 "m2")
-                                 (objects-in-dir ".")
-                                 (objects-in-dir "mescc-lib")))))))))
+     (list
+      #:implicit-inputs? #f
+      #:tests? #f
+      #:guile %bootstrap-guile
+      #:strip-binaries? #f              ;no strip yet
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'unpack-seeds
+            (lambda _
+              (let ((nyacc-source #$(this-package-native-input "nyacc-source")))
+                (with-directory-excursion ".."
+                  (invoke "tar" "-xvf" nyacc-source)))))
+          (replace 'configure
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let ((out #$output)
+                    (gash #$(this-package-native-input "bash"))
+                    (dir (with-directory-excursion ".." (getcwd))))
+                (setenv "GUILE_LOAD_PATH" (string-append
+                                           dir "/nyacc-1.00.2/module"))
+                (invoke "gash" "configure.sh"
+                        (string-append "--prefix=" out)
+                        "--host=i686-linux-gnu"))))
+          (replace 'build
+            (lambda _
+              (invoke "gash" "bootstrap.sh")))
+          (delete 'check)
+          (replace 'install
+            (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 "gash" "install.sh")
+              ;; Keep ASCII output, for friendlier comparison and bisection
+              (let* ((out #$output)
+                     (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? ".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 "m2")
+                                  (objects-in-dir ".")
+                                  (objects-in-dir "mescc-lib")))))))))
     (native-search-paths
      (list (search-path-specification
             (variable "C_INCLUDE_PATH")
-- 
2.35.1


[-- Attachment #5: Type: text/plain, Size: 156 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://lilypond.org
Freelance IT https://JoyOfSource.com | Avatar® https://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
                   ` (7 preceding siblings ...)
  2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
@ 2022-05-16  4:58 ` Maxim Cournoyer
  2022-05-16  5:17   ` Jan Nieuwenhuizen
  8 siblings, 1 reply; 47+ messages in thread
From: Maxim Cournoyer @ 2022-05-16  4:58 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

Hi Jan,

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

> 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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap
  2022-05-16  4:58 ` Maxim Cournoyer
@ 2022-05-16  5:17   ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-16  5:17 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 55227

Maxim Cournoyer writes:

Hello Maxim,

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:
>
>> About a year ago we cheered something like:  WE DID IT!!!
[..]
>>   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.

> 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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds.
  2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
                     ` (7 preceding siblings ...)
  2022-05-12 10:38   ` Ludovic Courtès
@ 2022-05-22  4:42   ` Maxim Cournoyer
  2022-05-22  6:05     ` Jan Nieuwenhuizen
  8 siblings, 1 reply; 47+ messages in thread
From: Maxim Cournoyer @ 2022-05-22  4:42 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 55227

Hi Jan,

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

> * 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.

> +        (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.

> +    (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

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




^ permalink raw reply	[flat|nested] 47+ messages in thread

* [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds.
  2022-05-22  4:42   ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Maxim Cournoyer
@ 2022-05-22  6:05     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 47+ messages in thread
From: Jan Nieuwenhuizen @ 2022-05-22  6:05 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 55227

Maxim Cournoyer writes:

Hi Maxim!

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> writes:
>
>> * gnu/packages/commencement.scm (bootstrap-seeds): New variable.
]..]
>> +(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
    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55227#46

and it has been changed in the v3 patch series

    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55227#97

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

>> +       #: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.

>> +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).

> 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




^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2022-05-22  6:06 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
2022-05-09  3:49     ` Thiago Jung Bauermann via Guix-patches via
2022-05-09  8:14       ` Jan Nieuwenhuizen
2022-05-12 10:45         ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
2022-05-12 10:46     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2 Jan (janneke) Nieuwenhuizen
2022-05-12 10:47     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap" Jan (janneke) Nieuwenhuizen
2022-05-12 11:03     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-12 10:38   ` Ludovic Courtès
2022-05-13  8:08     ` Jan Nieuwenhuizen
2022-05-22  4:42   ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Maxim Cournoyer
2022-05-22  6:05     ` Jan Nieuwenhuizen
2022-05-12 11:09 ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-13  8:07   ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13 13:56   ` Ludovic Courtès
2022-05-13 15:39     ` Jan Nieuwenhuizen
2022-05-13  8:10 ` Jan Nieuwenhuizen
2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
2022-05-14 14:09     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-15  6:31       ` Jan Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 3/8] gnu: commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 4/8] gnu: commencement: tcc-boot0: Use nyacc-1.00.2 Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 5/8] gnu: commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 6/8] gnu: bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 7/8] gnu: commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap" Jan (janneke) Nieuwenhuizen
2022-05-14 14:10     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-14 20:36       ` Jan Nieuwenhuizen
2022-05-14 14:11   ` Ludovic Courtès
2022-05-14 20:38     ` Jan Nieuwenhuizen
2022-05-16  4:58 ` Maxim Cournoyer
2022-05-16  5:17   ` Jan Nieuwenhuizen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.