Cannot build Core locally

When I clone https://github.com/janestreet/core and run make, I get the following:

File "uuid_unix/src/jbuild", line 5, characters 14-30:
5 |               core_kernel.uuid))
                  ^^^^^^^^^^^^^^^^
Error: Library "core_kernel.uuid" not found.
Hint: try: dune external-lib-deps --missing @install
File "src/jbuild", line 4, characters 16-107:
4 |   (action (bash "cp ${findlib:core_kernel.config_h:config.h} ${findlib:core_kernel.config_h:thread_id.h} ."))))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Public library "core_kernel.config_h" not found
make: *** [default] Error 1

I run dune external-lib-deps --missing @install and get:

Done: 0/0 (jobs: 0)Error: The following libraries are missing in the default context:
- core_kernel.config_h
- core_kernel.uuid
Hint: try: opam install core_kernel

I run opam install core_kernel and get:

[NOTE] Package core_kernel is already installed (current version is v0.11.1).

Any suggestions to help me fix my setup?

If you want to build development version of jane street packages, it’d help to use their opam repository: https://github.com/janestreet/opam-repository

What usually works is to see which package is required, and then check it out within the source tree of core, which will make dune pick up the local checkout and not the installed one.

This is required because the Jane Street packages depend on each other’s git versions, so installing an older release of the dependency might work but not always.