library infrastructure roundup
Tue, 17 Jun 2003 22:52:52 +0100
On Tuesday 17 June 2003 12:43 pm, Simon Marlow wrote:
> Actually I think this is not the right way to go. It should be the
> package manager on the host system that tells the build system where it
> wants to keep stuff.
[Rereading this, I see I misunderstood 'package manager'.
I read it as 'ghc-pkg' and friends when you meant the debian/ redhat/ windows
package manager that is used for installing all software on the machine.]
I agree that the decision lies with the people who package libraries and must
conform with guidelines for the individual platform. But I think that
compiler writers can help implement whatever decision those people make.
An easy way of doing this is for compilers to always consult a configuration
file which says where globally and locally installed libraries are located.
A ghc distribution might come with certain default locations baked into it
but those would be overridden if the configuration file is found. This is
easy for people packaging ghc to deal with because all they have to do is
provide a config file which contains the platform preferences.
Suppose we do this and you go to install a library. Where should the library
be installed? Obviously, it should go in the place that the platform
maintainers prefer. How can you find where that is? By consulting the
configuration file. Does this mean you're asking ghc where to put files?
No, what you're doing is asking the ghc package (which includes config files
that the ghc hackers did not write) where to install the library.
Even if the way you read the config file is by calling some ghc-config or ghc
--print-config=libdir, it doesn't change the fact that the ghc hackers aren't
making the choice of where libraries are installed - they're merely making it
easy for the package maintainers to express their choice.