Giter Site home page Giter Site logo

Comments (3)

talex5 avatar talex5 commented on July 21, 2024

I think the solution to this is:

  1. Use dune to generate the opam files.
  2. Make sure dune generates them correctly.

Dune knows which libraries go in each package, and which other libraries they depend on. It also knows which opam package those libraries are from. It should therefore be able to warn you if you fail to declare a dependency on an internal or external library.

(dune already added a check for the related problem of depending on another package using its internal name: ocaml/dune#3727)

from ocaml-ci.

craigfe avatar craigfe commented on July 21, 2024

For dune to solve this issue completely, it would need to also consider the cases of cyclic dependencies (annotated with post) and the distinction between test dependencies and normal dependencies. It seems to me that these are ultimately Opam's problem.

Also note that Dune's support for opam file generation is quite limited at the moment, often requiring us to use the .template fallback. These limitations would need to be lifted in order for Dune to become the real solution here. (c.f. ocaml/dune#3770, ocaml/dune#3653, ocaml/dune#3497.)

from ocaml-ci.

talex5 avatar talex5 commented on July 21, 2024

I've made a separate linter that should help with this: https://github.com/talex5/dune-opam-lint/
It's currently enabled for testing (in #285).

It works by checking that every entry in your dune file has the corresponding opam package listed in the package's opam file.
It's not quite the same as installing each package separately, but it will catch some cases that doesn't (e.g. a transitive dependency that works today but may disappear later).

It doesn't check internal dependencies at the moment, but dune can do that itself if generating the opam files (strict_package_deps).

from ocaml-ci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.