GNU bug report logs - #44115
“guix import -r“ fails with Bactktrace instead of error

Previous Next

Package: guix;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Wed, 21 Oct 2020 13:20:02 UTC

Severity: normal

Merged with 54258

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44115 in the body.
You can then email your comments to 44115 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#44115; Package guix. (Wed, 21 Oct 2020 13:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to zimoun <zimon.toutoune <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 21 Oct 2020 13:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: “guix import -r“ fails with
 Bactktrace instead of error
Date: Wed, 21 Oct 2020 15:19:31 +0200
Dear,

Compare:

  $ guix import elpa foo
  guix import: error: failed to download package 'foo'

with:

  $ guix import elpa foo -r
  Backtrace:
             4 (primitive-load "/home/simon/.config/guix/current/bin/guix")
  In guix/ui.scm:
    2116:12  3 (run-guix-command _ . _)
  In guix/scripts/import.scm:
     120:11  2 (guix-import . _)
  In guix/scripts/import/elpa.scm:
     103:16  1 (guix-import-elpa . _)
  In guix/import/utils.scm:
     431:36  0 (recursive-import "foo" gnu #:repo->guix-package _ #:guix-name _)

  guix/import/utils.scm:431:36: In procedure recursive-import:
  Wrong number of values returned to continuation (expected 2)



Idem with the importers: ’hackage’, ’pypi’, ’cran’, ’crate’ and ’opam’.
Note the special mention to ’gem’:

  $ guix import gem kikoo -r
  #f


All the best,
simon





Information forwarded to bug-guix <at> gnu.org:
bug#44115; Package guix. (Thu, 29 Oct 2020 22:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 44115 <at> debbugs.gnu.org (full text, mbox):

From: Lulu <me <at> erkin.party>
To: "44115 <at> debbugs.gnu.org" <44115 <at> debbugs.gnu.org>
Subject: “guix import -r“ fails with Bactktrace instead of error
Date: Fri, 30 Oct 2020 01:12:09 +0300 (TRT)
Okay, this one was a tad difficult but I think I got it down. A problem was that
there were hacks in importers to circumvent this problem without actually solving
it. I'm going to send in annotated patches soon.

--
Lulu




Information forwarded to bug-guix <at> gnu.org:
bug#44115; Package guix. (Thu, 29 Oct 2020 22:40:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lulu <me <at> erkin.party>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [bug#44115] [PATCH] import: Make failed recursive imports yield an
 error instead of backtrace.
Date: Fri, 30 Oct 2020 01:39:22 +0300 (TRT)
* guix/import/utils.scm (recursive-import): Move error handling of recursive imports to a single point.
* guix/import/gem.scm (gem->guix-package): Fix the `values' hack and make the procedure return #f on failure.
* guix/import/pypi.scm (pypi->guix-package): Fix the condition hack and make the procedure return #f on failure.

---
 guix/import/gem.scm   | 2 +-
 guix/import/pypi.scm  | 5 +----
 guix/import/utils.scm | 9 +++++++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 3fe240f36a..c97df149ab 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -143,7 +143,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
                                  dependencies
                                  licenses)
                   dependencies-names))
-        (values #f '()))))
+        #f)))
 
 (define (guix-package->gem-name package)
   "Given a PACKAGE built from rubygems.org, return the name of the
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 15116e349d..9c6a825243 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -478,10 +478,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
             (info    (and project (pypi-project-info project))))
        (and project
             (guard (c ((missing-source-error? c)
-                       (let ((package (missing-source-error-package c)))
-                         (leave (G_ "no source release for pypi package ~a ~a~%")
-                                (project-info-name info)
-                                (project-info-version info)))))
+                       #f))
               (make-pypi-sexp (project-info-name info)
                               (project-info-version info)
                               (and=> (latest-source-release project)
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 145515c489..815a05988e 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -36,6 +36,7 @@
   #:use-module (guix store)
   #:use-module (guix download)
   #:use-module (guix sets)
+  #:use-module (guix ui)
   #:use-module (gnu packages)
   #:use-module (ice-9 match)
   #:use-module (ice-9 rdelim)
@@ -428,8 +429,12 @@ name corresponding to the upstream name."
     (not (null? (find-packages-by-name (guix-name name)))))
 
   (define (lookup-node name)
-    (receive (package dependencies) (repo->guix-package name repo)
-      (make-node name package dependencies)))
+    (call-with-values (lambda () (repo->guix-package name repo))
+      (match-lambda*
+        ((#f)
+         (leave (G_ "failed to download package '~a' during recursive import~%") name))
+        ((package dependencies)
+         (make-node name package dependencies)))))
 
   (map node-package
        (topological-sort (list (lookup-node package-name))
-- 
2.29.1




Information forwarded to bug-guix <at> gnu.org:
bug#44115; Package guix. (Mon, 18 Jan 2021 20:28:02 GMT) Full text and rfc822 format available.

Message #14 received at 44115 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: 44115 <at> debbugs.gnu.org
Subject: Re: bug#44115: “guix import -r“ fails with Bactktrace instead of error
Date: Mon, 18 Jan 2021 21:25:32 +0100
Hi,

The commit bea3b17739fc591b8cf6db1f8d28a6f6c9585577 changed a bit the
importers.  However, even before this commit, the errors are incorrectly
reported for ’gnu’ and ’json’, without the --recursive option, e.g,
commit 23e2cd156f.  And bea3b17739 does not change anything.  This very
same backtrace:

--8<---------------cut here---------------start------------->8---
# Importer: gnu
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
          10 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  9 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  8 (guix-import . _)
In ice-9/boot-9.scm:
  1736:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
  1731:15  6 (with-exception-handler #<procedure 7f44f4628900 at ice-9/boot-9.scm:1815:7 (exn)> _ # _ …)
In guix/import/gnu.scm:
    111:2  5 (gnu->guix-package "kikoo-lol" #:key-download _)
In guix/gnu-maintenance.scm:
   364:20  4 (latest-ftp-release "kikoo-lol" #:server _ #:directory _ #:keep-file? _ # _ #:ftp-open _ …)
In guix/ftp-client.scm:
    233:6  3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 15> addrinfo: #(32 10 1 6 …> …)
In srfi/srfi-1.scm:
   460:18  2 (fold #<procedure 7f44f4628720 at guix/ftp-client.scm:187:10 (dir result)> _ _)
In guix/ftp-client.scm:
     74:8  1 (_ _ _)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `ftp-error' with args `(#<input-output: socket 15> "CWD kikoo-lol" 550 "Failed to change directory.\r")'.
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
# Importer: json
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
           7 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  6 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  5 (guix-import . _)
In guix/scripts/import/json.scm:
    91:11  4 (guix-import-json . _)
In ice-9/boot-9.scm:
  1731:15  3 (with-exception-handler #<procedure 7f25ebaf6210 at ice-9/boot-9.scm:1815:7 (exn)> _ # _ …)
In guix/import/json.scm:
    61:19  2 (_)
In ice-9/ports.scm:
   440:11  1 (call-with-input-file "kikoo-lol" #<procedure 7f25ebad92c0 at ice-9/ports.scm:492:3 (p)> …)
In unknown file:
           0 (open-file "kikoo-lol" "r" #:encoding #f #:guess-encoding #f)

ERROR: In procedure open-file:
In procedure open-file: No such file or directory: "kikoo-lol"
--8<---------------cut here---------------end--------------->8---


Then, for the same commit 23e2cd156f and the importers supporting the
--recursive option, the only one reporting correctly the error is the
’stackage’ importer:

--8<---------------cut here---------------start------------->8---
for from in pypi hackage stackage elpa gem cran opam ;\
  do echo "# Importer: $from" ;\
  guix time-machine --commit=23e2cd156f -- import $from kikoo-lol -r ;\
  done
# Importer: pypi
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
following redirection to `https://pypi.org/pypi/kikoo-lol/json/'...
Backtrace:
           4 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In guix/scripts/import/pypi.scm:
    97:16  1 (guix-import-pypi . _)
In guix/import/utils.scm:
   431:36  0 (recursive-import "kikoo-lol" #f #:repo->guix-package _ #:guix-name _)

guix/import/utils.scm:431:36: In procedure recursive-import:
Wrong number of values returned to continuation (expected 2)
# Importer: hackage
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
           4 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In guix/scripts/import/hackage.scm:
   132:26  1 (guix-import-hackage . _)
In guix/import/utils.scm:
   431:36  0 (recursive-import "kikoo-lol" #f #:repo->guix-package _ #:guix-name _)

guix/import/utils.scm:431:36: In procedure recursive-import:
Wrong number of values returned to continuation (expected 2)
# Importer: stackage
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guix import: error: kikoo-lol: Stackage package not found
# Importer: elpa
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
           4 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In guix/scripts/import/elpa.scm:
   103:16  1 (guix-import-elpa . _)
In guix/import/utils.scm:
   431:36  0 (recursive-import "kikoo-lol" gnu #:repo->guix-package _ #:guix-name _)

guix/import/utils.scm:431:36: In procedure recursive-import:
Wrong number of values returned to continuation (expected 2)
# Importer: gem
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
#f

# Importer: cran
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
error: failed to retrieve package information from "https://cran.r-project.org/web/packages/kikoo-lol/DESCRIPTION": 404 ("Not Found")
Backtrace:
           4 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In srfi/srfi-1.scm:
   586:17  1 (map1 (#f))
In guix/import/utils.scm:
    258:2  0 (package->definition _)

guix/import/utils.scm:258:2: In procedure package->definition:
Throw to key `match-error' with args `("match" "no matching pattern" #f)'.
# Importer: opam
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Package not found in opam repository: kikoo-lol
Backtrace:
           4 (primitive-load "/home/simon/.cache/guix/inferiors/uefwax7zflbosucfo3nxhvvwwyvldkx447xk…")
In guix/ui.scm:
  2118:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In guix/scripts/import/opam.scm:
    96:16  1 (guix-import-opam . _)
In guix/import/utils.scm:
   431:36  0 (recursive-import "kikoo-lol" #f #:repo->guix-package _ #:guix-name _)

guix/import/utils.scm:431:36: In procedure recursive-import:
Wrong number of values returned to continuation (expected 2)
--8<---------------cut here---------------end--------------->8---

And now the commit bea3b17739 introduces instead this backtraces for
’opam’:

--8<---------------cut here---------------start------------->8---
# Importer: opam
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
           6 (primitive-load "/home/simon/.cache/guix/inferiors/fbnvi5znqq6m3atsgadr35wm3anm7hwiouof…")
In guix/ui.scm:
  2118:12  5 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  4 (guix-import . _)
In guix/scripts/import/opam.scm:
    96:16  3 (guix-import-opam . _)
In guix/import/utils.scm:
   445:31  2 (recursive-import "kikoo-lol" #:repo->guix-package _ #:guix-name _ #:version _ #:repo _)
   436:33  1 (lookup-node "kikoo-lol" #f)
In guix/import/opam.scm:
    264:0  0 (opam->guix-package _ #:repository _ #:version _)

guix/import/opam.scm:264:0: In procedure opam->guix-package:
Unrecognized keyword: #:repo
--8<---------------cut here---------------end--------------->8---


Last and annoying, the commit bea3b17739 introduces the regression:

--8<---------------cut here---------------start------------->8---
for ci in 23e2cd156f bea3b17739 ; do guix time-machine --commit=$ci -- import hackage process -r ; done
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...

Starting download of /tmp/guix-file.WAQrHM
From https://hackage.haskell.org/package/process/process-1.6.10.0.tar.gz...
 ….10.0.tar.gz  72KiB                 559KiB/s 00:00 [##################] 100.0%
(define-public ghc-process
  (package
    (name "ghc-process")
    (version "1.6.10.0")
    (source
      (origin
        (method url-fetch)
        (uri (string-append
               "https://hackage.haskell.org/package/process/process-"
               version
               ".tar.gz"))
        (sha256
          (base32
            "01c50qhrsvymbifa3lzyq6g4hmj6jl3awjp1jmbhdkmfdfaq3v16"))))
    (build-system haskell-build-system)
    (home-page
      "http://hackage.haskell.org/package/process")
    (synopsis "Process libraries")
    (description
      "This package contains libraries for dealing with system processes. . The typed-process package is a more recent take on a process API, which uses this package internally. It features better binary support, easier concurrency, and a more composable API. You can read more about it at <https://github.com/fpco/typed-process/#readme>.")
    (license bsd-3)))

Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Backtrace:
           4 (primitive-load "/home/simon/.cache/guix/inferiors/fbnvi5znqq6m3atsgadr35wm3anm7hwiouof…")
In guix/ui.scm:
  2118:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In guix/scripts/import/hackage.scm:
   132:26  1 (guix-import-hackage . _)
In guix/import/utils.scm:
    416:0  0 (recursive-import _ #:repo->guix-package _ #:guix-name _ #:version _ #:repo _)

guix/import/utils.scm:416:0: In procedure recursive-import:
Invalid keyword: #f
--8<---------------cut here---------------end--------------->8---


All the best,
simon




Merged 44115 54258. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 07 Mar 2022 21:54:01 GMT) Full text and rfc822 format available.

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 07 Mar 2022 21:56:01 GMT) Full text and rfc822 format available.

Notification sent to zimoun <zimon.toutoune <at> gmail.com>:
bug acknowledged by developer. (Mon, 07 Mar 2022 21:56:02 GMT) Full text and rfc822 format available.

Message #21 received at 44115-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 44115-done <at> debbugs.gnu.org, 54258-done <at> debbugs.gnu.org
Subject: Re: bug#44115: “guix import -r“ fails with Bactktrace instead of error
Date: Mon, 07 Mar 2022 22:55:12 +0100
zimoun <zimon.toutoune <at> gmail.com> skribis:

>   $ guix import elpa foo -r
>   Backtrace:
>              4 (primitive-load "/home/simon/.config/guix/current/bin/guix")
>   In guix/ui.scm:
>     2116:12  3 (run-guix-command _ . _)
>   In guix/scripts/import.scm:
>      120:11  2 (guix-import . _)
>   In guix/scripts/import/elpa.scm:
>      103:16  1 (guix-import-elpa . _)
>   In guix/import/utils.scm:
>      431:36  0 (recursive-import "foo" gnu #:repo->guix-package _ #:guix-name _)
>
>   guix/import/utils.scm:431:36: In procedure recursive-import:
>   Wrong number of values returned to continuation (expected 2)

Fixed, thanks to last year’s zimoun!  :-)

  5278cab3dc scripts: import: gem: Fix recursive error handling.
  7229b0e858 import: cran: Return multiple values for unknown packages.
  1fe81b349c import: elpa: Return multiple values for unknown packages.
  6bb92098b4 import: hackage: Return multiple values for unknown packages.
  434925379d import: pypi: Return multiple values for unknown packages.
  ebb03447f8 import: pypi: Gracefully handle missing project home page.

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 07 Mar 2022 21:56:02 GMT) Full text and rfc822 format available.

Notification sent to Ricardo Wurmus <rekado <at> elephly.net>:
bug acknowledged by developer. (Mon, 07 Mar 2022 21:56:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Apr 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.