guix download fails if filename contains "@"

DoneSubmitted by Hartmut Goebel.
H
Hartmut Goebel wrote on Sun Mar 19 19:06:22+0100 2017
(address . bug-guix@gnu.org)
4e979de0-b9d9-d489-792c-4a63c91aaba1@crazy-compilers.com
guix download fails if filename contains "@":invalid character `@' in name


$ guix download
mirror://kde/stable/applications/16.12.3/src/kde-l10n/kde-l10n-ca@valencia-16.12.3.tar.xz
[...]
Starting download of /tmp/guix-file.oVF3qZ
From
http://mirror.karneval.cz/pub/kde/stable/applications/16.12.3/src/kde-l10n/kde-l10n-ca@valencia-16.12.3.tar.xz...
...cia-16.12.3.tar.xz 2.0MiB 1.4MiB/s 00:01
[####################] 100.0%
guix download: error: build failed: invalid character `@' in name
`kde-l10n-ca@valencia-16.12.3.tar.xz'


Guix version:
/gnu/store/v83285dvjy923ikq1dddncixb6kfba0k-guix-0.12.0-5.1162/bin/guix

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
L
Ludovic Courtès wrote on Mon Mar 20 23:22:40+0100 2017
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)(address . 26175@debbugs.gnu.org)
87wpbjsi4v.fsf@gnu.org
Hello,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> guix download fails if filename contains "@":invalid character `@' in name
>
>
> $ guix download
> mirror://kde/stable/applications/16.12.3/src/kde-l10n/kde-l10n-ca@valencia-16.12.3.tar.xz
> [...]
> Starting download of /tmp/guix-file.oVF3qZ
> From
> http://mirror.karneval.cz/pub/kde/stable/applications/16.12.3/src/kde-l10n/kde-l10n-ca@valencia-16.12.3.tar.xz...
> ...cia-16.12.3.tar.xz 2.0MiB 1.4MiB/s 00:01
> [####################] 100.0%
> guix download: error: build failed: invalid character `@' in name
> `kde-l10n-ca@valencia-16.12.3.tar.xz'

To address this we’d need an extra command-line option in ‘guix
download’ to specify the name to use in the store (similar to the
‘file-name’ field in <origin>.)

So one would type:

guix download --name=foo.tar.xz mirror://…/kde-l10n-ca@valencia-16.12.3.tar.xz

In the meantime, you can work around it by doing something like:

guix download -o foo.tar.xz mirror://…/kde-l10n-ca@valencia-16.12.3.tar.xz
guix hash foo.tar.xz

Thanks,
Ludo’.
H
Hartmut Goebel wrote on Mon Mar 20 23:30:35+0100 2017
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 26175@debbugs.gnu.org)
a4107fcf-e366-32a3-c907-03263e3acd23@crazy-compilers.com
Am 20.03.2017 um 23:22 schrieb Ludovic Courtès:
> To address this we’d need an extra command-line option in ‘guix
> download’ to specify the name to use in the store (similar to the
> ‘file-name’ field in <origin>.)
>
> So one would type:
>
> guix download --name=foo.tar.xz mirror://…/kde-l10n-ca@valencia-16.12.3.tar.xz

IMHO this i not a good solution, since it puts the burden of handling a
non-obvious restriction to the user. This makes things complicated and
less-skilled discourages people. "guix download" should implement some
escape automatic mechanisms.

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
L
Ludovic Courtès wrote on Tue Mar 21 09:57:09+0100 2017
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)(address . 26175@debbugs.gnu.org)
87a88fvwgq.fsf@gnu.org
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> Am 20.03.2017 um 23:22 schrieb Ludovic Courtès:
>> To address this we’d need an extra command-line option in ‘guix
>> download’ to specify the name to use in the store (similar to the
>> ‘file-name’ field in <origin>.)
>>
>> So one would type:
>>
>> guix download --name=foo.tar.xz mirror://…/kde-l10n-ca@valencia-16.12.3.tar.xz
>
> IMHO this i not a good solution, since it puts the burden of handling a
> non-obvious restriction to the user. This makes things complicated and
> less-skilled discourages people. "guix download" should implement some
> escape automatic mechanisms.

Oh right, that’s another possibility, and I agree it’d be better.

