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 hints to install missing dependencies but doesn't know how to build an executable in vendored dependencies #4192

Closed
MisterDA opened this issue Feb 3, 2021 · 1 comment

Comments

@MisterDA
Copy link
Contributor

MisterDA commented Feb 3, 2021

I'm working with docker-base-images which has vendored dependencies. I'm trying to execute a program that's defined in one of the vendored dependencies, ocluster. If dune doesn't find the dependencies of ocluster in the current switch, it hints the external-libs-deps command, but when running that function it does not know anymore how to build that executable.

Is external-lib-deps using a different name resolution scheme from exec? Either they could use the same, or the hint should point to the correct path.

$ git clone --recursive https://github.com/ocurrent/docker-base-images.git
$ opam install -y --deps-only .
$ dune exec -- ocluster-scheduler.exe --version
File "bin/dune", line 5, characters 12-27:
5 |  (libraries dune-build-info ocluster-api logs.fmt fmt.tty capnp-rpc-unix cluster_scheduler cluster_worker prometheus-app.unix db))
                ^^^^^^^^^^^^^^^
Error: Library "dune-build-info" not found.
Hint: try:
  dune external-lib-deps --missing ocluster-scheduler.exe
$ dune external-lib-deps --missing ocluster-scheduler.exe
Error: Don't know how to build ocluster-scheduler.exe

Changing directories to that vendored dependency (or symlinking to it) doesn't help as Dune is smart enough to position itself at the project's root. My current workaround is to clone separately the dependencies and build them once.

EDIT: or I can use the path to the binary as is:

$ dune external-lib-deps --missing ocluster/bin/scheduler.exe
Error: The following libraries are missing in the default context:
- digestif
- dune-build-info
- obuilder
- psq
Hint: try:
  opam install digestif dune-build-info obuilder psq
@MisterDA
Copy link
Contributor Author

MisterDA commented Mar 2, 2021

Fixed by #4298, I guess.

@MisterDA MisterDA closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant