unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: Nicolas Graves <ngraves@ngraves.fr>, guix-devel@gnu.org
Cc: "Jean-Baptiste Volatier" <jbv@pm.me>,
	"Nicolò Balzarotti" <anothersms@gmail.com>,
	"Ludovic Courtès" <ludo@gnu.org>
Subject: Re: Follow-up on julia import script
Date: Fri, 24 Feb 2023 19:21:03 +0100	[thread overview]
Message-ID: <87o7pilyb4.fsf@gmail.com> (raw)
In-Reply-To: <87a61358ej.fsf@ngraves.fr>

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	other threads:[~2023-02-24 18:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 16:35 Follow-up on julia import script Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-02-24 18:21 ` Simon Tournier [this message]
2023-02-25 10:11   ` Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-02-25 12:19     ` Simon Tournier
2023-02-25 18:23       ` Ludovic Courtès
2023-02-27 10:14         ` Simon Tournier
2023-02-27 11:37           ` Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-02-27 13:46             ` Simon Tournier
2023-02-27 18:01               ` Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-02-28  9:25                 ` Simon Tournier
2023-03-06 11:23             ` Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-03-07 11:52               ` Simon Tournier
2023-03-15 12:43 ` Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-03-18 11:17   ` Nicolas Graves via Development of GNU Guix and the GNU System distribution.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7pilyb4.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=anothersms@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=jbv@pm.me \
    --cc=ludo@gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).