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 does not download dependencies in release profile #11375

Open
gridbugs opened this issue Jan 24, 2025 · 2 comments · May be fixed by #11378
Open

Dune does not download dependencies in release profile #11375

gridbugs opened this issue Jan 24, 2025 · 2 comments · May be fixed by #11378

Comments

@gridbugs
Copy link
Collaborator

gridbugs commented Jan 24, 2025

To reproduce, on a machine without opam (so the deps don't accidentally resolve from the opam switch), install the dune dev preview, clone any dune project, and run dune pkg lock && dune build --release. Dune will not attempt to download or build dependencies, and will instead fail due to missing dependencies. Most likely it will first fail due to the lack of ocaml compiler. Install this with the system package manager and rebuild, and then any dependent libraries will fail to resolve. Verify that the problem is related to --release by running dune build which uses the dev preview. In this profile dune will download and build dependencies as expected.

E.g. on a docker container with just the dune dev preview installed as well as some build tools (but not opam or ocaml):

s@0c45e2b82fbe ~
+ $ git clone https://github.com/gridbugs/climate
Cloning into 'climate'...
remote: Enumerating objects: 836, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 836 (delta 65), reused 63 (delta 62), pack-reused 766 (from 1)
Receiving objects: 100% (836/836), 201.89 KiB | 5.18 MiB/s, done.
Resolving deltas: 100% (526/526), done.

s@0c45e2b82fbe ~
+ $ cd climate/

s@0c45e2b82fbe ~/climate (main=)
+ $ dune pkg lock
Solution for dune.lock:
- base.v0.17.1
- base-unix.base
- csexp.1.5.2
- dune-configurator.3.17.1
- jane-street-headers.v0.17.0
- jst-config.v0.17.0
- ocaml.5.3.0
- ocaml-base-compiler.5.3.0
- ocaml-compiler.5.3.0
- ocaml-compiler-libs.v0.17.0
- ocaml-config.3
- ocaml_intrinsics_kernel.v0.17.1
- ppx_assert.v0.17.0
- ppx_base.v0.17.0
- ppx_cold.v0.17.0
- ppx_compare.v0.17.0
- ppx_derivers.1.2.1
- ppx_enumerate.v0.17.0
- ppx_expect.v0.17.2
- ppx_globalize.v0.17.0
- ppx_hash.v0.17.0
- ppx_here.v0.17.0
- ppx_inline_test.v0.17.0
- ppx_optcomp.v0.17.0
- ppx_sexp_conv.v0.17.0
- ppxlib.0.34.0
- ppxlib_jane.v0.17.2
- sexplib0.v0.17.0
- stdio.v0.17.0
- stdlib-shims.0.3.0
- time_now.v0.17.0

s@0c45e2b82fbe ~/climate (main=)
+ $ dune build --release
Error: Program ocamlc not found in the tree or in PATH
 (context: default)
-> required by loading the OCaml compiler for context "default"

# After installing an ocaml compiler with apt-get

s@0c45e2b82fbe ~/climate (main=) 1
+ $ dune build --release
File "tests/unit_tests/dune", line 6, characters 7-22:
6 |   (pps ppx_inline_test ppx_expect))
           ^^^^^^^^^^^^^^^
Error: Library "ppx_inline_test" not found.
-> required by library "climate_unit_tests" in
   _build/default/tests/unit_tests
-> required by _build/default/META.climate_tests
-> required by _build/install/default/lib/climate_tests/META
-> required by _build/default/climate_tests.install
-> required by alias install
File "tests/usage_tests/dune", line 6, characters 7-22:
6 |   (pps ppx_inline_test ppx_expect))
           ^^^^^^^^^^^^^^^
Error: Library "ppx_inline_test" not found.
-> required by library "climate_usage_tests" in
   _build/default/tests/usage_tests
-> required by _build/default/META.climate_tests
-> required by _build/install/default/lib/climate_tests/META
-> required by _build/default/climate_tests.install
-> required by alias install

# Building in dev profile:
s@0c45e2b82fbe ~/climate (main=) 1
+ $ dune build
 Downloading ocaml-compiler.5.3.0
    Building ocaml-compiler.5.3.0
    Building ocaml-base-compiler.5.3.0
    Building base-unix.base
    Building ocaml-config.3
...
@gridbugs
Copy link
Collaborator Author

Repro: #11376

@gridbugs gridbugs linked a pull request Jan 24, 2025 that will close this issue
@rgrinberg
Copy link
Member

As mentioned earlier, this has to be disabled by default to accommodate opam. We could add another flag to override this though.

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

Successfully merging a pull request may close this issue.

2 participants