Controlling precedence of data_only_dirs vs vendored_dirs
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
-
The current stage of dune about directory status is:
You can't have
data_only_dirsandvendored_dirsat the same time and that is logic.> cat dune (vendored_dirs subproject) (data_only_dirs subproject) > dune build Error: Directory subproject was marked as data_only and vendored, it can't be marked as both.But you can have
(dirs :standard \ subproject)combine with(data_only_dirs subproject)or(vendored_dirs subproject).The status
(data_only_dirs subproject)or(vendored_dirs subproject)override(dirs :standard \ subproject), why this specification ?And what is weird to me is
(dirs :standard \ subproject)is equivalent to(data_only_dirs subproject). -
The need we have is at the moment is:
A possibility,(dirs :standard \ subproject)overridedata_only_dirsand/orvendored_dirsinstead inverse. This avoids the conflict(ocaml-dockerfile) described below.An example: this is a partial tree of solver-service
> tree solver-service solver-service |_ dune |_ dune-project |_ ocaml-dockerfile |_ dune-project |_ ocaml-ci |_ dune |_ dune-project |_ ocaml-dockerfile |_ dune-project > cat solver-service/dune (vendored_dirs ocaml-dockerfile) ... > cat soler-service/ocaml-ci/dune (vendored_dirs ocaml-dockerfile) ... > cd solver-service > dune build Error: Too many opam files for package "dockerfile-opam": - ocaml-ci/ocaml-dockerfile/dockerfile-opam.opam - ocaml-dockerfile/dockerfile-opam.opam -
The central point of this PR is to introduce or improve the spec around
statuses:Getting the prioritization as following
(dirs :standard \ subproject)->(data_only_dirs subproject)->(vendored_dirs subproject).It is opened to modification, to get the possibility that
(dirs :standard \ subproject)overridedata_only_dirsand/orvendored_dirswithout touching the previous relation betweendata_only_dirsandvendored_dirs.
Originally posted by @moyodiallo in https://github.com/ocaml/dune/issues/6577#issuecomment-1514553706
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
No implementation files or tests are named. Start by reproducing the two dune build examples from issue #7589, then trace how dirs, data_only_dirs, and vendored_dirs statuses are specified and prioritized. Done means the precedence is explicitly specified and the nested ocaml-dockerfile case no longer produces the conflicting package-discovery result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100