Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

package findlib? #4

Closed
protz opened this Issue · 18 comments

2 participants

Jonathan Protzenko Edgar Friendly
Jonathan Protzenko
Owner

S. Le Gall somehow would like to see findlib included. This sounds reasonable, but the findlib code seems to hardcode the path to OCaml at compile-time. There's probably further work needed to make sure it is integrated smoothly.

Edgar Friendly

While I agree with findlib being installed on any system where packages are compiled from source, on an point-and-click install of ocaml, I might think that binary packages would be better, and these wouldn't need findlib. Is there any expectation that further packages be installable?

Jonathan Protzenko
Owner

I'm not familiar with findlib at all, so please excuse my ignorance :-).

  • If we distribute a binary package, is there a way to register it with findlib somehow?
  • If the user builds the package from source, is it a "plus" to have findlib installed?

I'm unsure as to what the strategy should be: provide additional packages downloadable in binary form, that go along with the ocaml installer, or tell people to install a development environment (say, msys) and build packages themselves...

Edgar Friendly

AFAIK, you just have to put the files in a named subdir of the findlib directory for it to know about them. hmm, thinking more, findlib is still useful for binary packages because it handles dependencies between packages
For building a package from source, it is a plus to have findlib, as it makes installation of that package trivial. (Just give META file and list of files needed to use library)

For maximum ease of use, binary packages that go along with the current installer seems like the best plan.

Jonathan Protzenko
Owner
Edgar Friendly
Jonathan Protzenko
Owner
Edgar Friendly
Jonathan Protzenko
Owner
Edgar Friendly
Jonathan Protzenko
Owner

Hi,

Taking some time to take core of the OCaml installer for windows. I just took a closer look at findlib, and from what I gathered, even the path to findlib.conf is determined at compile-time. That means the binary has it hardcoded that findlib.conf should be found at let config_file = "c:/Program Files (x86)/OCaml/etc/findlib.conf";; or whatever it is on my computer (because I'm the one generating the installer).

I think, on Windows, findlib shouldn't try to be smart. It should:

  • try to see if there's an environment variable OCAMLLIB defined or,
  • fallback to Filename.concat Sys.argv.(0) "../lib/" (more concats needed here, of course).

Thoughts?

I could package findlib, but it would break as soon as the user picks a non-standard install location. I could make sure that the hardcoded path for findlib.conf is something like c:\findlib.conf so that later on I can override everything with an installer-generated findlib.conf but that sounds ugly as well...

Edgar Friendly

Just set the environment variable OCAMLFIND_CONF.

From the man pages,
The default location of the configuration file findlib.conf. However, you can set a different location by the environment variable OCAMLFIND_CONF.

Jonathan Protzenko
Owner
Jonathan Protzenko
Owner

http://yquem.inria.fr/~protzenk/caml-installer/ocaml-4.01.0+dev0-i686-mingw64.exe has findlib installed.

I had to generate the lib/topfind file "by hand", because it clearly depends on the absolute location of the ocaml setup. I also had to export more variables in the findlib.conf file.

Thanks for all the good pointers!

jonathan

Jonathan Protzenko protz closed this
Edgar Friendly
Jonathan Protzenko
Owner
Edgar Friendly
Edgar Friendly

Actually, odb for windows should probably just do binary distribution and extract pre-compiled libraries for very simple install. I'll base these binaries on your distribution, unless you have a better idea.

Jonathan Protzenko
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.