diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-09-30 22:40:59 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-10-05 23:19:19 +0200 |
commit | 1d4ab335b22a93e01c2eb1eb3e93fc6534157040 (patch) | |
tree | 195b237b582a139c8a0ce4d0e90b33d86916a7f5 /gnu/packages | |
parent | b3417123d190349bc844a841f252351c0474e44a (diff) | |
download | guix-1d4ab335b22a93e01c2eb1eb3e93fc6534157040.tar.gz |
self: Use a 'guile' that doesn't complain about locales.
Since commit ba48895899a117d6ace2209c3f54411a4a989133, selected UTF-8 locales are bundled. However, because 'guix-command' is itself a Guile script, users would still see Guile's warning, particularly on foreign distros: $ LC_ALL=sdf guix foo guile: warning: failed to install locale hint: Consider installing the `glibc-utf8-locales' [...] User commands would print that warning, but more importantly, each invocation of 'guix substitute' would print it, even though 'guix-daemon.service' explicitly chooses "en_US.utf8", which is in 'glibc-utf8-locales'. This leads to confusion since users would keep seeing this message unless/until they realize they also need to install 'glibc-utf8-locales' in root's profile. This patch gets rid of "guile: warning: ..." for a guix-pulled 'guix' command. * guix/self.scm (specification->package): Add "gcc-toolchain". (quiet-guile): New procedure. (guix-command): Use it. * gnu/packages/aux-files/guile-launcher.c: New file. * Makefile.am (AUX_FILES): Add it.
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/aux-files/guile-launcher.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/aux-files/guile-launcher.c b/gnu/packages/aux-files/guile-launcher.c new file mode 100644 index 0000000000..886ede2846 --- /dev/null +++ b/gnu/packages/aux-files/guile-launcher.c @@ -0,0 +1,46 @@ +/* GNU Guix --- Functional package management for GNU + Copyright 1996-1997,2000-2001,2006,2008,2011,2013,2018 + Free Software Foundation, Inc. + Copyright (C) 2020 Ludovic Courtès <ludo@gnu.org> + + This file is part of GNU Guix. + + GNU Guix is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or (at + your option) any later version. + + GNU Guix is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. */ + +/* This file implements a variant of the 'guile' executable that does not + complain about locale issues. */ + +#include <locale.h> +#include <libguile.h> + +static void +inner_main (void *unused, int argc, char **argv) +{ + scm_shell (argc, argv); +} + +int +main (int argc, char **argv) +{ + /* Try to install the current locale; remain silent if it fails. */ + if (setlocale (LC_ALL, "") == NULL) + /* The 'guix pull'-provided 'guix' includes at least en_US.utf8 so use + that. That gives us UTF-8 support for 'scm_to_locale_string', etc., + which is always preferable over the C locale. */ + setlocale (LC_ALL, "en_US.utf8"); + + scm_install_gmp_memory_functions = 1; + scm_boot_guile (argc, argv, inner_main, 0); + return 0; /* never reached */ +} |