[cuirass] channel-update-service fails trying to find key with accent in the name

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Noé Lopez
Owner
unassigned
Submitted by
Noé Lopez
Severity
normal
N
N
Noé Lopez wrote on 11 Oct 22:23 +0200
(address . bug-guix@gnu.org)
874j5iqthz.fsf@xn--no-cja.eu
Hi,

I’ve been trying to make my own channel and run cuirass on it for fun
and to learn more about how guix works.

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
does not exist in the given tree »

Indeed, it seems the accent in my name has been replaced with two
question marks…

The specification I’m using is the following:
(specification
(name 'bloup)
(build '(channels bloup))
(channels
(cons (channel
(name 'bloup)
(introduction
(make-channel-introduction
"f627568549edd28c97dded5e5ec985cd11e95f58"
(openpgp-fingerprint
"5D54 CF25 57B2 38E8 8DC1 80A2 2D22 3241 0AB7 4043"))))
%default-channels)))

The unicode signing key doesn’t seem to cause a problem for guix pull,
only cuirass is complaining.

I can try to make a patch, tips and advice for finding the issue
would be greatly appreciated.

Good evening,
Noé « No?? » Lopez
L
L
Ludovic Courtès wrote on 28 Nov 08:59 +0100
(name . Noé Lopez)(address . noe@xn--no-cja.eu)(address . 73751@debbugs.gnu.org)
8734jb94c9.fsf@gnu.org
Hi,

Noé Lopez <noe@noé.eu> skribis:

Toggle quote (6 lines)
> 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:
Toggle diff (13 lines)
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’.
N
N
Noé Lopez wrote on 3 Dec 17:04 +0100
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 73751@debbugs.gnu.org)
87wmggycqr.fsf@xn--no-cja.eu
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)
(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 <ludo@gnu.org> writes:

Toggle quote (33 lines)
> Hi,
>
> Noé Lopez <noe@noé.eu> 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’.
L
L
Ludovic Courtès wrote on 12 Dec 12:14 +0100
(name . Noé Lopez)(address . noe@xn--no-cja.eu)(address . 73751@debbugs.gnu.org)
87y10lb1an.fsf@gnu.org
Hi,

Noé Lopez <noe@noé.eu> skribis:

Toggle quote (3 lines)
> I was able to reproduce this from the cuirass checkout when unsetting
> LANG and that indeed seems to be issue,

OK, I’m pushing the proposed C.UTF-8 patch, then.

Toggle quote (4 lines)
> 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.

It’s a long story. Basically, Guile interprets file name according to
the current locale encoding; it’s been this way on Unix/GNU/Linux for
ages.

However, the default locale on POSIX systems is “C”, meaning ASCII
encoding. As a consequence, Guile does ASCII “by default”, when LC_ALL
& co. are not specified.

Thanks,
Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73751@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73751
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch