guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/15: bootstrap: mes-boot: Scheme-only bootstrap. WIP


From: guix-commits
Subject: 11/15: bootstrap: mes-boot: Scheme-only bootstrap. WIP
Date: Wed, 5 Dec 2018 16:57:54 -0500 (EST)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit 1fddb713e7c5cee0582218299946a2e6e8b8cf43
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Tue Dec 4 23:17:49 2018 +0100

    bootstrap: mes-boot: Scheme-only bootstrap.  WIP
---
 gnu/packages/commencement.scm | 168 +++++++++++++++++++++---------------------
 1 file changed, 85 insertions(+), 83 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index aaade21..580d957 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -85,49 +85,33 @@
                               ; for speed-up?
 
 (define mes-boot0
-  (let ((version "0.19")
-        (revision "0")
-        (commit #f))
-    (package
-      (inherit mes)
-      (name "mes-boot0")
-      (version (if commit (string-append version "-" revision "." (string-take 
commit 7))
-                   (package-version mes)))
-      (source (if commit
-                  (origin
-                    (method url-fetch)
-                    (uri (string-append "https://gitlab.com/janneke/mes";
-                                        "/-/archive/" commit
-                                        "/mes-" commit ".tar.gz"))
-                    (sha256
-                     (base32
-                      "1whbzahv16bwhavr2azqli0dcbk29p9rsqfbjl69la135z8vgdhx")))
-                  (package-source mes)))
-      (native-inputs '())
-      (propagated-inputs '()))))
+  (package
+    (inherit mes)
+    (name "mes-boot0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://lilypond.org/janneke/mes/";
+                    "mes-02cdb14601a84cae07a487af90f707aa942ddaa7"))
+              (sha256
+               (base32
+                "1gikcy86j7k1jpif703qqnvchag2zqm0nblavk46i4cq0vaqqfpf"))))
+    (native-inputs '())
+    (propagated-inputs '())))
 
 (define nyacc-boot
-  (let ((version "0.86.0")
-        (revision "0")
-        (commit #f))
-    (package
-      (inherit nyacc)
-      (name "nyacc-boot")
-      (version
-       (if commit
-           (string-append version "-" revision "." (string-take commit 7))
-           version))
-      (source
-       (if commit
-           (origin
-             (method url-fetch)
-             (uri (string-append "https://gitlab.com/janneke/nyacc";
-                                 "/-/archive/" commit
-                                 "/nyacc-" commit ".tar.gz"))
-             (sha256
-              (base32
-               "0dlcqmchhl57nh7f0v6qb1kkbi7zbs3b185hcqv57fhb60b7rgcq")))
-           (package-source nyacc))))))
+  (package
+    (inherit nyacc)
+    (name "nyacc-boot")
+    (version "0.86.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://lilypond.org/janneke/mes/";
+                    "nyacc-" version ".tar"))
+              (sha256
+               (base32
+                "1912yx1vr9l97gr0wddm9j7f0p3wvfc410dmvdmg11jvjssvmdjp"))))))
 
 (define mes-boot
   (package-with-bootstrap-guile
@@ -142,84 +126,102 @@
       `(("mescc-tools" ,%bootstrap-mescc-tools)
         ("nyacc-source" ,(package-source nyacc-boot))
 
-        ("coreutils" , %bootstrap-coreutils&co)
-        ("bootstrap-mes" ,%bootstrap-mes)
-        ,@(if %fake-bootstrap?  ; cheat: fast non-bootstrap testing with Guile
-              `(("guile" ,%bootstrap-guile)
-                ("srfi-43" ,%srfi-43)) ; guile-2.0.9 lacks srfi-43; cherry-pick
-              '())))
+        ("guile" ,%bootstrap-guile)
+        ("gash" , %bootstrap-gash)
+        ("bootstrap-mes" ,%bootstrap-mes)))
      (arguments
       `(#:implicit-inputs? #f
+        #:tests? #f
         #:guile ,%bootstrap-guile
         #:strip-binaries? #f   ; binutil's strip b0rkes MesCC/M1/hex2 binaries
         #:phases
         (modify-phases %standard-phases
+          (add-before 'unpack 'setenv
+            (lambda _
+              (let ((gash (assoc-ref %build-inputs "gash")))
+                (setenv "PATH" (string-append gash "/libexec/gash:" (getenv 
"PATH")))
+                (format #t "PATH=~s\n" (getenv "PATH"))
+                #t)))
           (add-after 'unpack 'unpack-seeds
             (lambda* (#:key outputs #:allow-other-keys)
-              (let ((coreutils (assoc-ref %build-inputs "coreutils"))
-                    (srfi-43 (assoc-ref %build-inputs "srfi-43"))
-                    (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
+              (let ((nyacc-source (assoc-ref %build-inputs "nyacc-source"))
                     (bootstrap-mes (assoc-ref %build-inputs "bootstrap-mes")))
                 (with-directory-excursion ".."
                   (and
                    (mkdir-p "nyacc-source")
                    (invoke "tar" "--strip=1" "-C" "nyacc-source" "-xvf" 
nyacc-source)
-                   (symlink (string-append bootstrap-mes "/lib") "mes-seed")
-                   (or (not srfi-43)
-                       (and (mkdir-p "srfi")
-                            (copy-file srfi-43 "srfi/srfi-43.scm")
-                            #t)))))))
+                   (symlink (string-append bootstrap-mes "/lib") 
"mes-seed"))))))
           (replace 'configure
             (lambda* (#:key outputs #:allow-other-keys)
               (let ((out (assoc-ref %outputs "out")))
-                (symlink (string-append "../nyacc-source/module") "nyacc")
+                ;; FIXME: --strip=N broken in gash tar
+                ;;(symlink (string-append "../nyacc-source/module") "nyacc")
+                (symlink (string-append "../nyacc-source/nyacc-0.86.0/module") 
"nyacc")
+                (setenv "V" "1")
                 (setenv "GUILE_LOAD_PATH" "nyacc")
-                (setenv "GUILE_TOOLS" "true") ; no tools in bootstrap-guile
-                (substitute* "configure.sh"
-                  (("^arch=.*") "arch=i686\n"))
-                (invoke "bash" "configure.sh"
+                (setenv "prefix" out)
+                (invoke "sh" "configure.sh"
                         (string-append "--prefix=" out))
                 (setenv "MES" "src/mes")
                 (setenv "MESCC" "scripts/mescc")
                 (when ,%fake-bootstrap? ; Cheat using Guile+Nyacc+MesCC; ~30 
times faster
                   (let ((dir (with-directory-excursion ".." (getcwd)))
-                        (guile (assoc-ref %build-inputs "guile"))
-                        (srfi-43 (assoc-ref %build-inputs "srfi-43")))
+                        (guile (assoc-ref %build-inputs "guile")))
                     (setenv "MES" "guile")
                     (setenv "GUILE_AUTO_COMPILE" "1")
                     (setenv "GUILE_LOAD_COMPILED_PATH"
-                            (string-append guile "/lib/guile/2.0/ccache"))
+                            (string-append guile "/lib/guile/2.2/ccache"))
                     (setenv "GUILE_LOAD_PATH"
-                            (string-append (string-append dir 
"/nyacc-source/module")
-                                           ":" dir
-                                           ":" guile "/share/guile/2.0/"))
-                    ;; these fail with guile-2.0
-                    (when srfi-43
-                      (delete-file "tests/srfi-9.test")
-                      (delete-file "tests/srfi-43.test"))
+                            ;; FIXME: --strip=N broken in gash tar
+                            (string-append ;(string-append dir 
"/nyacc-source/module")
+                             (string-append dir 
"/nyacc-source/nyacc-0.86.0/module")
+                             ":" dir
+                             guile "/share/guile/2.2/"))
                     ;; give auto-compile a home -- massive speed-up
                     (mkdir-p "/tmp/home")
                     (setenv "HOME" "/tmp/home")))
                 #t)))
           (replace 'build
             (lambda _
-              (invoke "sh" "build.sh")))
+              ;; show some progress
+              (substitute* "bootstrap.sh"
+                (("guile build-aux/mes-snarf.scm (.*)" all cmd)
+                 (string-append "echo guile -e '(mes-snarf)' 
build-aux/mes-snarf.scm " cmd "\n"
+                                "guile -e '(mes-snarf)' 
build-aux/mes-snarf.scm " cmd "\n"
+                                "ls -l src\n"
+                                ))
+                (("guile (.*)" all cmd)
+                 (string-append "echo guile " cmd "\n"
+                                "guile " cmd "\n"
+                                "ls -l lib lib/x86-mes src\n"
+                                )))
+              ;; Gash word/delim is buggy
+              (substitute* "scripts/mescc"
+                (("^exec ") "dir=$(dirname $0)\n")
+                (("^( *)\\$\\(dirname \\$0\\)" all space)
+                 (string-append space "$dir")))
+              (invoke "sh" "bootstrap.sh")
+              #t))
           (replace 'check
             (lambda _
-              (when ,%fake-bootstrap?
-                ;; break with guile-2.0
-                (delete-file "scaffold/boot/50-primitive-load.scm")
-                (delete-file "scaffold/boot/51-module.scm"))
-              (and
-               (setenv "MES_ARENA" "100000000")
-               (setenv "DIFF" "sh scripts/diff.scm")
-               ;; fail fast tests
-               ;; (invoke "sh" "-x" "build-aux/test.sh" "scaffold/tests/t")
-               ;; (invoke "sh" "-x" "build-aux/test.sh" 
"scaffold/tests/63-struct-cell")
-               (invoke "sh" "check.sh"))))
+              (setenv "MES_PREFIX" "mes")
+              (invoke "src/mes" "--help")))
           (replace 'install
             (lambda _
-              (invoke "sh" "install.sh"))))))
+              (substitute* "install.sh"
+                ((" --exclude=[^ ]*") ""))
+
+              ;; show some progress
+              (substitute* "install.sh"
+                ((" -xf") " -xvf"))
+
+              ;; show some progress
+              (substitute* "install.sh"
+                (("^( *)((cp|mkdir|tar) [^']*[^\\])\n" all space cmd)
+                 (string-append space "echo '" cmd "'\n"
+                                space cmd "\n")))
+              (format #t "INVOKE\n")
+              (invoke "sh" "-x" "install.sh"))))))
      (native-search-paths
       ;; Use the language-specific variables rather than 'CPATH' because they
       ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]