unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42912: cran.git importer fails because with-store swallows extra values.
@ 2020-08-18  9:50 Ricardo Wurmus
       [not found] ` <handler.42912.B.15977442299543.ack@debbugs.gnu.org>
  2020-08-28 21:31 ` bug#42912: cran.git importer fails because with-store swallows extra values Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2020-08-18  9:50 UTC (permalink / raw)
  To: 42912

The “cran” importer has support for git and hg repositories.  This no
longer works, because the “download” is supposed to return multiple
values.  Seemingly due to the use of “with-store” it no longer returns
multiple values, so the “git” and “hg” archives no longer work.

-- 
Ricardo




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#42912: Acknowledgement (cran.git importer fails because with-store swallows extra values.)
       [not found] ` <handler.42912.B.15977442299543.ack@debbugs.gnu.org>
@ 2020-08-18 10:40   ` Ricardo Wurmus
  0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2020-08-18 10:40 UTC (permalink / raw)
  To: 42912


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




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#42912: cran.git importer fails because with-store swallows extra values.
  2020-08-18  9:50 bug#42912: cran.git importer fails because with-store swallows extra values Ricardo Wurmus
       [not found] ` <handler.42912.B.15977442299543.ack@debbugs.gnu.org>
@ 2020-08-28 21:31 ` Ludovic Courtès
  2020-08-29  7:36   ` Ricardo Wurmus
  1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-08-28 21:31 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 42912

Howdy Ricardo!

Ricardo Wurmus <rekado@elephly.net> skribis:

> The “cran” importer has support for git and hg repositories.  This no
> longer works, because the “download” is supposed to return multiple
> values.  Seemingly due to the use of “with-store” it no longer returns
> multiple values, so the “git” and “hg” archives no longer work.

I believe 3d9ea605c8dfb7fc43689e12975218b032b3175a fixes this, though I
don’t know how to test it.

If you can confirm it does, feel free to close this bug.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#42912: cran.git importer fails because with-store swallows extra values.
  2020-08-28 21:31 ` bug#42912: cran.git importer fails because with-store swallows extra values Ludovic Courtès
@ 2020-08-29  7:36   ` Ricardo Wurmus
  0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2020-08-29  7:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42912-done


Ludovic Courtès <ludo@gnu.org> writes:

> I believe 3d9ea605c8dfb7fc43689e12975218b032b3175a fixes this, though I
> don’t know how to test it.
>
> If you can confirm it does, feel free to close this bug.

It looks like it’s indeed fixed.  Thank you!

I tested with this command:

    guix import cran -a git https://github.com/immunogenomics/harmony

-- 
Ricardo




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-29  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18  9:50 bug#42912: cran.git importer fails because with-store swallows extra values Ricardo Wurmus
     [not found] ` <handler.42912.B.15977442299543.ack@debbugs.gnu.org>
2020-08-18 10:40   ` bug#42912: Acknowledgement (cran.git importer fails because with-store swallows extra values.) Ricardo Wurmus
2020-08-28 21:31 ` bug#42912: cran.git importer fails because with-store swallows extra values Ludovic Courtès
2020-08-29  7:36   ` 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).