
skaller wrote:
On Fri, 2007-06-15 at 19:40 -0500, Spencer Janssen wrote:
On Sat, 16 Jun 2007 08:21:50 +1000 skaller
wrote: One way to measure this is: if you removed GHC and applications, and there are (necessarily) no users of the remaining library package .. the library package shouldn't be in the global public place (/usr/lib+include etc).
As I understand it, the entire point of this effort (shared libraries in GHC) is to allow dynamically linked Haskell executables. In this case, applications outside the GHC toolchain will in fact depend on these shared objects. As a concrete case, a binary darcs package could be a user of libghc66-base.so and libghc66-mtl.so -- with no dependencies on the GHC compiler package itself.
Does this pass your litmus test?
Yes, it passes the separability test. My darcs wouldn't run otherwise! And versioning the library filename as above is a good idea too.
Felix adds _dynamic for shared libs and _static for static link archives to ensure the Linux linker doesn't get confused.
However, the libs still aren't fully public if the interfaces are only private details of the GHC tool chain. Hmmm.
Under the current system, darcs is linked statically so it is a self- contained executable. Under the proposed shared-library system versioning the shared libraries may pose a very big problem and I don't think it would pass your litmus test. As I mentioned previously, GHC is a fast-moving target and there are quite a few GHC- Haskell-based applications available that rely on different versions of the compiler. Here is an example: There are any number of GHC-Haskell-based programs, all built with different versions of GHC; GHC itself relies on some of these to build, such as Happy and Alex. (There are .rpm packages for Alex.) You already talked about the situation from there: several different programs relying on different versions of the shared libraries, located in /usr/local/lib--and they don't rely on just one library. As is, the GHC runtime system has more than a few base libraries, the minimum set of which is: HSrts HSbase HSbase_cbits With dynamically linked libraries on OS X, the convention was to have add the suffix _dyn, so we had: HSrts_dyn, HSbase_dyn and HSbase_cbits_dyn Now each GHC-Haskell-based program installer would search /usr/local/ lib for, say, libHSrts_dyn-6.6.1.dylib and install that version if necessary. What happens on uninstall? The same thing you get on Windows when you have another program using a particular .DLL--the uninstall of that version of the library would fail but for unix systems _only_ if you also have another program using at while you are doing the uninstall. So if you did not break everything on each install, eventually you have a complete mess of different versions of GHC libraries in /usr/local/lib that may have no current use but at one time were used for several GHC-Haskell-based programs that have now been upgraded to use something different. Hopefully those who distributed the binary programs adopted a convention of using the full version of the library instead of symlinking libHSrts_dyn-6.6.1 to libHSrts_dyn, or as a user several of your older programs might break after a later one installed a new version of the library and symlinked that the new version... That is why I think your idea was good: put everything into distinct directories. Cheers, Pete

On Mon, Jun 18, 2007 at 11:56:57AM -0400, Peter Tanski wrote:
Now each GHC-Haskell-based program installer would search /usr/local/ lib for, say, libHSrts_dyn-6.6.1.dylib and install that version if necessary. What happens on uninstall? The same thing you get on Windows when you have another program using a particular .DLL--the uninstall of that version of the library would fail but for unix systems _only_ if you also have another program using at while you are doing the uninstall. So if you did not break everything on each install, eventually you have a complete mess of different versions of GHC libraries in /usr/local/lib that may have no current use but at one time were used for several GHC-Haskell-based programs that have now been upgraded to use something different. Hopefully those who distributed the binary programs adopted a convention of using the full version of the library instead of symlinking libHSrts_dyn-6.6.1 to libHSrts_dyn, or as a user several of your older programs might break after a later one installed a new version of the library and symlinked that the new version...
That is why I think your idea was good: put everything into distinct directories.
Debian's high level package manager will automatically garbage collect dependancies, such that every package on your system is either manually selected for install or a dependant of one. Thus there is no library leak problem. Stefan

On Jun 18, 2007, at 6:06 PM, Stefan O'Rear wrote:
On Mon, Jun 18, 2007 at 11:56:57AM -0400, Peter Tanski wrote:
Now each GHC-Haskell-based program installer would search /usr/local/ lib for, say, libHSrts_dyn-6.6.1.dylib and install that version if necessary. What happens on uninstall? ...
That is why I think your idea was good: put everything into distinct directories.
Debian's high level package manager will automatically garbage collect dependancies, such that every package on your system is either manually selected for install or a dependant of one. Thus there is no library leak problem.
The Debian package system (I assume you are referring to apt, or maybe dpkg?) is very convenient (and relatively quick!). I don't know how well the BSD-style package systems garbage collect but I have not had any problems using port or fink--though sometimes they pull more dependancies than they need because installed programs outside their system are (wisely) not considered. Since my best machine is a Mac (PowerBook G4, 1.25GHz) the lost libraries become a problem as soon as I work independently of a package system. I expect the same would be true for anyone working independently. Some individual languages have their own package systems, such as Lisp's asdf; OCaml has GODI. Haskell is moving in that direction with Cabal but it is still more of a build system than anything else and in any case it would probably be better to keep with the system packaging setup, such as Debian's, for program distribution. That way GHC libraries may reside comfortably in the standard system directories but I am still a little querulous. I would rather all haskell libraries use the standard (OS X) DYLD_LIBRARY_PATH, though DYLD_FALLBACK_LIBRARY_PATH (putting things in $(home)/lib) might help for the haskell-universe. That may be the solution for programs, though it requires more work: Haskell would need packaging. On a related note, if anyone is interested, once we get an idea of where we want to put things I can modify the installer script to create an OS X pkg (using PackageMaker) for GHC binary distributions. At least that would make removal easier (using Desinstaller). The old 6.4.1 OS X application install was slick; I might redo that. Cheers, Pete

