ocaml / ocaml/dune

"dune top -p <pkg>" tries to pull the dependencies of unrelated vendored executables

Open
#7,586 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build vendoring
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 of dune --version): 3.7.1
  • Version of ocaml (output of ocamlc --version): 5.0.0
  • Operating system (distribution and version): ArchLinux/arm64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.