* bug#32387: hackage/cabal importer broken
@ 2018-08-07 13:04 Ricardo Wurmus
2018-08-07 16:00 ` bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing Ricardo Wurmus
2018-08-07 21:04 ` bug#32387: hackage/cabal importer broken Ricardo Wurmus
0 siblings, 2 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2018-08-07 13:04 UTC (permalink / raw)
To: 32387
The cabal importer is currently broken:
--8<---------------cut here---------------start------------->8---
./pre-inst-env guix import hackage IntervalMap
Backtrace:
8 (apply-smob/1 #<catch-closure 23a0720>)
In ice-9/boot-9.scm:
705:2 7 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
619:8 6 (_ #(#(#<directory (guile-user) 245f140>)))
In guix/ui.scm:
1579:12 5 (run-guix-command _ . _)
In guix/scripts/import.scm:
115:11 4 (guix-import . _)
In guix/scripts/import/hackage.scm:
110:16 3 (guix-import-hackage . _)
In unknown file:
2 (_ #<procedure 37041e0 at ice-9/boot-9.scm:1037:28 ()> #<procedure 3704240 at ice-9/eval.scm:333:13 (a)> #<undefined>)
In ice-9/eval.scm:
293:34 1 (_ #(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#<directory (guix import cabal) 28c3f00>) (("name" ("IntervalMap")) ("version" ("0.6.0.0")) ("stability" ("experimental")) ("synopsis" ("C…")) …)) #) #) #) #) #) #) #) #) #) #) #) #) #))
619:8 0 (_ #(#(#<directory (guix import cabal) 28c3f00> ())))
ice-9/eval.scm:619:8: Throw to key `match-error' with args `("match" "no matching pattern" ())'.
--8<---------------cut here---------------end--------------->8---
This error seems to happen when there is no custom-setup section.
--
Ricardo
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing.
2018-08-07 13:04 bug#32387: hackage/cabal importer broken Ricardo Wurmus
@ 2018-08-07 16:00 ` Ricardo Wurmus
2018-08-07 16:19 ` Danny Milosavljevic
2018-08-07 21:04 ` bug#32387: hackage/cabal importer broken Ricardo Wurmus
1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2018-08-07 16:00 UTC (permalink / raw)
To: 32387; +Cc: Ricardo Wurmus
Fixes <https://debbugs.gnu.org/32387>.
* guix/import/cabal.scm (eval-cabal): Avoid mis-match when the custom-setup
section cannot be created.
* guix/import/hackage.scm (cabal-custom-setup-dependencies->names): Do not
crash when cabal-package-custom-setup returns #F.
---
guix/import/cabal.scm | 7 ++++---
guix/import/hackage.scm | 6 ++++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 1b8bda6f4..13c2f3f48 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -831,9 +832,9 @@ See the manual for limitations.")))))))
(test-suites (make-cabal-section evaluated-sexp 'test-suite))
(flags (make-cabal-section evaluated-sexp 'flag))
(eval-environment '())
- (custom-setup (match
- (make-cabal-section evaluated-sexp 'custom-setup)
- ((x) x))))
+ (custom-setup (match (make-cabal-section evaluated-sexp 'custom-setup)
+ ((x) x)
+ (_ #f))))
(make-cabal-package name version license home-page-or-hackage
source-repository synopsis description executables lib
test-suites flags eval-environment custom-setup)))
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 6f80d84b7..3b138f8c9 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -178,8 +179,9 @@ object."
(define (cabal-custom-setup-dependencies->names cabal)
"Return the list of custom-setup dependencies from the CABAL package
object."
- (let* ((custom-setup-dependencies (and=> (cabal-package-custom-setup cabal)
- cabal-custom-setup-dependencies)))
+ (let* ((custom-setup-dependencies (or (and=> (cabal-package-custom-setup cabal)
+ cabal-custom-setup-dependencies)
+ '())))
(map cabal-dependency-name custom-setup-dependencies)))
(define (filter-dependencies dependencies own-name)
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing.
2018-08-07 16:00 ` bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing Ricardo Wurmus
@ 2018-08-07 16:19 ` Danny Milosavljevic
0 siblings, 0 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2018-08-07 16:19 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: 32387
[-- Attachment #1: Type: text/plain, Size: 83 bytes --]
Hi Ricardo,
hehe, you are too fast for me. I was just looking at it.
LGTM!
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#32387: hackage/cabal importer broken
2018-08-07 13:04 bug#32387: hackage/cabal importer broken Ricardo Wurmus
2018-08-07 16:00 ` bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing Ricardo Wurmus
@ 2018-08-07 21:04 ` Ricardo Wurmus
1 sibling, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2018-08-07 21:04 UTC (permalink / raw)
To: 32387-done
Fixed with commit f60784228a05c21aabc0a97b62fb158ce479525c.
--
Ricardo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-07 21:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07 13:04 bug#32387: hackage/cabal importer broken Ricardo Wurmus
2018-08-07 16:00 ` bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing Ricardo Wurmus
2018-08-07 16:19 ` Danny Milosavljevic
2018-08-07 21:04 ` bug#32387: hackage/cabal importer broken Ricardo Wurmus
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).