[PATCH] svn-download: Use download-nar.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 2 years ago
(address . guix-patches@gnu.org)
dce2c889886e47ffe7da7b87f2bdf69d7018e65b.1688980854.git.mail@cbaines.net
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(-)

Toggle diff (70 lines)
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
Ludovic Courtès wrote 2 years ago
(name . Christopher Baines)(address . mail@cbaines.net)
87zg435tgf.fsf@gnu.org
Hi!

Christopher Baines <mail@cbaines.net> skribis:

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

[…]

Toggle quote (7 lines)
> + (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’.
Christopher Baines wrote 2 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 64551-done@debbugs.gnu.org)
87cz0y4zdh.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (19 lines)
> 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).

Toggle quote (2 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmStFOpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xf9Og//cbZaYX1nfqGX2O4NyuXPVH2aAbs4yE3Y
mr6bkyOuW3zTZa/jW3OiQEqgt/kz4wq0RpfsohgJkvFnafUmoeA88XIO3fASMk9R
O5/dIQKAeC7SR/QCXjj5WMNeZLe/byMylP4sqZF4CqQXgimDFflvs4mvyhCR41R/
YBgXKOlKr0LFnq9PlW96FkLWJsoUFd4jYhKUfuxucDHGBq5yYwg9jmfQuHcD5v4H
XIpKrB7D1xCm3rQQkOnynvpVmWFl5j78EYiAH73iIFIztHPBj/QEuUDZv9NTcjI+
BjvNKxO5On/mnEzwd9JtDmneE9CdIsi/6IJlYC8U8VzwNyqgD1EvPz54btC3e3Um
JvST1yZhSNqJeNdL2eBlWd6fq/nsiEI+EuaVpWdG3SA3qDEQNOC70MSK2Nqz/tdD
zCvZ7ktfq1iiem3WSmxIFbm+4qlpeONFaAbF3UEq03M7hOphnWJ3clXgwwfKP9Qa
l7PueZWe4ykLQahT2rmt+6/QlfG20f1q0z0xXsi5XVuv927/d7fUic+Cqq6tbPUZ
Jf0nHXQIlWC8u2IiQANY2zfMnGU/m6ZQfRtXb2mRj5aNVLSzxfGan7H6SEnyV8tz
Y2PG9h5AE5YsoFEwI+nY9nIYjwTnPnpvli5vwMfhgqglDOW4sNJ+oeHnbF0Srewk
k9GYkko7PE0=
=m0QW
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 64551@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 64551
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help