GNU bug report logs -
#63053
[PATCH 0/3] Fix "guix import crate"
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63053 in the body.
You can then email your comments to 63053 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#63053
; Package
guix-patches
.
(Mon, 24 Apr 2023 15:49:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Simon Tournier <zimon.toutoune <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 24 Apr 2023 15:49:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
Consider,
--8<---------------cut here---------------start------------->8---
$ guix import crate non-existent
guix import: error: failed to download meta-data for package 'non-existent'
--8<---------------cut here---------------end--------------->8---
and then,
--8<---------------cut here---------------start------------->8---
$ guix import crate non-existent -r
Backtrace:
5 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
2300:7 4 (run-guix . _)
2263:10 3 (run-guix-command _ . _)
In guix/scripts/import.scm:
89:11 2 (guix-import . _)
In guix/import/utils.scm:
638:27 1 (recursive-import "non-existent" #:repo->guix-package _ #:guix-name _ #:version _ . _)
630:33 0 (lookup-node "non-existent" #f)
guix/import/utils.scm:630:33: In procedure lookup-node:
Wrong number of values returned to continuation (expected 2)
--8<---------------cut here---------------end--------------->8---
as reported by #63030 [1]. This patch set fixes that.
Note that ’guile-semver’ is already part of ’self’ but not part of ’guix’,
therefore “guix shell -D guix” does not provide the necessary guile-semver for
testing with ./pre-inst-env.
1: https://issues.guix.gnu.org/issue/63020
Simon Tournier (3):
guix: import: crate: Fix incorrect returned values.
scripts: import: crate: Handle non-existent package.
gnu: guix: Add guile-semver.
gnu/packages/package-management.scm | 1 +
guix/import/crate.scm | 54 +++++++++++++++--------------
guix/scripts/import/crate.scm | 20 ++++++-----
3 files changed, 40 insertions(+), 35 deletions(-)
base-commit: 9350347dabd0f25f89fd2a703a250b20872ad911
--
2.38.1
Information forwarded
to
mail <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org
:
bug#63053
; Package
guix-patches
.
(Mon, 24 Apr 2023 15:52:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 63053 <at> debbugs.gnu.org (full text, mbox):
* guix/import/crate.scm (crate->guix-package): Return compatible values with
'recursive-import'.
---
guix/import/crate.scm | 54 ++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 514eca2229..6e10ebb5d4 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
;;; Copyright © 2021 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -293,32 +294,33 @@ (define (sort-map-dependencies deps)
(match-lambda* (((name _) ...)
(apply string-ci<? name)))))
- (and crate version*
- (let* ((dependencies (crate-version-dependencies version*))
- (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
- (cargo-inputs (sort-map-dependencies dep-crates))
- (cargo-development-inputs (if include-dev-deps?
- (sort-map-dependencies dev-dep-crates)
- '())))
- (values
- (make-crate-sexp #:build? include-dev-deps?
- #:name crate-name
- #:version (crate-version-number version*)
- #:cargo-inputs cargo-inputs
- #:cargo-development-inputs cargo-development-inputs
- #:home-page
- (let ((home-page (crate-home-page crate)))
- (if (string? home-page)
- home-page
- (let ((repository (crate-repository crate)))
- (if (string? repository)
- repository
- ""))))
- #:synopsis (crate-description crate)
- #:description (crate-description crate)
- #:license (and=> (crate-version-license version*)
- string->license))
- (append cargo-inputs cargo-development-inputs)))))
+ (if (and crate version*)
+ (let* ((dependencies (crate-version-dependencies version*))
+ (dep-crates dev-dep-crates (partition normal-dependency? dependencies))
+ (cargo-inputs (sort-map-dependencies dep-crates))
+ (cargo-development-inputs (if include-dev-deps?
+ (sort-map-dependencies dev-dep-crates)
+ '())))
+ (values
+ (make-crate-sexp #:build? include-dev-deps?
+ #:name crate-name
+ #:version (crate-version-number version*)
+ #:cargo-inputs cargo-inputs
+ #:cargo-development-inputs cargo-development-inputs
+ #:home-page
+ (let ((home-page (crate-home-page crate)))
+ (if (string? home-page)
+ home-page
+ (let ((repository (crate-repository crate)))
+ (if (string? repository)
+ repository
+ ""))))
+ #:synopsis (crate-description crate)
+ #:description (crate-description crate)
+ #:license (and=> (crate-version-license version*)
+ string->license))
+ (append cargo-inputs cargo-development-inputs)))
+ (values #f '())))
(define* (crate-recursive-import crate-name #:key version)
(recursive-import crate-name
--
2.38.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#63053
; Package
guix-patches
.
(Mon, 24 Apr 2023 15:52:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 63053 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
guile-semver.
---
gnu/packages/package-management.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 5d2416f35b..65baf4093c 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -476,6 +476,7 @@ (define code
("guile-gcrypt" ,guile-gcrypt)
("guile-json" ,guile-json-4)
("guile-lib" ,guile-lib)
+ ("guile-semver" ,guile-semver)
("guile-sqlite3" ,guile-sqlite3)
("guile-ssh" ,guile-ssh)
("guile-git" ,guile-git)
--
2.38.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#63053
; Package
guix-patches
.
(Mon, 24 Apr 2023 15:52:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 63053 <at> debbugs.gnu.org (full text, mbox):
Fixes <https://bugs/gnu.org/63020>.
* guix/scripts/import/crate.scm (guix-import-crate): Handle non-existent
package input.
---
guix/scripts/import/crate.scm | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 97152904ac..038faa87db 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 David Craven <david <at> craven.ch>
;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -90,15 +91,16 @@ (define (parse-options)
(define-values (name version)
(package-name->name+version spec))
- (if (assoc-ref opts 'recursive)
- (crate-recursive-import name #:version version)
- (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
- (unless sexp
- (leave (G_ "failed to download meta-data for package '~a'~%")
- (if version
- (string-append name "@" version)
- name)))
- (list sexp))))
+ (match (if (assoc-ref opts 'recursive)
+ (crate-recursive-import name #:version version)
+ (crate->guix-package name #:version version #:include-dev-deps? #t))
+ ((or #f '())
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ (if version
+ (string-append name "@" version)
+ name)))
+ ((? list? sexps) sexps)
+ (sexp (list sexp))))
(()
(leave (G_ "too few arguments~%")))
((many ...)
--
2.38.1
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Sun, 30 Apr 2023 21:11:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Simon Tournier <zimon.toutoune <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 30 Apr 2023 21:11:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 63053-done <at> debbugs.gnu.org (full text, mbox):
Hi,
Simon Tournier <zimon.toutoune <at> gmail.com> skribis:
> guix: import: crate: Fix incorrect returned values.
> scripts: import: crate: Handle non-existent package.
> gnu: guix: Add guile-semver.
Applied, thanks! :-)
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 29 May 2023 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.