Dune should not look up other sub-directories when given `-p`
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
When investigating the issue ligo's developers have here https://github.com/ocaml/dune/issues/2131#issuecomment-550475432 with @rgrinberg, we discovered that, when given a directory containing two sub-directories with two projects like so:
+ /
- dune-project
+ project-a/
- dune-project
- project-a.opam
- [...]
+ project-b/
- dune-project
- project-b.opam
- [...]
dune build @install, even when given -p project-a, will scan for every packages used by project-b, thus, if opam install some of them at the same time, a race condition can occur in the same way as it happened in https://github.com/ocaml/dune/issues/2131
Here is a sample of the strace for dune build -p ocplib-resto with this archive:
stat("/home/kit_ty_kate/.opam/4.07.1/lib/ocaml/stdlib.dune", 0x7ffed0b53020) = -1 ENOENT (No such file or directory)
stat("/home/kit_ty_kate/.opam/4.07.1/lib/tezos-protocol-environment-sigs/dune-package", 0x7ffed0b530c0) = -1 ENOENT (No such file or directory)
stat("/home/kit_ty_kate/.opam/4.07.1/lib/tezos-protocol-environment-sigs/META", 0x7ffed0b530a0) = -1 ENOENT (No such file or directory)
stat("/home/kit_ty_kate/.opam/4.07.1/lib/META.tezos-protocol-environment-sigs", 0x7ffed0b530a0) = -1 ENOENT (No such file or directory)
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 by reproducing the dune build @install and dune build -p project-a commands with two nested projects, then trace how Dune discovers projects and packages. Done means selecting project-a no longer scans or looks up packages from project-b, while the reported build still works.
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