GNU bug report logs - #38063
[PATCH 0/2] gnu: Add m2-planet-boot0.

Previous Next

Package: guix-patches;

Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>

Date: Mon, 4 Nov 2019 22:40:02 UTC

Severity: normal

Tags: patch

Done: Jan Nieuwenhuizen <janneke <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38063 in the body.
You can then email your comments to 38063 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#38063; Package guix-patches. (Mon, 04 Nov 2019 22:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 04 Nov 2019 22:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Jeremiah Orians <jeremiah <at> pdp10.guru>
Subject: [PATCH 0/2] gnu: Add m2-planet-boot0.
Date: Mon, 04 Nov 2019 23:39:06 +0100
Hi!

Following this great news by Jeremiah Orians today

    https://lists.reproducible-builds.org/pipermail/rb-general/2019-November/001711.html

I decided to create a first bootstrap package for M2-Planet.  For now
this is mostly "Just for Fun".

The gap to building the next package of the bootstrap: `mes-boot' has
not been bridged yet, although GNU Mes is also close to being
bootstrappable with M2-Planet.

Note that disregarding the build tools (bootstrap-guile,
bootstrap-coreutils&co), this package builds M2-Planet using only a ~500
byte binary seed!

Many thanks to Jeremiah!

Enjoy and Greetings,
janneke

Jan Nieuwenhuizen (2):
  gnu: Add m2-planet.
  bootstrap: Add m2-planet-boot0.

 gnu/packages/commencement.scm | 103 +++++++++++++++++++++++++++++++++-
 gnu/packages/mes.scm          |  32 +++++++++++
 2 files changed, 134 insertions(+), 1 deletion(-)

-- 
2.23.0

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Information forwarded to guix-patches <at> gnu.org:
bug#38063; Package guix-patches. (Mon, 04 Nov 2019 22:43:07 GMT) Full text and rfc822 format available.

Message #8 received at 38063 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: 38063 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add m2-planet.
Date: Mon,  4 Nov 2019 23:42:42 +0100
* gnu/packages/mes.scm (m2-planet): New variable.
---
 gnu/packages/mes.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 3174c0c115..55d731d876 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -204,3 +204,35 @@ get_machine.")
        ((#:make-flags _)
         `(list (string-append "PREFIX=" (assoc-ref %outputs "out"))
                "CC=gcc"))))))
