Subject: bug#73751: [cuirass] channel-update-service fails trying to find key with accent in the name

From: Noé Lopez <[email-masked]>
Date: Tue, 03 Dec 2024 17:04:12 +0100

Hi,

I was able to reproduce this from the cuirass checkout when unsetting
LANG and that indeed seems to be issue, is there a reason why UTF-8 is
not the default in shepherd/guile/cuirass?  IMO it would be better to
set it to the default to avoid future issues with other services.

What do you think?

The specification to reproduce:
(list (specification
       (name 'bloup)
       (channels
	(cons (channel
	       (name 'bloup)
	       (url "https://framagit.org/nll/bloup.git")
               (branch "cuirass-bug")
	       (introduction
	        (make-channel-introduction
	         "f627568549edd28c97dded5e5ec985cd11e95f58"
	         (openpgp-fingerprint
	          "5D54 CF25 57B2 38E8 8DC1 80A2 2D22 3241 0AB7 4043"))))
	      %default-channels))))

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> Noé Lopez <[email-masked]> skribis:
>
>> Cuirass is failing to fetch the channel, because of something with the
>> key file: « 2024-10-11 21:34:11 error: Git error while fetching channels
>> from https://framagit.org/nll/bloup.git
>> https://git.savannah.gnu.org/git/guix.git: the path 'No?? Lopez.key'
>> does not exist in the given tree »
>
> This error comes from libgit2, and I suspect the reason is that libgit2
> interprets file names according to the current locale and ‘cuirass
> register’ is not running in a UTF-8 locale.
>
> Could you check with this patch:
>
> diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
> index 187766bc99..f9f6355b98 100644
> --- a/gnu/services/cuirass.scm
> +++ b/gnu/services/cuirass.scm
> @@ -184,7 +184,8 @@ (define (cuirass-shepherd-service config)
>                          #$@extra-options)
>  
>                    #:environment-variables
> -                  (list "GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
> +                  (list "LC_ALL=C.UTF-8"
> +                        "GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
>                          (string-append "GIT_EXEC_PATH=" #$git
>                                         "/libexec/git-core"))
>  
>
> Thanks,
> Ludo’.