Ludo’.
H
Hartmut Goebel wrote on Tue Sep 03 16:39:35+0200 2019
Re: [bug#36976] [PATCH 1/1] download: Map file-name characters not allowed in store.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 26175@debbugs.gnu.org)
af79fc5d-d162-02bd-1d5f-165dec4cc879@crazy-compilers.com
Hi Ludo,

while http://issues.guix.gnu.org/issue/36976 is going to solve the issue
for "guix download", I found that there are other cases where invalid
characters in store names appear. Thus we need a more elaborate solution
- or several solutions.

Any suggestions which cases to check and how to fix them?


E.g. "@" and "%" are not allowed in package source base names: When
building the package below, which used the "offending URL, yields an error:

guix build: error: invalid character `@' in name
`kde-l10n-ca@valencia-14.11.80.tar.xz.drv'

Same when trying to work around this be using "…%40…".

(use-modules (guix packages) (guix download) (guix build-system gnu))

(package
  (name "kde-l10n-ca-valencia")
  (version "14.11.80")
  (source
   (origin
     (method url-fetch)
     (uri (string-append "mirror://kde//Attic/applications/"
                         version "/src/kde-l10n/"
                         "kde-l10n-ca@valencia-" version ".tar.xz"))
     (sha256 (base32
"1mqadassxcm0m9r1l02m5vr4bbandn48xz8gifvxmb4wiz8i8d0w"))))
  (build-system gnu-build-system)
  (synopsis "") (description "") (license "") (home-page ""))

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
L
Ludovic Courtès wrote on Wed Sep 04 12:32:41+0200 2019
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)(address . 26175@debbugs.gnu.org)
87v9u873na.fsf@gnu.org
Hi,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

>    (origin
>      (method url-fetch)
>      (uri (string-append "mirror://kde//Attic/applications/"
>                          version "/src/kde-l10n/"
>                          "kde-l10n-ca@valencia-" version ".tar.xz"))

In this case just add a ‘file-name’ field. I think that’s a reasonable
expectation.

Thanks,
Ludo’.
H
Hartmut Goebel wrote on Sun Sep 08 20:50:15+0200 2019
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 26175@debbugs.gnu.org)
d389e39b-1482-c9a7-3034-661b59cbb9b1@crazy-compilers.com
Am 04.09.19 um 12:32 schrieb Ludovic Courtès:
> Hi,
>
> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>
>>    (origin
>>      (method url-fetch)
>>      (uri (string-append "mirror://kde//Attic/applications/"
>>                          version "/src/kde-l10n/"
>>                          "kde-l10n-ca@valencia-" version ".tar.xz"))
> In this case just add a ‘file-name’ field. I think that’s a reasonable
> expectation.
>
> Thanks,
> Ludo’.

Agreed. WDYT about adding this as a hint when the error shows up?

How can I catch the "error: invalid character `@' in name" in guix build?

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
L
Ludovic Courtès wrote on Sun Sep 08 22:07:10+0200 2019
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)(address . 26175@debbugs.gnu.org)
87h85m4knl.fsf@gnu.org
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> Am 04.09.19 um 12:32 schrieb Ludovic Courtès:
>> Hi,
>>
>> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>>
>>>    (origin
>>>      (method url-fetch)
>>>      (uri (string-append "mirror://kde//Attic/applications/"
>>>                          version "/src/kde-l10n/"
>>>                          "kde-l10n-ca@valencia-" version ".tar.xz"))
>> In this case just add a ‘file-name’ field. I think that’s a reasonable
>> expectation.
>>
>> Thanks,
>> Ludo’.
>
> Agreed. WDYT about adding this as a hint when the error shows up?
>
> How can I catch the "error: invalid character `@' in name" in guix build?

Unfortunately it cannot really be caught. I mean, you could catch
‘&store-protocol-error’ error conditions, but then the error message is
just a string, there’s no error code you can compare against.

Ludo’.
H
Hartmut Goebel wrote on Thu Sep 26 17:53:10+0200 2019
(address . 26175-close@debbugs.gnu.org)
cd9d69a0-5dea-9be6-2780-72c5a7543a66@crazy-compilers.com
Done, see dec845606d2d184da31065fa26cd951b84b3ce2d and
<http://issues.guix.gnu.org/issue/36976#5>

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
?
Your comment

Comments via the web interface are not currently supported. To comment on this conversation send email to 26175@debbugs.gnu.org

2 participants
  • Hartmut Goebel
  • Ludovic Courtès
Owner
unassigned
Severity
normal
Status
Done