-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch to make ocamlfind relocatable (via a binary installer on macOS, Windows, Snap) #60
Comments
Hello @MSoegtropIMC , first of all, welcome to the Findlib community. Relocatibility is a feature that is requested from time to time, but I am still very skeptical. I know that it works for a lot of app programs, but I also know situations where it breaks - in particular for incompatibile libraries and when security problems are not tolerable (like for most professional software). My other remark is that you can already have your own config file and relocate everything there. It is not as convenient because you need an install script, but it is not a big problem either. |
Can you point me to the documentation for the runtime config file? This might indeed be an option - I was not aware of such a mechanism. |
Ah yes - I think I came across it, but discarded the possibility of using it because of:
I can't have a compile time determined or fixed location to look for findlib.conf. |
(Using environment variables is not an option either). |
Well, the patch you propose will break many other installations, so any relocation feature would have to be optional and enabled somehow. It is a bit unclear to me how to do that if you can't even use environment variables. |
The mechanism I am using is to introduce two new configure time variables:
which point to the respective locations at run time. If either of these these variables starts with three leading dots "...", these 3 dots are replaced with the location of the findlib.root file. If |
Just a very brief note that my patches for relocation in the compiler approach the absolute path problem for For |
I tried this, but it does not work for Coq Platform, because the executables end up ind different folders at different levels. |
I maintain the Coq Platform project, which provides binary installers for MacOS, Windows and Linux (snap) for INRIA Coq (a proof assistant). In version 8.16 (autumn 2022) Coq switched to use ocamlfind. Now ocamlfind was not designed with relocation by an installer in mind.
I patched ocamlfind such that it works with relocation.
The main changes are:
findlib.root
or reaches/
.This mechanism has the advantage, that one need not patch files with directories during installation - one just has to put the findlib.root at the proper place, which is no issue on the supported platforms.
This system should have a few 1000 installations meanwhile on macOS, Windows and Snap and I did not hear anything negative. If this is desirable for other ocamlfind users is a different question.
Please let me know what you think and if you would like to see a PR or if you have a better idea I can also keep this as a Coq Platform local patch - it shouldn't kill me to port the patch.
The text was updated successfully, but these errors were encountered: