Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dune pkg ignores :dev dependencies #10973

Open
edwintorok opened this issue Sep 29, 2024 · 2 comments
Open

dune pkg ignores :dev dependencies #10973

edwintorok opened this issue Sep 29, 2024 · 2 comments

Comments

@edwintorok
Copy link
Contributor

Expected Behavior

dune utop works

Actual Behavior

dune utop
    Building ocaml.5.2.0        
File "_build/default", line 1, characters 0-0:
Error: Library "utop" not found.
-> required by _build/default/.utop/utop.bc

Reproduction

1.dune init project dune_utop_test
1.cd dune_utop_test
1.Change the depends line to (depends ocaml dune (utop :dev))
1.dune pkg lock
1.dune build
1.dune utop

Specifications

  • Version of dune (output of dune --version):
"Dune Developer Preview: build 2024-09-28T01:30:13+00:00, git revision
17071ec30d10390badcb6cb1f6a43984b1be54a6"
  • Version of ocaml (output of ocamlc --version):
dune exec ocamlc -- --version
5.2.0                               
  • Operating system (distribution and version):
    Fedora 40

Additional information

Would be good if utop and other "tools" could be added to the "dev dependencies" lock, without actually becoming visible/available for the project itself.
opam doesn't really have good support for this either (there is some limited support for installing e.g. the opam monorepo plugin into a tools switch?), but the new dune preview seems to support separate developer tool lockfiles, where tools like the LSP server, and ocamlformat go.

@edwintorok
Copy link
Contributor Author

Actually I'm not sure whether :dev depencies would be the right way to support utop, they're probably more appropriate for optional dependencies (e.g. benchmarking tools) that you do want available in your build environment to activate various optional build rules.

dune already has a dune utop subcommand, so it'd be good if that installed utop as a dev tool automatically, just like how dune fmt installs ocamlformat.

@Leonidas-from-XIV
Copy link
Collaborator

I think the right way in OPAM parlance is to mark these dependencies is to use the :with-dev-setup variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants