# GNU Guile warning: failed to install locale

**URL:** <https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205>\
**Category:** Guix\
**Created:** [February 4, 2024, 7:51pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205 "2024-02-04T19:51:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fyrfaras](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/fyrfaras/32/25_2.png) [@fyrfaras](https://forum.systemcrafters.net/u/fyrfaras)\
**Post date:** [February 4, 2024, 7:51pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/1 "2024-02-04T19:51:57Z")

</div>

Hello everybunny 🐇 ,

I’ve installed GNU Guile over Guix on my Debian VM recently.  
I’m able to use guile(1) but I always get the message:

```auto
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument

```

at the beginning.  
Installing `glibc-locales` and `glibc-utf8-locales-2.29` didn’t resolve the issue.  
My guile(1) version is `GNU Guile 3.0.9`.  
Is someone having the same issue?

Bunny regards  
Fyrfaras 🐇

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [February 4, 2024, 8:42pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/2 "2024-02-04T20:42:07Z")

</div>

> [@fyrfaras](#):
>
> Is someone having the same issue?

I’m neither a Guix user, nor a Guile user, but let’s try. I guess that `guix shell guile -- guile` reproduces the behavior. So let’s use `strace` to see whether something interesting happens before the warning:

```shell
guix shell guile glibc-locales strace -- strace guile --version |& grep -E "warning:.*install locale" -B6

```

```auto
openat(AT_FDCWD, "/run/current-system/locale/2.33/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.33/en_US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.33/en_US/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.33/en.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.33/en.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.33/en/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(2, "guile: warning: failed to instal"..., 41guile: warning: failed to install locale

```

In case you don’t know `openat(...)`, it’s what actually opens files. Or at least tries to. In this case, the `openat` call returns `ENOENT`: the file does not exist.

My `LANG` environment variable is `en_US.UTF-8`, which explains all those tries. Either way, this shows that the locale system looks for the locales within `/run/current-system`, a path that does not exist on Debian. I guess that `/run/current-system/` is a Guix thing about the, well, current system configuration, but that’s not available on Debian.

However, the important part here is that _my_ `LANG` was used within the `guix shell` environment. The issue vanishes as soon as we use a `--pure` (or `--container`) shell, as this won’t transfer the `LANG` env:

```shell
$ guix shell --pure guile glibc-locales strace -- strace guile --version |& grep -E "warning:.*install locale" -B6

```

No output, therefore no warning. So all in all, I guess this is an issue of Guix@Debian not setting the `current-system` correctly.

---

<div class="post-metadata">

**Author:** ![ryuslash](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ryuslash/32/66_2.png) [@ryuslash](https://forum.systemcrafters.net/u/ryuslash)\
**Post date:** [February 5, 2024, 12:12am UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/3 "2024-02-05T00:12:45Z")

</div>

I’ve seen that message pop up as well from time to time, but now I can’t reproduce it.

I don’t know if this helps at all, but since you don’t mention it I’ll ask: did you also set the `GUIX_LOCPATH` environment variable mentioned in the documentation?

> **[Application Setup (GNU Guix Reference Manual)](https://guix.gnu.org/manual/en/html_node/Application-Setup.html)**
>
> Application Setup (GNU Guix Reference Manual)

---

<div class="post-metadata">

**Author:** ![ennoausberlin](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ennoausberlin/32/37_2.png) [@ennoausberlin](https://forum.systemcrafters.net/u/ennoausberlin)\
**Post date:** [February 5, 2024, 2:38pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/4 "2024-02-05T14:38:09Z")

</div>

Some distributions differ where to set environment variables for login shells or other shells. Putting to GUIX\_LOC\_PATH into .bashrc works here on ASAHI Ubuntu

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [February 5, 2024, 5:02pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/5 "2024-02-05T17:02:08Z")

</div>

Great find! Can confirm that this works.

> **Without the environment variable**
>
> ```sh
> $ guix shell guile glibc-locales strace -- strace -e trace=openat guile --version |& grep -E "warning|locale"
> 
> ```
> 
> ```auto
> openat(AT_FDCWD, "/run/current-system/locale/2.33/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/run/current-system/locale/2.33/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/run/current-system/locale/2.33/en_US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/run/current-system/locale/2.33/en_US/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/run/current-system/locale/2.33/en.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/run/current-system/locale/2.33/en.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> openat(AT_FDCWD, "/run/current-system/locale/2.33/en/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> guile: warning: failed to install locale
> 
> ```

> **With the environment variable**
>
> ```sh
> $ GUIX_LOCPATH=$HOME/.guix-profile/lib/locale guix shell guile glibc-locales strace -- strace -e trace=openat guile --version |& grep -E "warning|locale"
> 
> ```
> 
> ```auto
> openat(AT_FDCWD, "/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_TELEPHONE", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_ADDRESS", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_NAME", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_PAPER", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_TIME", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = 3
> openat(AT_FDCWD, "/home/ashraz/.guix-profile/lib/locale/2.33/en_US.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
> 
> # snip, rest not relevant. no warning though!
> 
> ```

So @fyrfaras, you want to set the `GUIX_LOCPATH` as described within ` info "(guix) Application Setup"` (e.g. use `export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale` in your `.profile` or your shell’s equivalent) 🙂

---

<div class="post-metadata">

**Author:** ![daviwil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/daviwil/32/1_2.png) [@daviwil](https://forum.systemcrafters.net/u/daviwil)\
**Post date:** [February 5, 2024, 5:25pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/6 "2024-02-05T17:25:57Z")

</div>

Yep, this is a common pitfall of using Guix as a package manager and these steps are required on “foreign” distributions.

---

<div class="post-metadata">

**Author:** ![ryuslash](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ryuslash/32/66_2.png) [@ryuslash](https://forum.systemcrafters.net/u/ryuslash)\
**Post date:** [February 5, 2024, 6:19pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/7 "2024-02-05T18:19:57Z")

</div>

Yeah the first little while I used it I had these troubles, I’m really thankful that this page was in the documentation 😃

There are still some issues I don’t know how to get around, though… sometimes trying to install things from the AUR (btw I use Arch) fails to compile because it mistakenly tries to build against the wrong libc or glib or something along those lines. Going full-in on Guix fixes that, but sometimes it’s easier to do `yay -S some-package` than `guix shell --pure coreutils bash gcc pkg-config dep1 dep2 dep3 ...` 🙂

---

<div class="post-metadata">

**Author:** ![fyrfaras](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/fyrfaras/32/25_2.png) [@fyrfaras](https://forum.systemcrafters.net/u/fyrfaras)\
**Post date:** [February 5, 2024, 9:07pm UTC](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/8 "2024-02-05T21:07:15Z")

</div>

Thank you so much everybunny 🐇 !!

I inserted the `GUIX_LOCPATH` in my `.profile`.  
Now it works like a charm and there aren’t any warnings 🎇  
Thanks again @ashraz, @ryuslash, @ennoausberlin and @daviwil ❤

@ashraz Your indepth view with `strace` is really cool. For future debuggings I will keep this in mind for my toolbox 🧰 Also I should rely more on `info` ℹ
