How to use https://github.com/ocaml/ocaml.org/blob/main/playground/ocamlorg-playground.opam

I think the makefile contains all the commands you need to run, but you can get into a bit of bother if you run things in the wrong order. You need to run make deps which will install the dependencies of the playground in the playground switch. However, if you ran make first, it created a 5.0.0 compiler switch (no deps installed) and then you can’t run make deps because that will try to recreate the switch and opam will complain so I would just copy and run the command manually i.e.

opam install . --deps-only --switch=playground

Then you should be able to run make build which will invoke dune build in the context of this switch and with the playground directory as the root.

If you were starting from scratch (with no playground switch) you should be able to run make deps && make build.

1 Like