Dune can only understand opam repos matching the layout of opam-repository
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the repository and lock_dir configuration in dune-workspace, then use the dependency declaration in dune-project to trace how repository packages are discovered. Reproduce the Jane Street repository case and verify that packages are found when each opam file has a parent directory named ., regardless of the higher-level layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100