guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Follow-up on julia import script


From: Simon Tournier
Subject: Re: Follow-up on julia import script
Date: Fri, 24 Feb 2023 19:21:03 +0100

Hi,

Thanks for this fresh input! :-)

On ven., 24 févr. 2023 at 17:35, Nicolas Graves via "Development of GNU Guix 
and the GNU System distribution." <guix-devel@gnu.org> wrote:

> - Apparently Nicolo also has a similer code.

I guess, it is that:

https://yhetil.org/guix/8735yi9o9x.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me


> - My approach was a bit different but indeed didn't have the ambition to
>   resolve compatibilities between packages (I need to check that but the
>   check or the build phase should fail it packages are incompatible,
>   thus when trying to build the imported package, we should now which
>   packages should be updated if necessary). If we only restrain imports
>   to the general package repository, then the task becomes much more
>   simple :
>   - from the package name, you can generate the uri of the following
>   files
>   - parse Project.toml to get source information
>   - parse Versions.toml to get source hash information
>   - parse Deps.toml to get information about dependencies

Based on the General registry, it does not appears to me straightforward
too get all the dependencies; without speaking about some synopsis
and/or description and/or license.

Well, I have tried to implement this: as example consider the Julia
package named Zygote,

https://github.com/JuliaRegistries/General/tree/master/Z/Zygote

Assuming some toml parser available in Guile (it is not too hard using
PEG or a very naive approach, but still :-)), from the file
Package.toml, you get the repository address,

https://github.com/FluxML/Zygote.jl

that you clone.  Then from this, you use the file Project.toml to
consider what is inputs and what is propagated-inputs.  Using README, it
is possible to pre-fill the synopsis and description although it is
never accurate.  You also can try to guess license.  Then, you need to
go back to Registry.  And so on.

Here we are dropping the Compat part and the resolver part.  But as you
said, maybe it would be enough.  Well, we are poorly reimplementing what
is builtin with Julia but why not.

(From my point of view, such effort is not worth.  It appears to me a
better strategy to rely on Julia itself.  Note that “guix import
texlive” requires subversion in the path; so I do not see the point to
reimplement some part of Pkg.jl in Guile instead of reusing it, Julia,
not Guile ;-))

Since this last parenthetical statement is probably not consensual ;-),
we discussed with Nicoló to use Guix extensions and wrap the importer
above relying on Pkg.jl (or the one by Jean-Baptiste; I was not aware :-)).

That’s said, another approach is to parse the JSON:

https://docs.juliahub.com/Zygote/4kbLI/0.6.55/pkg.json

and rely on the service JuliaHub.  This could provide some meta data
such as synopsis, description (based on README) and license.

Well, I stopped in the middle of the first approach but it would not
be that hard to resume. :-)  Or feel free to expand you short first
attempt.

Cheers,
simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]