guix import fails with unexpected token

  • Done
  • quality assurance status badge
Details
3 participants
  • Tobias Geerinckx-Rice
  • Philip Munksgaard
  • zimoun
Owner
unassigned
Submitted by
Philip Munksgaard
Severity
normal
Merged with
P
P
Philip Munksgaard wrote on 27 May 2021 15:08
(address . bug-guix@gnu.org)
00e1a49d-d5af-402d-987c-f940adc5ab81@www.fastmail.com
Trying to to import futhark from hackage fails, when using the -r flag.

$ guix import hackage -r futhark
user with UID 497492280 not found

Starting download of /tmp/guix-file.MqWnPq
…19.5.tar.gz 959KiB 6.6MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.ZPWyOq
…tor-0.3.0.1.tar.gz 4KiB 9.4MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.bjbYYp
….3.tar.gz 10KiB 23.7MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.uhGsUr
…-0.12.1.tar.gz 12KiB 15.1MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.SUjZRr
…te-0.13.tar.gz 74KiB 4.2MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.W3CjMq
…y-0.7.1.tar.gz 10KiB 11.8MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.K7aEUp
…on-0.5.1.2.tar.gz 6KiB 9.7MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.ovhTIs
….1.3.7.tar.gz 25KiB 3.5MiB/s 00:00 [##################] 100.0%
user with UID 497492280 not found

Starting download of /tmp/guix-file.nj5C8q
….6.tar.gz 4KiB 9.9MiB/s 00:00 [##################] 100.0%
Syntax error: unexpected token : common (at line 36, column 0)
Syntax error: unexpected end of input
Backtrace:
In ice-9/boot-9.scm:
1736:10 17 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
16 (apply-smob/0 #<thunk 7fad568fb520>)
In ice-9/boot-9.scm:
718:2 15 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 14 (_ #(#(#<directory (guile-user) 7fad568fec80>)))
In guix/ui.scm:
2166:12 13 (run-guix-command _ . _)
In guix/scripts/import.scm:
120:11 12 (guix-import . _)
In guix/scripts/import/hackage.scm:
132:26 11 (guix-import-hackage . _)
In guix/import/utils.scm:
477:27 10 (recursive-import _ #:repo->guix-package _ #:guix-name _ …)
In srfi/srfi-1.scm:
586:29 9 (map1 _)
586:29 8 (map1 _)
586:29 7 (map1 _)
586:29 6 (map1 _)
586:29 5 (map1 _)
586:29 4 (map1 (("neat-interpolation" #f) ("pcg-random" #f) (…) …))
586:29 3 (map1 (("pcg-random" #f) ("srcloc" #f) ("versions" #f)))
586:29 2 (map1 (("srcloc" #f) ("versions" #f)))
586:17 1 (map1 (("versions" #f)))
In guix/import/utils.scm:
466:33 0 (lookup-node "versions" #f)

guix/import/utils.scm:466:33: In procedure lookup-node:
Wrong number of values returned to continuation (expected 2)
Z
Z
zimoun wrote on 27 May 2021 21:54
(name . Philip Munksgaard)(address . philip@munksgaard.me)(address . 48700@debbugs.gnu.org)
86tumolzoz.fsf@gmail.com
Hi,

On Thu, 27 May 2021 at 15:08, "Philip Munksgaard" <philip@munksgaard.me> wrote:
Toggle quote (3 lines)
> Trying to to import futhark from hackage fails, when using the -r
> flag.

Thanks for the report. I think it is the same as:



All the best,
simon.
P
P
Philip Munksgaard wrote on 30 May 2021 18:38
guix import fails with unexpected token
(address . 48700@debbugs.gnu.org)
39115c49-4522-413d-87f9-bc2c422b0dcf@www.fastmail.com
As far as I can tell, this is actually an instance of https://issues.guix.gnu.org/48701.You can close this issue in favor of that one.
T
T
Tobias Geerinckx-Rice wrote on 30 May 2021 18:46
(no subject)
(address . control@debbugs.gnu.org)
874kek41be.fsf@nckx
merge 48700 48701
Z
Z
zimoun wrote on 10 Jun 2021 11:41
Re: bug#48700: guix import fails with unexpected token
(name . Philip Munksgaard)(address . philip@munksgaard.me)(address . 48700@debbugs.gnu.org)
86im2mjbuw.fsf@gmail.com
Hi,

On Sun, 30 May 2021 at 18:38, "Philip Munksgaard" <philip@munksgaard.me> wrote:
Toggle quote (4 lines)
> As far as I can tell, this is actually an instance of
> https://issues.guix.gnu.org/48701. You can close this issue in favor of that
> one.

From my understanding, no. I propose to unmerge. WDYT?

The bug#48700 is a duplicate of bug#44115 (recursive importers). For
instance, a first attempt to fix it is proposed by patch#45984; a new
version should come soon. :-)

But bug#48701 is not related, instead it is related to the Cabal
implemented by Guix.


For instance, this works:

Toggle snippet (8 lines)
for p in bytestring-to-vector bmp directory-tree language-c-quote mainland-pretty neat-interpolation pcg-random srcloc; \
do
guix import hackage $p -r ;
done

guix import hackage futhark

i.e., the option recursive with ’futhark’ goes to ’recursive-import’
from (guix import utils) and the ’node’ is not always well-formed when
’lookup-node’ as explained in #44115 and #45984.



All the best,
simon
P
P
Philip Munksgaard wrote on 10 Jun 2021 14:20
(address . 48700@debbugs.gnu.org)
5867400c-f36a-43a0-94b0-0a33085b15dc@www.fastmail.com
Hi zimoun,

If I understand you correctly, you're saying that this issue is an instance of bug#44115 because we get a backtrace instead of a nice error. I agree that the backtrace is ugly, but in this case the error shouldn't happen at all because all the recursively imported packages exist.

The reason why the backtrace occurs is that the cabal-file for one of the recursively imported dependencies (versions) cannot be parsed using the current version of guix/import/cabal.scm. You'll find that `guix import hackage -r futhark` works as expected with the submitted patch#48943.

Furthermore, I actually think that a backtrace _is_ desirable in this case, because it is an error in the script, and not in the users input or some third-party repository.

As you say, your example works, but you've forgotten the "versions" dependency. If you add that to your list it will not work.

Best regards,
Philip
Z
Z
zimoun wrote on 10 Jun 2021 15:02
(name . Philip Munksgaard)(address . philip@munksgaard.me)(address . 48700@debbugs.gnu.org)
CAJ3okZ3Pdz3nTcaapv1+=qgMY2J83Np6W2ATNibVupjGsko92A@mail.gmail.com
Hi,

On Thu, 10 Jun 2021 at 14:22, Philip Munksgaard <philip@munksgaard.me> wrote:

Toggle quote (2 lines)
> If I understand you correctly, you're saying that this issue is an instance of bug#44115 because we get a backtrace instead of a nice error. I agree that the backtrace is ugly, but in this case the error shouldn't happen at all because all the recursively imported packages exist.

Your point is that parsing the Cabal file of the package "versions"
fails. Mine is, somehow, instead of an ugly backtrace (whatever the
reason), the error for "guix import hackage futhark -r" should be:

Syntax error: unexpected token : common (at line 36, column 0)
Syntax error: unexpected end of input
guix import: error: échec du téléchargement du fichier cabal du
paquet « versions »

as it is for "guix import hackage versions".

Toggle quote (2 lines)
> The reason why the backtrace occurs is that the cabal-file for one of the recursively imported dependencies (versions) cannot be parsed using the current version of guix/import/cabal.scm. You'll find that `guix import hackage -r futhark` works as expected with the submitted patch#48943.

Yeah. I started to give a look for fixing. Thanks to be faster. :-)

Toggle quote (2 lines)
> Furthermore, I actually think that a backtrace _is_ desirable in this case, because it is an error in the script, and not in the users input or some third-party repository.

My opinion is getting a Backtrace is always a poor user experience.
Well, matter of taste. ;-)


Toggle quote (2 lines)
> As you say, your example works, but you've forgotten the "versions" dependency. If you add that to your list it will not work.

Yeah, right. I did too quickly but it does not change my point above. :-)

Thanks,
simon
P
P
Philip Munksgaard wrote on 10 Jun 2021 15:29
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 48700@debbugs.gnu.org)
a083bbd7-736f-4c58-a49d-8bcdb969fcd6@www.fastmail.com
On Thu, 10 Jun 2021, at 15:02, zimoun wrote:
Toggle quote (16 lines)
> On Thu, 10 Jun 2021 at 14:22, Philip Munksgaard <philip@munksgaard.me> wrote:
>
> > If I understand you correctly, you're saying that this issue is an instance of bug#44115 because we get a backtrace instead of a nice error. I agree that the backtrace is ugly, but in this case the error shouldn't happen at all because all the recursively imported packages exist.
>
> Your point is that parsing the Cabal file of the package "versions"
> fails. Mine is, somehow, instead of an ugly backtrace (whatever the
> reason), the error for "guix import hackage futhark -r" should be:
>
> Syntax error: unexpected token : common (at line 36, column 0)
> Syntax error: unexpected end of input
> guix import: error: échec du téléchargement du fichier cabal du
> paquet « versions »
>
> as it is for "guix import hackage versions".
>

Good point, I agree that would be nicer. The backtrace was not my concern when submitting this bug, but it doesn't really matter as long as both issues are fixed :-)
?