summary refs log tree commit diff
path: root/gnu/packages/commencement.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-03-01 16:58:43 +0100
committerLudovic Courtès <ludo@gnu.org>2015-03-01 17:03:04 +0100
commit87c8b92f50c852de05eab2a0a50217adf8897c65 (patch)
tree701d4d5279ac2cf606ab8850a831bb66cdd3d1df /gnu/packages/commencement.scm
parentb479c3ddaf85c831e34888229849bc1ce34419de (diff)
downloadguix-87c8b92f50c852de05eab2a0a50217adf8897c65.tar.gz
gnu: commencement: Make UTF-8 locales available right after 'guile-final'.
In <http://hydra.gnu.org/build/263170>, we see:

   153: 12 [patch-usr-bin-file #:native-inputs #f ...]

  [...]

     ?: 1 [regexp-exec # ...]
  In ice-9/boot-9.scm:
   106: 0 [#<procedure 1998ec0 at ice-9/boot-9.scm:97:6 (thrown-k . args)> encoding-error ...]

  ice-9/boot-9.scm:106:20: In procedure #<procedure 1998ec0 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
  ice-9/boot-9.scm:106:20: Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert narrow string to output locale" 84 #f #f)'.

This is due to that fact that 'patch-/usr/bin/file' read a line
containing a byte sequence with bytes > 127 (namely a copyright sign.)
But this build was running with a C locale, and so those bytes cannot be
represented in that locale, hence this error.

This commit makes the UTF-8 locales available earlier such that
everything can be represented in locale encoding.

* gnu/packages/commencement.scm (glibc-utf8-locales-final): Move
  earlier; change "gzip" input to GZIP built with %BOOT4-INPUTS.
  (%boot5-inputs): Define to %BOOT4-INPUTS plus
  GLIBC-UTF8-LOCALES-FINAL.
  (gnu-make-final, coreutils-final, grep-final): Use it instead of
  %BOOT4-INPUTS.
  (gzip-final): Remove.
  (%boot6-inputs): New variable.
  (%final-inputs): Use it instead of %BOOT5-INPUTS.  Don't rely on
  GZIP-FINAL.
Diffstat (limited to 'gnu/packages/commencement.scm')
-rw-r--r--gnu/packages/commencement.scm43
1 files changed, 26 insertions, 17 deletions
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index aa0aac6d0e..f312e1729c 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -616,12 +616,31 @@ store.")
                                  (current-source-location)
                                  #:guile %bootstrap-guile)))
 
+(define glibc-utf8-locales-final
+  ;; Now that we have GUILE-FINAL, build the UTF-8 locales.  They are needed
+  ;; by the build processes afterwards so their 'scm_to_locale_string' works
+  ;; with the full range of Unicode codepoints (remember
+  ;; 'scm_to_locale_string' is called every time a string is passed to a C
+  ;; function.)
+  (package
+    (inherit glibc-utf8-locales)
+    (inputs `(("glibc" ,glibc-final)
+              ("gzip"
+               ,(package-with-explicit-inputs gzip %boot4-inputs
+                                              (current-source-location)
+                                              #:guile %bootstrap-guile))))))
+
+(define %boot5-inputs
+  ;; Now with UTF-8 locale.
+  `(("locales" ,glibc-utf8-locales-final)
+    ,@%boot4-inputs))
+
 (define gnu-make-final
   ;; The final GNU Make, which uses the final Guile.
   (package-with-bootstrap-guile
    (package-with-explicit-inputs gnu-make
                                  `(("guile" ,guile-final)
-                                   ,@%boot4-inputs)
+                                   ,@%boot5-inputs)
                                  (current-source-location))))
 
 (define-public ld-wrapper
@@ -638,7 +657,7 @@ store.")
   ;; Findutils, keep a reference to the Coreutils they were built with.
   (package-with-bootstrap-guile
    (package-with-explicit-inputs coreutils
-                                 %boot4-inputs
+                                 %boot5-inputs
                                  (current-source-location)
 
                                  ;; Use the final Guile, linked against the
@@ -652,25 +671,15 @@ store.")
   ;; built before gzip.
   (package-with-bootstrap-guile
    (package-with-explicit-inputs grep
-                                 %boot4-inputs
+                                 %boot5-inputs
                                  (current-source-location)
                                  #:guile guile-final)))
 
-(define %boot5-inputs
+(define %boot6-inputs
   ;; Now use the final Coreutils.
   `(("coreutils" ,coreutils-final)
     ("grep" ,grep-final)
-    ,@%boot4-inputs))
-
-(define gzip-final
-  (package-with-explicit-inputs gzip %boot5-inputs
-                                (current-source-location)))
-
-(define glibc-utf8-locales-final
-  (package
-    (inherit glibc-utf8-locales)
-    (inputs `(("glibc" ,glibc-final)
-              ("gzip" ,gzip-final)))))
+    ,@%boot5-inputs))
 
 (define-public %final-inputs
   ;; Final derivations used as implicit inputs by 'gnu-build-system'.  We
@@ -678,12 +687,13 @@ store.")
   ;; used for origins that have patches, thereby avoiding circular
   ;; dependencies.
   (let ((finalize (compose package-with-bootstrap-guile
-                           (cut package-with-explicit-inputs <> %boot5-inputs
+                           (cut package-with-explicit-inputs <> %boot6-inputs
                                 (current-source-location)))))
     `(,@(map (match-lambda
               ((name package)
                (list name (finalize package))))
              `(("tar" ,tar)
+               ("gzip" ,gzip)
                ("bzip2" ,bzip2)
                ("xz" ,xz)
                ("file" ,file)
@@ -692,7 +702,6 @@ store.")
                ("sed" ,sed)
                ("findutils" ,findutils)
                ("gawk" ,gawk)))
-      ("gzip" ,gzip-final)
       ("grep" ,grep-final)
       ("coreutils" ,coreutils-final)
       ("make" ,gnu-make-final)