+
+(define-public m2-planet
+  (let ((commit "1fc2aeab483208bd2ba117b21df3894c182470ec")
+        (revision "0"))
+    (package
+      (name "m2-planet")
+      (version (string-append "1.4.0-" revision "." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/oriansj/m2-planet.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1fj3xiqcibdfi78b43nn6w8hs3vkz32yb06n8r5mna8pnjdmn00l"))))
+      (native-inputs
+       `(("mescc-tools" ,mescc-tools)))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+         #:tests? #f
+         #:phases (modify-phases %standard-phases
+                    (delete 'bootstrap)
+                    (delete 'configure))))
+      (synopsis "The PLAtform NEutral Transpiler")
+      (description
+       "M2-Planet, The PLAtform NEutral Transpiler, when combined with
+mescc-tools compiles a subset of the C language into working binaries
+with introspective steps inbetween.")
+      (home-page "https://github.com/oriansj/m2-planet")
+      (license gpl3+))))
-- 
2.23.0





Information forwarded to guix-patches <at> gnu.org:
bug#38063; Package guix-patches. (Mon, 04 Nov 2019 22:43:08 GMT) Full text and rfc822 format available.

Message #11 received at 38063 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: 38063 <at> debbugs.gnu.org
Subject: [PATCH 2/2] bootstrap: Add m2-planet-boot0.
Date: Mon,  4 Nov 2019 23:42:43 +0100
* gnu/packages/commencement.scm (m2-planet-boot0): New variable.
---
 gnu/packages/commencement.scm | 103 +++++++++++++++++++++++++++++++++-
 1 file changed, 102 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 54746151ce..31722b4cf3 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
-;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
+;;; Copyright © 2018, 2019 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2019 Marius Bakke <mbakke <at> fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -84,6 +84,107 @@
 ;;;
 ;;; Code:
 
+(define-public m2-planet-boot0
+  ;; The soon-to-be initial bootstrap package: no binary inputs except for a
+  ;; ~500 byte binary seed: `x86/hex0-seed'.
+  (let* ((version "1.4.0")
+         (revision "0")
+         (commit "1fc2aeab483208bd2ba117b21df3894c182470ec")
+         (seed-version "Release_1.1")
+         (mescc-tools-version "Release_0.6.1")
+         (mes-m2-commit "f025a24b19e8447fb96ba1746bdad494ae63a514")
+         (mes-m2-version (string-append "0.19-" (string-take mes-m2-commit 7))))
+    (package
+      (inherit m2-planet)
+      (name "m2-planet-boot0")
+      (version (string-append version "-" revision "." (string-take commit 7)))
+      (source (origin
+                (method url-fetch)
+                (uri (string-append
+                      "https://github.com/oriansj/m2-planet"
+                      "/archive/" commit ".tar.gz"))
+                (file-name (string-append "mescc-tools-seed-" version ".tar.gz"))
+                (sha256
+                 (base32
+                  "09dfbhrkfq754lkk9qqsa95rgfp5crdwy8l4db97qwfclr0y914z"))))
+      (inputs `(("mescc-tools-seed"
+                 ,(bootstrap-origin
+                   (origin
+                     (method url-fetch)
+                     (uri (string-append
+                           "https://github.com/oriansj/mescc-tools-seed"
+                           "/archive/" seed-version ".tar.gz"))
+                     (file-name (string-append "mescc-tools-seed-" seed-version
+                                               ".tar.gz"))
+                     (sha256
+                      (base32
+                       "1ymkaanx3b9x8y3n4x0kpqxyjcql3gpv37hp1cbzvhwh89yqy6m4")))))
+                ("mescc-tools-source"
+                 ,(bootstrap-origin
+                   (origin
+                     (method url-fetch)
+                     (uri (string-append
+                           "https://github.com/oriansj/mescc-tools"
+                           "/archive/" mescc-tools-version ".tar.gz"))
+                     (file-name (string-append "mescc-tools-"
+                                               mescc-tools-version
+                                               ".tar.gz"))
+                     (sha256
+                      (base32
+                       "06jpvq6xfjzn2al6b4rdwd3zv3h4cvilc4n9gqcnjr9cr6wjpw2n")))))
+                ("mes-m2-source"
+                 ,(bootstrap-origin
+                   (origin
+                     (method url-fetch)
+                     (uri (string-append
+                           "https://github.com/oriansj/mes-m2"
+                           "/archive/" mes-m2-commit ".tar.gz"))
+                     (file-name (string-append "mes-m2-"
+                                               mes-m2-version
+                                               ".tar.gz"))
+                     (sha256
+                      (base32
+                       "092ydx21cms8rkgx5dfndxi4hrw9jqw9r266h4rsvycpv2lw6kp1")))))))
+      (native-inputs
+       `(("coreutils" , %bootstrap-coreutils&co)
+         ("guile" , %bootstrap-guile)))
+      (supported-systems '("i686-linux" "x86_64-linux"))
+      (build-system trivial-build-system)
+      (arguments
+       `(#:guile ,%bootstrap-guile
+         #:modules ((guix build utils))
+         #:builder (begin
+                     (use-modules (guix build utils))
+                     (let* ((mescc-tools-seed (assoc-ref %build-inputs "mescc-tools-seed"))
+                            (mescc-tools-source (assoc-ref %build-inputs "mescc-tools-source"))
+                            (mes-m2-source (assoc-ref %build-inputs "mes-m2-source"))
+                            (source (assoc-ref %build-inputs "source"))
+                            (dir (string-append "mescc-tools-seed-" ,seed-version))
+                            (coreutils (assoc-ref %build-inputs "coreutils"))
+                            (guile     (assoc-ref %build-inputs "guile"))
+                            (out       (assoc-ref %outputs "out"))
+                            (bindir    (string-append out "/bin")))
+                       (setenv "PATH" (string-append coreutils "/bin"))
+                       (invoke "tar" "--strip-components=1" "-xvf" mescc-tools-seed)
+                       (invoke "tar" "--strip-components=1" "-C" "mescc-tools" "-xvf" mescc-tools-source)
+                       (invoke "tar" "--strip-components=1" "-C" "M2-Planet" "-xvf" source)
+                       (invoke "tar" "--strip-components=1" "-C" "mes-m2" "-xvf" mes-m2-source)
+                       (mkdir-p bindir)
+                       (with-directory-excursion "x86"
+                         (invoke "../kaem-optional-seed" "--verbose" "--strict"))
+                       (with-directory-excursion "bin"
+                         (copy-file "mes-m2" "mes")
+                         (install-file "hex2" bindir)
+                         (install-file "M1" bindir)
+                         (install-file "blood-elf" bindir)
+                         (install-file "kaem" bindir)
+                         (install-file "get_machine" bindir)
+                         (install-file "get_machine" bindir)
+                         (install-file "M2-Planet" bindir)
+                         (install-file "mes" bindir)
+                         (install-file "mes-m2" bindir))
+                       #t)))))))
+
 (define mes-boot
   (package
     (inherit mes)
-- 
2.23.0





Information forwarded to guix-patches <at> gnu.org:
bug#38063; Package guix-patches. (Wed, 13 Nov 2019 22:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 38063 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 38063 <at> debbugs.gnu.org
Subject: Re: [bug#38063] [PATCH 1/2] gnu: Add m2-planet.
Date: Wed, 13 Nov 2019 23:22:00 +0100
Hello,

Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:

> * gnu/packages/mes.scm (m2-planet): New variable.

[...]

> +      (synopsis "The PLAtform NEutral Transpiler")
> +      (description
> +       "M2-Planet, The PLAtform NEutral Transpiler, when combined with
> +mescc-tools compiles a subset of the C language into working binaries
> +with introspective steps inbetween.")

It would be awesome if you could add one or two sentences here.

Regardless it LGTM!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#38063; Package guix-patches. (Wed, 13 Nov 2019 22:27:01 GMT) Full text and rfc822 format available.

Message #17 received at 38063 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 38063 <at> debbugs.gnu.org
Subject: Re: [bug#38063] [PATCH 2/2] bootstrap: Add m2-planet-boot0.
Date: Wed, 13 Nov 2019 23:26:12 +0100
Hi,

Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:

> * gnu/packages/commencement.scm (m2-planet-boot0): New variable.

Since this is currently unused, should we postpone and review it as part
of a bigger change that will actually use it?  What do you prefer?

> +(define-public m2-planet-boot0
> +  ;; The soon-to-be initial bootstrap package: no binary inputs except for a
> +  ;; ~500 byte binary seed: `x86/hex0-seed'.
> +  (let* ((version "1.4.0")
> +         (revision "0")
> +         (commit "1fc2aeab483208bd2ba117b21df3894c182470ec")
> +         (seed-version "Release_1.1")
> +         (mescc-tools-version "Release_0.6.1")
> +         (mes-m2-commit "f025a24b19e8447fb96ba1746bdad494ae63a514")
> +         (mes-m2-version (string-append "0.19-" (string-take mes-m2-commit 7))))

This is a bit intimidating.  ;-)  It would be great if we could refer to
releases only, and perhaps we don’t need to have all these in this
‘define’?

> +                (method url-fetch)
> +                (uri (string-append
> +                      "https://github.com/oriansj/m2-planet"
> +                      "/archive/" commit ".tar.gz"))

Unless I’m mistaken, /archive tarballs are automatically generated and
should thus be avoided.

However, using ‘git-fetch’ here is not quite feasible because it could
lead to bootstrapping problems (“soft” bootstrapping problems, because
these are fixed-output derivations, but still.)

Thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#38063; Package guix-patches. (Thu, 14 Nov 2019 05:57:01 GMT) Full text and rfc822 format available.

Message #20 received at 38063 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 38063 <at> debbugs.gnu.org
Subject: Re: [bug#38063] [PATCH 2/2] bootstrap: Add m2-planet-boot0.
Date: Thu, 14 Nov 2019 06:56:16 +0100
Ludovic Courtès writes:

Hello Ludo',

> Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:
>> * gnu/packages/commencement.scm (m2-planet-boot0): New variable.
>
> Since this is currently unused, should we postpone and review it as part
> of a bigger change that will actually use it?  What do you prefer?

Yes, I think that's wise.  I was so excited that I wanted to share this
recipe.  The releases that we need for a proper packaging will take some
serious time and effort.

>> +(define-public m2-planet-boot0
>> +  ;; The soon-to-be initial bootstrap package: no binary inputs except for a
>> +  ;; ~500 byte binary seed: `x86/hex0-seed'.
>> +  (let* ((version "1.4.0")
>> +         (revision "0")
>> +         (commit "1fc2aeab483208bd2ba117b21df3894c182470ec")
>> +         (seed-version "Release_1.1")
>> +         (mescc-tools-version "Release_0.6.1")
>> +         (mes-m2-commit "f025a24b19e8447fb96ba1746bdad494ae63a514")
>> +         (mes-m2-version (string-append "0.19-" (string-take mes-m2-commit 7))))
>
> This is a bit intimidating.  ;-)  It would be great if we could refer to
> releases only, and perhaps we don’t need to have all these in this
> ‘define’?

Sure!  I am hoping to drop mes-m2 here and use tarballs; even if we have
to hand-craft them and host them ourselves.

>> +                (method url-fetch)
>> +                (uri (string-append
>> +                      "https://github.com/oriansj/m2-planet"
>> +                      "/archive/" commit ".tar.gz"))
>
> Unless I’m mistaken, /archive tarballs are automatically generated and
> should thus be avoided.
>
> However, using ‘git-fetch’ here is not quite feasible because it could
> lead to bootstrapping problems (“soft” bootstrapping problems, because
> these are fixed-output derivations, but still.)

Yes...

I will close this issue after giving the plain m2-planet a proper
description.

Thanks for looking a it ;-)
Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Reply sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
You have taken responsibility. (Thu, 14 Nov 2019 15:49:01 GMT) Full text and rfc822 format available.

Notification sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
bug acknowledged by developer. (Thu, 14 Nov 2019 15:49:02 GMT) Full text and rfc822 format available.

Message #25 received at 38063-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 38063-done <at> debbugs.gnu.org
Subject: Re: [bug#38063] [PATCH 1/2] gnu: Add m2-planet.
Date: Thu, 14 Nov 2019 16:48:38 +0100
Ludovic Courtès writes:

>> +      (description
>> +       "M2-Planet, The PLAtform NEutral Transpiler, when combined with
>> +mescc-tools compiles a subset of the C language into working binaries
>> +with introspective steps inbetween.")
>
> It would be awesome if you could add one or two sentences here.

I added two sentences:

      (description
       "M2-Planet, the PLAtform NEutral Transpiler, when combined with
mescc-tools, compiles a subset of the C language into working binaries with
introspective steps inbetween.  It is self-hosting and for bootstrapping it
also has an implementation in the M1 macro assembly language.  M2-Planet is
built as Phase-5 of the full source bootstrapping process and is capable of
building GNU Mes.")

> Regardless it LGTM!

Closed and pushed to master as 99b340f5eeb742d966dd16b1bfd7d2b308edc75f

Thanks,
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Dec 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.