I’m trying to create an ocsigen project from scratch to use it with the Nix package manager. This is the repository I have now. Sadly, when I try to run it with ocsigenserver -c todo_ocsigen.conf, I get the following error:
.ocsigenserver-wrapped: main: Fatal - While loading /nix/store/43d97qz3ph3k67d65bs2xzbn7wz76bxm-ocaml5.1.1-eliom-10.4.1/lib/ocaml/5.1.1/site-lib/eliom/server/eliom_server.cma: no implementation available for Ocsipersist
It doesn’t seem to be a problem with findlib, because utop can locate ocsigen-sqlite. What can I possibly be missing, in this case?
Are you using Ocsipersist 1 or 2?
Did you test without Nix?
The error message seems to indicate that ocsipersist is loaded but not ocsipersist-sqlite (ocsipersist contains the interface and ocsipersist-sqlite is an implementation of this interface).
What is strange is that you load ocsipersist-sqlite before eliom in the config file (which is ok) but you get the error message when you load Eliom (as if you loaded ocsipersist instead of ocsipersist-sqlite) …
I don’t know anything about Nix but why isn’t ocsipersist-sqlite in the same section as the others?
Both Eliom and ocsipersist-sqlite should be runtime dependencies.
I put ocsipersist-sqlite in that other section because it wasn’t being detected, so I kept trying more “visible” sections than the others. There are some different build inputs in Nix:
buildInputs
nativeBuildInputs
propagatedBuildInputs
propagatedNativeBuildInputs
I tried all of them before giving up and asking here.
I forgot to reply, but I cannot use your repository, the build fails with both nix develop and nix build.
I think I’ll give up on Ocsigen while they’re replacing dynamic linking with static linking. However, Nix should probably support Ocaml’s dynamic linking stuff better.