diff mbox series

[bug#43442,1/2] gnu: mpfi: Replace 'url-fetch' by 'svn-fetch'.

Message ID 20200916081642.6716-1-zimon.toutoune@gmail.com
State New
Headers show
Series [bug#43442,1/2] gnu: mpfi: Replace 'url-fetch' by 'svn-fetch'. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Simon Tournier Sept. 16, 2020, 8:16 a.m. UTC
Fixes <https://bugs.gnu.org/42162>.

* gnu/packages/multiprecision.scm (mpfi)[source]: Replace 'url-fetch' by
'svn-fetch'.
---
 gnu/packages/multiprecision.scm | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Ludovic Courtès Sept. 21, 2020, 9:19 p.m. UTC | #1
Hi!

zimoun <zimon.toutoune@gmail.com> skribis:

> Fixes <https://bugs.gnu.org/42162>.
>
> * gnu/packages/multiprecision.scm (mpfi)[source]: Replace 'url-fetch' by
> 'svn-fetch'.

[...]

> +       (method svn-fetch)
> +       (uri (svn-reference
> +             (url "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
> +             (revision 688)))

Does this have any chance of working with SWH?  Does their HTTP API
support looking up svn revision for a given origin URL?

Also:

  scheme@(guile-user)> (lookup-origin "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
  $6 = #f

So the effect today would be the opposite of what we’re attempting: when
GForge goes down, we’d lose it completely.

Thoughts?

Ludo’.
Simon Tournier Sept. 21, 2020, 9:51 p.m. UTC | #2
Hi,

On Mon, 21 Sep 2020 at 23:19, Ludovic Courtès <ludo@gnu.org> wrote:

>> +       (method svn-fetch)
>> +       (uri (svn-reference
>> +             (url "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
>> +             (revision 688)))
>
> Does this have any chance of working with SWH?  Does their HTTP API
> support looking up svn revision for a given origin URL?

Well, I have not yet did my homework on the topic, neither asked on
#swh-devel.

Probably not!

In any case, we should find a way because there are a lot of Subversion
sources. 


> Also:
>
>   scheme@(guile-user)> (lookup-origin "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
>   $6 = #f

Since “guix lint -c archival” I should have forgotten to submit the
request via their Web interface.  Now, it is scheduled:

  <https://archive.softwareheritage.org/save/#requests>


> So the effect today would be the opposite of what we’re attempting: when
> GForge goes down, we’d lose it completely.

I agree.


Well, the shutdown of the INRIA’s GForge is a concrete deadline to add
the support of Subversion (and Mercurial) sources to:

 - fallback to SWH
 - guix lint -c archival

I am working on it. :-)


All the best,
simon
Ludovic Courtès Sept. 23, 2020, 4:21 p.m. UTC | #3
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Mon, 21 Sep 2020 at 23:19, Ludovic Courtès <ludo@gnu.org> wrote:
>
>>> +       (method svn-fetch)
>>> +       (uri (svn-reference
>>> +             (url "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
>>> +             (revision 688)))
>>
>> Does this have any chance of working with SWH?  Does their HTTP API
>> support looking up svn revision for a given origin URL?
>
> Well, I have not yet did my homework on the topic, neither asked on
> #swh-devel.
>
> Probably not!
>
> In any case, we should find a way because there are a lot of Subversion
> sources. 

Yes, we should implement it.  But until that is done, I’m not sure it’s
worth replacing tarballs with svn references.  WDYT?

>> Also:
>>
>>   scheme@(guile-user)> (lookup-origin "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
>>   $6 = #f
>
> Since “guix lint -c archival” I should have forgotten to submit the
> request via their Web interface.  Now, it is scheduled:
>
>   <https://archive.softwareheritage.org/save/#requests>

‘lookup-origin’ still returns #f though.

>> So the effect today would be the opposite of what we’re attempting: when
>> GForge goes down, we’d lose it completely.
>
> I agree.
>
>
> Well, the shutdown of the INRIA’s GForge is a concrete deadline to add
> the support of Subversion (and Mercurial) sources to:
>
>  - fallback to SWH
>  - guix lint -c archival
>
> I am working on it. :-)

Awesome.

(Note that it seems possible that the shutdown of gforge.inria.fr will
be delayed a bit or at least be made less brutally that initially
announced.)

Thanks,
Ludo’.
Simon Tournier Sept. 23, 2020, 5:07 p.m. UTC | #4
On Wed, 23 Sep 2020 at 18:22, Ludovic Courtès <ludo@gnu.org> wrote:
> zimoun <zimon.toutoune@gmail.com> skribis:
>
> > On Mon, 21 Sep 2020 at 23:19, Ludovic Courtès <ludo@gnu.org> wrote:
> >
> >>> +       (method svn-fetch)
> >>> +       (uri (svn-reference
> >>> +             (url "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
> >>> +             (revision 688)))
> >>
> >> Does this have any chance of working with SWH?  Does their HTTP API
> >> support looking up svn revision for a given origin URL?
> >
> > Well, I have not yet did my homework on the topic, neither asked on
> > #swh-devel.
> >
> > Probably not!
> >
> > In any case, we should find a way because there are a lot of Subversion
> > sources.
>
> Yes, we should implement it.  But until that is done, I’m not sure it’s
> worth replacing tarballs with svn references.  WDYT?

I do not have a strong opinion.

> >> Also:
> >>
> >>   scheme@(guile-user)> (lookup-origin "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
> >>   $6 = #f
> >
> > Since “guix lint -c archival” I should have forgotten to submit the
> > request via their Web interface.  Now, it is scheduled:
> >
> >   <https://archive.softwareheritage.org/save/#requests>
>
> ‘lookup-origin’ still returns #f though.

Weird because SWH says it is in. Requests at 21/09/2020, 23:47:09 then
click. :-)

 - scheduled: 21/09/2020, 23:47:21
 - start: 21/09/2020, 23:47:24
 - end: 21/09/2020, 23:53:26
 - log: [2020-09-21 21:53:26,098: INFO/ForkPoolWorker-1] Task
swh.loader.svn.tasks.DumpMountAndLoadSvnRepository[b13942f6-b415-4831-b25f-e68bd4515cf2]
succeeded in 361.4525023885071s: {'status': 'eventful'}

Well, the issue is:

- Not in: https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi
<https://archive.softwareheritage.org/browse/search/?q=https%3A%2F%2Fscm.gforge.inria.fr%2Fanonscm%2Fsvn%2Fmpfi%2Ftrunk%2Fmpfi&with_visit=true&with_content=true>

+ In: https://scm.gforge.inria.fr/anonscm/svn/mpfi
<https://archive.softwareheritage.org/browse/search/?q=https%3A%2F%2Fscm.gforge.inria.fr%2Fanonscm%2Fsvn%2Fmpfi&with_visit=true&with_content=true>

as you can see here:

<https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://scm.gforge.inria.fr/anonscm/svn/mpfi>


> (Note that it seems possible that the shutdown of gforge.inria.fr will
> be delayed a bit or at least be made less brutally that initially
> announced.)

Good to know. :-)

All the best,
simon
Ludovic Courtès Sept. 25, 2020, 8:56 a.m. UTC | #5
Hi!

zimoun <zimon.toutoune@gmail.com> skribis:

> as you can see here:
>
> <https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://scm.gforge.inria.fr/anonscm/svn/mpfi>

Oh indeed:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix swh)
scheme@(guile-user)> (lookup-origin "https://scm.gforge.inria.fr/anonscm/svn/mpfi")
$14 = #<<origin> visits-url: "https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visits/" type: #f url: "https://scm.gforge.inria.fr/anonscm/svn/mpfi">
scheme@(guile-user)> (origin-visits $14)
$15 = (#<<visit> date: #<date nanosecond: 902765 second: 25 minute: 53 hour: 21 day: 21 month: 9 year: 2020 zone-offset: 0> origin: "https://scm.gforge.inria.fr/anonscm/svn/mpfi" url: "https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visit/1/" snapshot-url: "https://archive.softwareheritage.org/api/1/snapshot/e7fdd4dc6230f710dbc55c1b308804fa1b5f51f0/" status: full number: 1>)
scheme@(guile-user)> (visit-snapshot (car $15))
$16 = #<<snapshot> branches: (#<<branch> name: "HEAD" target-type: revision target-url: "https://archive.softwareheritage.org/api/1/revision/f7b445a6bdc38bf075f29265120ca49824f698ea/">)>
--8<---------------cut here---------------end--------------->8---

Note that the original svn revision number is discarded, AFAICS.

Ludo’.
Simon Tournier Oct. 1, 2020, 8:26 p.m. UTC | #6
Hi Ludo,

On Fri, 25 Sep 2020 at 10:56, Ludovic Courtès <ludo@gnu.org> wrote:

> Note that the original svn revision number is discarded, AFAICS.

No, it is not... but to find it one needs a bit of guidance by SWH folks. :-)

1. With the URL, fetch:
https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visit/latest/

2. From #1 one gets 'snapshot' and fetch:
https://archive.softwareheritage.org/api/1/snapshot/e7fdd4dc6230f710dbc55c1b308804fa1b5f51f0/

3. From #3, one gets the 'target' and fetch:
https://archive.softwareheritage.org/api/1/revision/f7b445a6bdc38bf075f29265120ca49824f698ea/log/

And #3 lists all the revisions in SWH.

Well, this should be enough for the saving request.  WDYT?


However, it is not clear how to fetch cooking from the vault.  To be
continued...

Cheers,
simon
Simon Tournier Oct. 1, 2020, 9:01 p.m. UTC | #7
On Thu, 1 Oct 2020 at 22:26, zimoun <zimon.toutoune@gmail.com> wrote:

> 1. With the URL, fetch:
> https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visit/latest/
>
> 2. From #1 one gets 'snapshot' and fetch:
> https://archive.softwareheritage.org/api/1/snapshot/e7fdd4dc6230f710dbc55c1b308804fa1b5f51f0/
>
> 3. From #3, one gets the 'target' and fetch:
> https://archive.softwareheritage.org/api/1/revision/f7b445a6bdc38bf075f29265120ca49824f698ea/log/
>
> And #3 lists all the revisions in SWH.
>
> Well, this should be enough for the saving request.  WDYT?
>

> However, it is not clear how to fetch cooking from the vault.  To be
> continued...

From #3, using 'directory' (4193e93b4aea0abeaff715b1a1274c4d7eb4a27d),
it seems possible to cook from the vault and get the tarball (I did
with the web interface).  And the integrity field (guix hash -r) is
the same as the one I put in the patch submission.
Ludovic Courtès Oct. 3, 2020, 8:59 a.m. UTC | #8
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Fri, 25 Sep 2020 at 10:56, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> Note that the original svn revision number is discarded, AFAICS.
>
> No, it is not... but to find it one needs a bit of guidance by SWH folks. :-)
>
> 1. With the URL, fetch:
> https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visit/latest/
>
> 2. From #1 one gets 'snapshot' and fetch:
> https://archive.softwareheritage.org/api/1/snapshot/e7fdd4dc6230f710dbc55c1b308804fa1b5f51f0/
>
> 3. From #3, one gets the 'target' and fetch:
> https://archive.softwareheritage.org/api/1/revision/f7b445a6bdc38bf075f29265120ca49824f698ea/log/
>
> And #3 lists all the revisions in SWH.

Ah yes, under “extra_headers” there’s the SVN revision number.  (guix
swh) doesn’t expose “extra_headers” yet, but once it does, we can walk
snapshots until we find the SVN revision we’re looking for.

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (lookup-origin "https://scm.gforge.inria.fr/anonscm/svn/mpfi/")
$3 = #<<origin> visits-url: "https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visits/" type: #f url: "https://scm.gforge.inria.fr/anonscm/svn/mpfi">
scheme@(guile-user)> (origin-visits $3)
$4 = (#<<visit> date: #<date nanosecond: 902765 second: 25 minute: 53 hour: 21 day: 21 month: 9 year: 2020 zone-offset: 0> origin: "https://scm.gforge.inria.fr/anonscm/svn/mpfi" url: "https://archive.softwareheritage.org/api/1/origin/https://scm.gforge.inria.fr/anonscm/svn/mpfi/visit/1/" snapshot-url: "https://archive.softwareheritage.org/api/1/snapshot/e7fdd4dc6230f710dbc55c1b308804fa1b5f51f0/" status: full number: 1>)
scheme@(guile-user)> (visit-snapshot (car $4))
$5 = #<<snapshot> branches: (#<<branch> name: "HEAD" target-type: revision target-url: "https://archive.softwareheritage.org/api/1/revision/f7b445a6bdc38bf075f29265120ca49824f698ea/">)>
--8<---------------cut here---------------end--------------->8---

So the next step is to augment (guix swh) with a
‘lookup-subversion-revision’ procedure.

Thanks for investigating!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index b3a5ec5894..f1b152d9aa 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -7,6 +7,7 @@ 
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,6 +33,7 @@ 
   #:use-module (gnu packages texinfo)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix svn-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu))
 
@@ -157,14 +159,15 @@  precision and correctly rounds the results.")
 (define-public mpfi
   (package
     (name "mpfi")
-    (version "1.5.4")
+    (version "1.5.4-688")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://gforge.inria.fr/frs/download.php"
-                           "/latestfile/181/mpfi-" version ".tgz"))
+       (method svn-fetch)
+       (uri (svn-reference
+             (url "https://scm.gforge.inria.fr/anonscm/svn/mpfi/trunk/mpfi")
+             (revision 688)))
        (sha256
-        (base32 "0mismr1ll3wp788dq2n22s5irm0dziy75byyfdwz22kjbmckhf9v"))))
+        (base32 "13pqkdvi8maj0mm76zh8p7jcc4c4569zh4kq336shh9cxlrh8qqx"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f                      ;tests are broken in this release