On Mon, Jul 17, 2017 at 03:26:06PM +0200, Ludovic Courtès wrote:
> It looks like the initrd is still running Guile 2.0 but getting 2.2
> modules.
> 
> This should be fixed with this patch, which I haven’t been able to test
> yet:

> diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
> index 844b110eb..ecd019a94 100644
> --- a/gnu/packages/make-bootstrap.scm
> +++ b/gnu/packages/make-bootstrap.scm
> @@ -504,21 +504,21 @@ for `sh' in $PATH, and without nscd, and with static 
> NSS modules."
>    (let* ((patches (cons* (search-patch "guile-relocatable.patch")
>                           (search-patch "guile-default-utf8.patch")

'guile-default-utf8.patch' needs to be adjusted (or dropped? not sure)
for Guile 2.2.

My naive attempt (attached) doesn't work. At the end of building a
package, or perhaps after it's built, Guix prints 'uncaught exception'
and seems to hang forever.
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 844b110eb..ecd019a94 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -504,21 +504,21 @@ for `sh' in $PATH, and without nscd, and with static NSS 
modules."
   (let* ((patches (cons* (search-patch "guile-relocatable.patch")
                          (search-patch "guile-default-utf8.patch")
                          (search-patch "guile-linux-syscalls.patch")
-                         (origin-patches (package-source guile-2.0))))
-         (source  (origin (inherit (package-source guile-2.0))
+                         (origin-patches (package-source guile-2.2))))
+         (source  (origin (inherit (package-source guile-2.2))
                     (patches patches)))
-         (guile (package (inherit guile-2.0)
-                  (name (string-append (package-name guile-2.0) "-static"))
+         (guile (package (inherit guile-2.2)
+                  (name (string-append (package-name guile-2.2) "-static"))
                   (source source)
                   (synopsis "Statically-linked and relocatable Guile")
 
                   ;; Remove the 'debug' output (see above for the reason.)
-                  (outputs (delete "debug" (package-outputs guile-2.0)))
+                  (outputs (delete "debug" (package-outputs guile-2.2)))
 
                   (propagated-inputs
                    `(("bdw-gc" ,libgc)
                      ,@(alist-delete "bdw-gc"
-                                     (package-propagated-inputs guile-2.0))))
+                                     (package-propagated-inputs guile-2.2))))
                   (arguments
                    `(;; When `configure' checks for ltdl availability, it
                      ;; doesn't try to link using libtool, and thus fails
@@ -534,7 +534,7 @@ for `sh' in $PATH, and without nscd, and with static NSS 
modules."
                                    (("^guile_LDFLAGS =")
                                     "guile_LDFLAGS = -all-static")
 
-                                   ;; Add `-ldl' *after* libguile-2.0.la.
+                                   ;; Add `-ldl' *after* libguile-2.2.la.
                                    (("^guile_LDADD =(.*)$" _ ldadd)
                                     (string-append "guile_LDADD = "
                                                    (string-trim-right ldadd)
diff --git a/gnu/packages/patches/guile-default-utf8.patch 
b/gnu/packages/patches/guile-default-utf8.patch
index 22771324f..f03aaaffe 100644
--- a/gnu/packages/patches/guile-default-utf8.patch
+++ b/gnu/packages/patches/guile-default-utf8.patch
@@ -16,28 +16,6 @@ index cf41f2f..facfb91 100644
                           iconveh_question_mark, NULL,                   \
                           &c_utf, &c_utf_len);                           \
        if (SCM_UNLIKELY (err))                                           \
-diff --git a/libguile/ports.c b/libguile/ports.c
-index 301bc44..b0ea2e6 100644
---- a/libguile/ports.c
-+++ b/libguile/ports.c
-@@ -1750,7 +1750,7 @@ scm_ungetc (scm_t_wchar c, SCM port)
-   if (pt->encoding != NULL)
-     encoding = pt->encoding;
-   else
--    encoding = "ISO-8859-1";
-+    encoding = "UTF-8";
- 
-   len = sizeof (result_buf);
-   result = u32_conv_to_encoding (encoding,
-@@ -2212,7 +2212,7 @@ scm_i_set_port_encoding_x (SCM port, const char 
*encoding)
-   pt = SCM_PTAB_ENTRY (port);
- 
-   if (encoding == NULL)
--    encoding = "ISO-8859-1";
-+    encoding = "UTF-8";
- 
-   if (pt->encoding != encoding)
-     pt->encoding = scm_gc_strdup (encoding, "port");
 diff --git a/libguile/posix.c b/libguile/posix.c
 index 4f8b8ac..fea7f74 100644
 --- a/libguile/posix.c
@@ -68,33 +46,6 @@ diff --git a/libguile/strings.c b/libguile/strings.c
 index 5d0db23..8266247 100644
 --- a/libguile/strings.c
 +++ b/libguile/strings.c
-@@ -1576,7 +1576,7 @@ scm_from_locale_string (const char *str)
- SCM
- scm_from_locale_stringn (const char *str, size_t len)
- {
--  return scm_from_stringn (str, len, locale_charset (),
-+  return scm_from_stringn (str, len, "UTF-8",
-                            scm_i_default_port_conversion_handler ());
- }
- 
-@@ -1803,7 +1803,7 @@ char *
- scm_to_locale_stringn (SCM str, size_t *lenp)
- {
-   return scm_to_stringn (str, lenp,
--                         locale_charset (),
-+                         "UTF-8",
-                          scm_i_default_port_conversion_handler ());
- }
- 
-@@ -2054,7 +2054,7 @@ scm_to_stringn (SCM str, size_t *lenp, const char 
*encoding,
-                         "string contains #\\nul character: ~S",
-                         scm_list_1 (str));
- 
--  if (scm_i_is_narrow_string (str) && (encoding == NULL))
-+  if (scm_i_is_narrow_string (str))
-     {
-       /* If using native Latin-1 encoding, just copy the string
-          contents.  */
 @@ -2079,11 +2079,11 @@ scm_to_stringn (SCM str, size_t *lenp, const char 
*encoding,
    len = 0;
    enc = encoding;
@@ -109,14 +60,25 @@ index 5d0db23..8266247 100644
                           (enum iconv_ilseq_handler) handler, NULL,
                           &buf, &len);
  
---- guile-2.0.9/libguile/ports.c       2013-08-21 11:08:50.000000000 +0200
-+++ guile-2.0.9/libguile/ports.c       2013-08-21 11:09:47.000000000 +0200
-@@ -2512,7 +2512,7 @@ scm_i_port_iconv_descriptors (SCM port,
-       const char *precise_encoding;
+diff --git a/libguile/strings.c b/libguile/strings.c
+index 5c49e33d8..49fa6556e 100644
+--- a/libguile/strings.c
++++ b/libguile/strings.c
+@@ -1561,7 +1561,7 @@ scm_i_default_string_failed_conversion_handler (void)
+ SCM
+ scm_from_locale_stringn (const char *str, size_t len)
+ {
+-  return scm_from_stringn (str, len, locale_charset (),
++  return scm_from_stringn (str, len, "UTF-8",
+                            scm_i_default_string_failed_conversion_handler ());
+ }
  
-       if (!pt->encoding)
--        pt->encoding = "ISO-8859-1";
-+        pt->encoding = "UTF-8";
+@@ -1885,7 +1885,7 @@ char *
+ scm_to_locale_stringn (SCM str, size_t *lenp)
+ {
+   return scm_to_stringn (str, lenp,
+-                         locale_charset (),
++                         "UTF-8",
+                          scm_i_default_string_failed_conversion_handler ());
+ }
  
-       /* If the specified encoding is UTF-16 or UTF-32, then make
-          that more precise by deciding what byte order to use. */

Attachment: signature.asc
Description: PGP signature

Reply via email to