all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#64551] [PATCH] svn-download: Use download-nar.
@ 2023-07-10  9:20 Christopher Baines
  2023-07-10 21:48 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2023-07-10  9:20 UTC (permalink / raw)
  To: 64551
  Cc: Christopher Baines, Josselin Poiret, Ludovic Courtès,
	Mathieu Othacehe, Ricardo Wurmus, Simon Tournier,
	Tobias Geerinckx-Rice

This should help if there are issues fetching from the source repository.

* guix/svn-download.scm (svn-fetch): Use download-nar and adjust accordingly.
---
 guix/svn-download.scm | 45 +++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index 769571b5f6..6a53d5d2eb 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -23,6 +23,7 @@ (define-module (guix svn-download)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix monads)
+  #:use-module (guix modules)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module ((guix build svn) #:prefix build:)
@@ -79,22 +80,38 @@ (define* (svn-fetch ref hash-algo hash
   "Return a fixed-output derivation that fetches REF, a <svn-reference>
 object.  The output is expected to have recursive hash HASH of type
 HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
+
+  (define guile-json
+    (module-ref (resolve-interface '(gnu packages guile)) 'guile-json-4))
+
+  (define guile-lzlib
+    (module-ref (resolve-interface '(gnu packages guile)) 'guile-lzlib))
+
+  (define guile-gnutls
+    (module-ref (resolve-interface '(gnu packages tls)) 'guile-gnutls))
+
   (define build
-    (with-imported-modules '((guix build svn)
-                             (guix build utils))
-      #~(begin
-          (use-modules (guix build svn)
-                       (ice-9 match))
+    (with-imported-modules
+        (source-module-closure '((guix build svn)
+                                 (guix build download-nar)
+                                 (guix build utils)))
+      (with-extensions (list guile-json guile-gnutls   ;for (guix swh)
+                             guile-lzlib)
+        #~(begin
+            (use-modules (guix build svn)
+                         (guix build download-nar)
+                         (ice-9 match))
 
-          (svn-fetch (getenv "svn url")
-                     (string->number (getenv "svn revision"))
-                     #$output
-                     #:svn-command #+(file-append svn "/bin/svn")
-                     #:recursive? (match (getenv "svn recursive?")
-                                    ("yes" #t)
-                                    (_ #f))
-                     #:user-name (getenv "svn user name")
-                     #:password (getenv "svn password")))))
+            (or (svn-fetch (getenv "svn url")
+                           (string->number (getenv "svn revision"))
+                           #$output
+                           #:svn-command #+(file-append svn "/bin/svn")
+                           #:recursive? (match (getenv "svn recursive?")
+                                          ("yes" #t)
+                                          (_ #f))
+                           #:user-name (getenv "svn user name")
+                           #:password (getenv "svn password"))
+                (download-nar #$output))))))
 
   (mlet %store-monad ((guile (package->derivation guile system)))
     (gexp->derivation (or name "svn-checkout") build

base-commit: 9c164d72b2bbdb1823befb32bede82f6af431750
prerequisite-patch-id: 08325c0c53413d75ee6dbb363626fd11858a2960
-- 
2.41.0





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

* [bug#64551] [PATCH] svn-download: Use download-nar.
  2023-07-10  9:20 [bug#64551] [PATCH] svn-download: Use download-nar Christopher Baines
@ 2023-07-10 21:48 ` Ludovic Courtès
  2023-07-11  8:34   ` bug#64551: " Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2023-07-10 21:48 UTC (permalink / raw)
  To: Christopher Baines
  Cc: Josselin Poiret, Simon Tournier, Mathieu Othacehe,
	Tobias Geerinckx-Rice, 64551, Ricardo Wurmus

Hi!

Christopher Baines <mail@cbaines.net> skribis:

> This should help if there are issues fetching from the source repository.
>
> * guix/svn-download.scm (svn-fetch): Use download-nar and adjust accordingly.

[…]

> +    (with-imported-modules
> +        (source-module-closure '((guix build svn)
> +                                 (guix build download-nar)
> +                                 (guix build utils)))
> +      (with-extensions (list guile-json guile-gnutls   ;for (guix swh)
> +                             guile-lzlib)

“;for (guix build download-nar)” rather.

Otherwise LGTM, thanks!

Ludo’.




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

* bug#64551: [PATCH] svn-download: Use download-nar.
  2023-07-10 21:48 ` Ludovic Courtès
@ 2023-07-11  8:34   ` Christopher Baines
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Baines @ 2023-07-11  8:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 64551-done

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]


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

> Hi!
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> This should help if there are issues fetching from the source repository.
>>
>> * guix/svn-download.scm (svn-fetch): Use download-nar and adjust accordingly.
>
> […]
>
>> +    (with-imported-modules
>> +        (source-module-closure '((guix build svn)
>> +                                 (guix build download-nar)
>> +                                 (guix build utils)))
>> +      (with-extensions (list guile-json guile-gnutls   ;for (guix swh)
>> +                             guile-lzlib)
>
> “;for (guix build download-nar)” rather.

I copied this comment from (guix git-download), and I think it makes
sense. There shouldn't be any need from (guix build download-nar) to
have guile-json and guile-gnutls, it even specifically avoids using
https for this reason.

I think why these extra inputs is indeed just to import (guix swh as
it's required by (guix build download).

> Otherwise LGTM, thanks!

Great, I've pushed this to tex-team-next now as I'm hoping this will
help fix ci.guix.gnu.org building tex-team-next.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

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

end of thread, other threads:[~2023-07-11  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10  9:20 [bug#64551] [PATCH] svn-download: Use download-nar Christopher Baines
2023-07-10 21:48 ` Ludovic Courtès
2023-07-11  8:34   ` bug#64551: " Christopher Baines

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.