Peter Tanski wrote:
Now each GHC-Haskell-based program installer would search /usr/local/lib for, say, libHSrts_dyn-6.6.1.dylib and install that version if necessary. What happens on uninstall? The same thing you get on Windows when you have another program using a particular .DLL--the uninstall of that version of the library would fail but for unix systems _only_ if you also have another program using at while you are doing the uninstall. So if you did not break everything on each install, eventually you have a complete mess of different versions of GHC libraries in /usr/local/lib that may have no current use but at one time were used for several GHC-Haskell-based programs that have now been upgraded to use something different. Hopefully those who distributed the binary programs adopted a convention of using the full version of the library instead of symlinking libHSrts_dyn-6.6.1 to libHSrts_dyn, or as a user several of your older programs might break after a later one installed a new version of the library and symlinked that the new version...
That is why I think your idea was good: put everything into distinct directories.
We are not intending to build-in any particular knowledge about where shared libraries are to be installed - that's up to the packager. With one exception - we have to pick a default for the .tar.bz2 binary distributions (and 'make install'), and the only default that makes sense is to install the shared libraries in the standard location, /usr/local/lib. Otherwise the system will not find them, and GHC itself will not run (assuming it is dynamically linked). You don't get good uninstall support, but that's always been the way if you don't use the system package manager. Cheers, Simon

On Jun 19, 2007, at 4:05 AM, Simon Marlow wrote:
Peter Tanski wrote:
Now each GHC-Haskell-based program installer would search /usr/ local/lib for, say, libHSrts_dyn-6.6.1.dylib and install that version if necessary. What happens on uninstall?... That is why I think your idea was good: put everything into distinct directories.
We are not intending to build-in any particular knowledge about where shared libraries are to be installed - that's up to the packager.
Definitely. It would be non-portable if GHC baked the install directory into the shared library install_name (using libtool lingo) whenever a programmer (or Cabal) invoked ghc --make.
With one exception - we have to pick a default for the .tar.bz2 binary distributions (and 'make install'), and the only default that makes sense is to install the shared libraries in the standard location, /usr/local/lib. Otherwise the system will not find them, and GHC itself will not run (assuming it is dynamically linked). You don't get good uninstall support, but that's always been the way if you don't use the system package manager.
I advocated putting everything in /usr/local/lib/ghc/ghc-$(version) earlier. The dynamic-library system used for ghc-6.4 on OS X worked fine; do you remember any problems when that was put together? Stefan O'Rear seemed against flooding /usr/local/lib with ghc- libraries--I'll admit my own /usr/local/lib is a bit messy even considering I use 'port' for quite a few programs--but also argued that the dynamic libraries should not go in the /usr/local/lib/ghc-$ (version). The de-facto standard for systems that have C or C++- compliant dynamic libraries seems to be: shared libraries go in: /usr/local/lib static libraries or system-specific libraries go in: /usr/local/lib/$(system)/$(system_version) or $(build)/$(system_version) So for nhc98, the static libraries are in /usr/local/lib/nhc98/$ (build); for yhc, the .ycr files are in /usr/local/lib/yhc/packages/ yhc-base/$(yhc_version); for felix the .flx files (as source code) are in /usr/local/lib/felix/$(felix_version)/lib; for ocaml, the .cmx and .cmi files go in /usr/local/lib/ocaml; but for chicken-scheme the dynamic libraries (only really usable through the chicken interface but definitely "pure" C in the end) are in /usr/local/lib. I should not neglect to say the same goes for python, although . The one exception seems to be for gcc's libstdc++, which has a symlink in the same directory as the static libraries. Following what I--perhaps mistakenly--called the 'de facto' standard, if ghc dynamic libraries are callable from C (they are), then the dynamic libraries should go into /usr/local/lib. I would highly suggest that symlinking an un- versioned name to each version would create a mess, so the library names should only follow the real version. Stefan does have a point, so the default installer might place dynamic libraries in a user library directory such as $(home)/lib--a real consideration for students and others who work on a large shared system where the sysadmin does not want to support yet another language installation. What seems backwards (to me) are the Haskell programs: it would be fine if the standard install for program static libraries and interfaces went into the ghc-$(version) directory but they don't and when we had dynamic libraries on OS X they followed the static library convention: each program is installed into /usr/local/lib/$ (program) or $(program)-$(version). Some programs place libraries directly into the program directory while others place the libraries under a $(haskell_compiler)-$(haskell_compiler_version) directory. This duplicates the ghc system of /usr/local/lib/ghc-$(version) for each Haskell program and creates a real mess--more so than other languages. I agree, this is not really GHC's problem but the ghc location might help, which is why I suggested /usr/local/lib/ghc/ghc-$ (version). It might even be extendable to all of Haskell: ghc should go into /usr/local/lib/haskell/ghc-$(version), so, say, yhc could go into /usr/local/lib/haskell/yhc and the installed programs would go into /usr/local/lib/haskell/$(compiler). Much cleaner and much easier for a package system to manage. I have written too much on this, so I'll shut up--whatever you decide is fine; I'll fix the install script to create a PackageMaker .pkg following whatever you decide and post it if you want it. Cheers, Pete
participants (3)
-
Peter Tanski
-
Simon Marlow
-
Stefan O'Rear