jordwalke / esy-issues

Easy ISSUES
MIT License
49 stars 5 forks source link

Configure ocamlfind through environment variables #95

Closed andreypopp closed 7 years ago

andreypopp commented 7 years ago

Now we configure ocamlfind via findlib.conf which we generate for each project. Instead we should follow manual and configure it via environment variables (hint: we do same with $PATH currently) which is less fragile.

jordwalke commented 7 years ago

I thought that we do configure via env var OCAMLFIND_CONF?

andreypopp commented 7 years ago

Right but instead of putting a findlib.conf on filesystem we can just provide $OCAMLPATH, $OCAMLFIND_DESTDIR and so on...

jordwalke commented 7 years ago

I see. One benefit to having files is that environment variables are typically dynamically computed. As it is, you can inspect the findlib.conf file to see where things point to. That has helped me debug stuff in the past. Alternatively we could have a findlibEnvVars.sh which is also inspectable.

andreypopp commented 7 years ago

The problem with having findlib.conf is that you need to make sure it is emitted somewhere on filesystem and in-sync with environment. So that right now you can only use Esy env after you attempted esy build which emitted findlib.conf. With purely env var approach everything is contained in the emitted env file (single file). Which you can inspect for debug purposes too!

jordwalke commented 7 years ago

I see! Good point.