Subject: bug#42912: Acknowledgement (cran.git importer fails because with-store swallows extra values.)

From: Ricardo Wurmus <[email-masked]>
Date: Tue, 18 Aug 2020 12:40:58 +0200

This hack works around the problem:

--8<---------------cut here---------------start------------->8---
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index a1275b4822..e10ea25587 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -197,10 +197,17 @@ bioconductor package NAME, or #F if the package is unknown."
 (define download
   (memoize
    (lambda* (url #:key method)
+     (define v1 #f)
+     (define v2 #f)
      (with-store store
        (cond
         ((eq? method 'git)
-         (latest-repository-commit store url))
+         (call-with-values
+             (lambda ()
+               (latest-repository-commit store url))
+           (lambda (dir commit)
+             (set! v1 dir)
+             (set! v2 commit))))
         ((eq? method 'hg)
          (call-with-temporary-directory
           (lambda (dir)
@@ -214,8 +221,10 @@ bioconductor package NAME, or #F if the package is unknown."
                           (find-files dir "^\\.hg$" #:directories? #t))
                 (let ((store-directory
                        (add-to-store store (basename url) #t "sha256" dir)))
-                  (values store-directory changeset)))))))
-        (else (download-to-store store url)))))))
+                  (set! v1 store-directory)
+                  (set! v2 changeset)))))))
+        (else (set! v1 (download-to-store store url)))))
+     (values v1 v2))))
 
 (define (fetch-description repository name)
   "Return an alist of the contents of the DESCRIPTION file for the R package
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo