Open angrygoats opened 8 years ago
If you use utop, it shouldn't be a problem since it does its own initialization of findlib, so you don't need the #use "topfind";;
line.
For the stock toplevel, this error seems normal to me according to the package description -- topfind is installed by default in the same directory as ocaml, but as it isn't possible with nix, the patch makes it installed aside findlib, and the toplevel can't find it. I think the simplest workaround would be to create a wrapper for ocaml which searches for a topfind file in the correct directory.
@regnat thank you for your reply. I am still learning nixos so I apologize if this is a dumb question, but wrapper? How do I do that? If you could point me to somewhere in the manual to get me started that'd be great!
I meant creating a derivation (a "package" in nix terminology) containing a script to launch ocaml with the correct include path. this should do it -- the makeWrapper
function is described here if you want some more infos about it.
To add it to your packages, you can use http://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides.
Tell me if anything is unclear
@angrygoats, if everything is OK, can you close the issue ? (I don't have the rights to do it myself)
I think the suggestion to make ocaml (the top-level) a topfind aware wrapper is still relevant and not yet done.
Fix is still incomplete I only addressed utop and not ocaml itself.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
See https://discourse.nixos.org/t/ocaml-utop-on-nixos-not-detecting-libraries/1587 for using utop
as an alternative.
I marked this as stale due to inactivity. → More info
Issue description
It seems that findlib doesn't install topfind even though the package implies it should here in this patch. This is a problem, utop with
Core.Std
requires it.Steps to reproduce
My nix config is available here for my development software.
The relevant packages are installed as follows:
Now create a
.ocamlinit
in your root directory (~
) and place the following in it:Now, type
ocaml
. You will be greeted by:Cannot find file topfind.
Technical details