dune icon indicating copy to clipboard operation
dune copied to clipboard

Dune can only understand opam repos matching the layout of opam-repository

Open gridbugs opened this issue 11 months ago • 0 comments

Opam repositories do not need to conform to the directory hierarchy convention set by opam-repository. This is documented in opam's manual. However dune makes some assumptions that all opam repos will organize their packages in a directory hierarchy like "packages//./opam". In reality as long as every opam file under "packages" has a parent directory named like <name>.<version> it should work.

Expected Behavior

Jane Street's bleeding edge repo is an example of an opam repo that we want to support with dune package management that uses a different directory layout than opam-repo.

Actual Behavior

Currently any packages in an opam repo that aren't located in the expected location as per opam-repository's layout convention are invisible to dune; it won't consider them when solving dependencies.

Reproduction

Put this in your dune-workspace to add Jane Street's bleeding edge repo to your project's opam repos:

(lang dune 3.17)

(repository
 (name janestreet-bleeding)
 (url git+https://github.com/janestreet/opam-repository.git))

(lock_dir
 (repositories upstream overlay janestreet-bleeding))

Try depending on a package from that repo in dune-project, and dune will be unable to resolve the dependency (or resolve it to a package with the same name from the upstream or overlay repo).

gridbugs avatar Apr 08 '25 06:04 gridbugs