ocurrent / ocaml-ci

A CI for OCaml projects
https://ocaml.ci.dev
112 stars 74 forks source link

OCaml-CI should search for `opam` file names in pin-depends or vendored git submodules #826

Open MisterDA opened 1 year ago

MisterDA commented 1 year ago

For a package foo, Dune expects or creates a foo.opam file containing the opam package description. ocaml-ci looks for these files, and will also look for opam/foo.opam.

https://github.com/ocurrent/ocaml-ci/blob/e12b7dccea69152a245b691db79d1b52eb94c5e8/lib/pin_depends.ml#L76-L86 https://github.com/ocurrent/ocaml-ci/blob/e12b7dccea69152a245b691db79d1b52eb94c5e8/lib/pin_depends.ml#L140-L144

Historically, or for projects not using the Dune build system (brr, topkg, Oasis, Makefiles…), the opam file is simply named opam. Although ocaml-ci won't work on these projects (as it calls Dune directly and not opam), it should work with these projects being pinned using opam, or vendored: the pin-depends or vendored might carry patches or features necessary for the root project.

This shouldn't be super hard and could also be a nice little case for refactoring a piece of code. I suggest making sure that ocaml-ci stops looking for opam files as soon as the first conforming file is found.