guix-patches
[Top][All Lists]
Advanced

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

[bug#49958] [PATCH] More flexibility in opam importer


From: Alice BRENON
Subject: [bug#49958] [PATCH] More flexibility in opam importer
Date: Mon, 9 Aug 2021 14:04:07 +0200

Hello,

I'd like to submit this patch for review, discussion and hopefully
inclusion to guix' code. I recently tried to import grew[0], a NLP tool
written in ocaml and distributed with opam but from a custom repository.

The current importer prevented me to do so for several reasons:

- the available repositories were hard-coded to be either opam's
  official repository or coq's
- the repositories were expected to be distributed with git: while
  public git repositories do exist for coq and opam's official
  repository, they are not the source of truth for the opam tool one
  can use in an imperative setup like this:
    `opam repo add coq-released https://coq.inria.fr/opam/released`
  it entailed that assumptions were made about the freshness of the git
  repositories and the actual files served to opam, hence differences
  could theoretically be observed
- it appears that the opam tool doesn't enforce as strict a structure on
  its repositories as its current documentation[1] suggests. Grew's own
  repository has all versions of each package directly under
  `/packages/` instead of in a separate subdirectory. While this
  deserves a clarification from opam's part, this patch hardens guix
  opam importer against such exotic layouts.
- the unability to query several repositories at once rendered
  recursive imports inefficient, as some packages on a custom
  opam repository may still need dependencies from the official opam
  repository even if no guix package has been imported for it yet (this
  was the case with ocaml-ANSITerminal in my case)

The current proposal attempts to solve these difficulties, and allowed
me to actually import the guix declaration for grew and its
dependencies. I'm still fixing the imported declaration and intend to
submit a separate patch to add it to guix packages when it works. I
added grew's custom opam repository to the list of known-repositories
because it was my immediate target but this is of course not important
and could be reverted in favour of coq and opam's official repository
only.

I used the emacs scripted auto-indenter to save a little time to my
reviewers and had to discard many changes that weren't related to my
changes to cut the noise. Maybe this file should be reindented in a
separate commit following the approval or rejection of this patch
proposal.

Cheers,


Alice

[0]: https://grew.fr/
[1]: https://opam.ocaml.org/doc/Manual.html#Repositories

Attachment: 0001-guix-opam.patch
Description: Text Data


reply via email to

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