"dune top -p <pkg>" tries to pull the dependencies of unrelated vendored executables
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Expected Behavior
For dune top -p <pkg> to not pull unrelated dependencies
Actual Behavior
dune top -p <pkg> pulls unrelated dependencies
Reproduction
$ cat dune-project
(lang dune 2.0)
(package (name a))
$ cat dune
(vendored_dirs vendored)
$ cat a/dune
(library
(public_name a))
$ cat vendored/dune-project
(lang dune 2.0)
$ cat vendored/dune
(executable
(name test)
(libraries base))
If base is not installed on your system, dune top -p a will return the expected:
#directory "/tmp/test/_build/default/a/.a.objs/byte";;
#load "/tmp/test/_build/default/a/a.cma";;
However if base is installed, the same command will return:
#directory "/home/kit_ty_kate/.opam/default/lib/base";;
#directory "/home/kit_ty_kate/.opam/default/lib/base/base_internalhash_types";;
#directory "/home/kit_ty_kate/.opam/default/lib/base/caml";;
#directory "/home/kit_ty_kate/.opam/default/lib/base/shadow_stdlib";;
#directory "/home/kit_ty_kate/.opam/default/lib/sexplib0";;
#directory "/tmp/test/_build/default/a/.a.objs/byte";;
#load "/tmp/test/_build/default/a/a.cma";;
#load "/home/kit_ty_kate/.opam/default/lib/base/base_internalhash_types/base_internalhash_types.cma";;
#load "/home/kit_ty_kate/.opam/default/lib/base/caml/caml.cma";;
#load "/home/kit_ty_kate/.opam/default/lib/sexplib0/sexplib0.cma";;
#load "/home/kit_ty_kate/.opam/default/lib/base/shadow_stdlib/shadow_stdlib.cma";;
#load "/home/kit_ty_kate/.opam/default/lib/base/base.cma";;
Specifications
- Version of
dune(output ofdune --version): 3.7.1 - Version of
ocaml(output ofocamlc --version): 5.0.0 - Operating system (distribution and version): ArchLinux/arm64
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
Reproduce the behavior using dune-project, dune, a/dune, vendored/dune-project, and vendored/dune from the report, then inspect how dune top -p a determines dependencies for vendored executables. Compare the generated directives with and without the installed base package. Done means unrelated vendored dependencies are absent from the command output; no specific test file is mentioned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100