From 524c9800afb433cc474132185d8e37f72004adb3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 29 Apr 2021 00:38:03 +0200 Subject: diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6. * guix/diagnostics.scm (source-properties->location): Add clause for vectors. * guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6. * tests/guix-package.sh: Relax regexp for the "unbound variable" diagnostic check. * tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6. * tests/records.scm (location-alist): New procedure. ("define-record-type* & wrong field specifier") ("define-record-type* & wrong field specifier, identifier") ("define-record-type* & duplicate initializers"): Use it. --- guix/ui.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index 7fbd4c63a2..334dce2c68 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -376,12 +376,14 @@ ARGS is the list of arguments received by the 'throw' handler." (('system-error . rest) (let ((err (system-error-errno args))) (report-error (G_ "failed to load '~a': ~a~%") file (strerror err)))) - (('read-error "scm_i_lreadparen" message _ ...) + (('read-error _ message args ...) ;; Guile's missing-paren messages are obscure so we make them more ;; intelligible here. - (if (string-suffix? "end of file" message) - (let ((location (string-drop-right message - (string-length "end of file")))) + (if (or (string-suffix? "end of file" message) ;Guile < 3.0.6 + (and (string-contains message "unexpected end of input") + (member '(#\)) args))) + (let ((location (string-take message + (+ 2 (string-contains message ": "))))) (format (current-error-port) (G_ "~amissing closing parenthesis~%") location)) (apply throw args))) -- cgit v1.2.3 From afec2784174058fdd85d9698e1fa748c45bfa8ee Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 3 May 2021 15:57:24 -0400 Subject: ui: Suggest installing glibc-locales, not glibc-utf8-locales. Users (both old and new) struggling with locale warnings is a recurrent theme; part of it may be due to the glibc-utf8-locales package being misleading, as it only includes a subset of the UTF-8 locales. To prevent confusion, suggest installing the glibc-locales package instead. * guix/ui.scm (install-locale): Do not mention glibc-utf8-locales in the hint message. Use glibc-locales instead of glibc-utf8-locales in the provided example. --- guix/ui.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index 334dce2c68..e2cf2f1f5e 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -492,12 +492,11 @@ part." (lambda _ (setlocale LC_ALL "")) (lambda args - (display-hint (G_ "Consider installing the @code{glibc-utf8-locales} or -@code{glibc-locales} package and defining @code{GUIX_LOCPATH}, along these -lines: + (display-hint (G_ "Consider installing the @code{glibc-locales} package +and defining @code{GUIX_LOCPATH}, along these lines: @example -guix install glibc-utf8-locales +guix install glibc-locales export GUIX_LOCPATH=\"$HOME/.guix-profile/lib/locale\" @end example -- cgit v1.2.3