mbox

[bug#38408,v9,0/8] recursive semver crate importer!

Message ID cover.1580817140.git.mjbecze@riseup.net
Headers show

Message

Martin Becze Feb. 4, 2020, 12:18 p.m. UTC
Here is the another version of the recursive semver crate importer! And hopefully the best one so far. The first 3 commits actully implement the and add semver support. The rest are mainly ergonomics such as
* triming version numbers from package name
* better deduplication of dependencies
* top level importing of development dependenies

I think it has incorpated the feedback i got from everyone so far, but if i forgot something or if there is more to add let me know!

Cheers
~Martin

Martin Becze (8):
  guix: import: (recursive-import) Allow for version numbers
  guix: import: crate: Use semver to resovle module versions
  Added Guile-Semver as a dependency to guix
  guix: import: utils: allow generation of inputs to be version aware
  guix: import: crate: deduplicate dependencies
  guix: import: crate: memorize crate->guix-package
  guix: import: utils: trim patch version from names
  guix: import: parametrized importing of dev dependencies

 configure.ac                        |   7 +
 doc/guix.texi                       |   2 +
 gnu/packages/package-management.scm |   7 +-
 guix/import/cran.scm                |   8 +-
 guix/import/crate.scm               | 111 +++++++----
 guix/import/elpa.scm                |   6 +-
 guix/import/gem.scm                 |   6 +-
 guix/import/opam.scm                |   5 +-
 guix/import/pypi.scm                |   5 +-
 guix/import/stackage.scm            |   5 +-
 guix/import/utils.scm               |  79 +++++---
 guix/scripts/import/cran.scm        |   5 +-
 guix/scripts/import/crate.scm       |  13 +-
 guix/scripts/import/elpa.scm        |   4 +-
 tests/crate.scm                     | 289 ++++++++++++++++------------
 tests/elpa.scm                      |   3 +-
 tests/import-utils.scm              |   8 +-
 17 files changed, 346 insertions(+), 217 deletions(-)

Comments

Leo Famulari Feb. 20, 2020, 6:53 p.m. UTC | #1
On Tue, Feb 04, 2020 at 07:18:17AM -0500, Martin Becze wrote:
> Here is the another version of the recursive semver crate importer! And hopefully the best one so far. The first 3 commits actully implement the and add semver support. The rest are mainly ergonomics such as
> * triming version numbers from package name
> * better deduplication of dependencies
> * top level importing of development dependenies

Wow, this is great! It makes it possible to get a (very close to)
working rav1e package. The only things really missing are non-Rust
dependencies of rav1e but I think that is not in scope for your
importer.

> I think it has incorpated the feedback i got from everyone so far, but if i forgot something or if there is more to add let me know!

A minor bug: Sometimes if a dependency is already existing, the importer
will construct its variable name incorrectly.

For example, some of the packages I imported require version 2.33 of
rust-clap.  We already have this package, and the variable is named
'rust-clap-2', but the importer makes the packages depend on
'rust-clap-2.33'. It has to be adjusted by hand.

You should be able to reproduce the bug with the following command. It
doesn't matter if guile-semver is a hard dependency or autoloaded.

`guix environment guix --ad-hoc guile-json guile-semver -- ./pre-inst-env guix import crate --recursive rav1e`

Also, it prints the skip-build? argument on multiple lines, like this...

#:skip-build?
#t
Martin Becze Feb. 21, 2020, 8:35 a.m. UTC | #2
On 2/20/20 1:53 PM, Leo Famulari wrote:
> 'rust-clap-2', but the importer makes the packages depend on
> 'rust-clap-2.33'. It has to be adjusted by hand.

Thats actually not a bug, I think we probably should change rust-clap-2 
-> rust-clap-2.33.

> 
> Also, it prints the skip-build? argument on multiple lines, like this...
> 
> #:skip-build?
> #t

Yeah that is annoying, its a problem with (ice-9 pretty-print). Would be 
nice to fix.
Martin Becze Feb. 21, 2020, 4:29 p.m. UTC | #3
ah good to know. So one option is that we can change the importor to 
resolve the exported symbols of the package, but I think it add a bit of 
complexity. Once semver is in, I might give it a shot though.

On 2/21/20 7:15 AM, Efraim Flashner wrote:
> 
> 
> On February 21, 2020 8:35:31 AM UTC, Martin Becze <mjbecze@riseup.net> wrote:
>>
>>
>> On 2/20/20 1:53 PM, Leo Famulari wrote:
>>> 'rust-clap-2', but the importer makes the packages depend on
>>> 'rust-clap-2.33'. It has to be adjusted by hand.
>>
>> Thats actually not a bug, I think we probably should change rust-clap-2
>> -> rust-clap-2.33.
>>
> 
> Talking to others at FOSDEM the other distro maintainers are pretty sure that all of the rust-clap-2 versions should be compatible, and similarly for other packages with a major version other than 0. So I'd personally prefer to change them to just the major version (and keep it as rust-clap-2).
> 
>>>
>>> Also, it prints the skip-build? argument on multiple lines, like this...
>>>
>>> #:skip-build?
>>> #t
>>
>> Yeah that is annoying, its a problem with (ice-9 pretty-print). Would be
>> nice to fix.
>