"Mathieu Boespflug" <[email protected]> writes:

> Hi all,
>
> GHC currently has 3 tier-1 platforms: Linux, macOS and Windows. I'll
> focus the dicussion below on these three platforms. The binary
> distributions for Linux and macOS are designed to be unpacked, then
> the user types ./configure && make install. This is not the case for
> Windows.
>
> On all platforms it's possible to create "relocatable" installations,
> such that GHC doesn't really care where it's installed, and commands
> will still work if the install directory changes location on the
> filesystem. So my question is, why do we have a ./configure step on
> Linux and macOS? Why could we not have bindists for all platforms that
> work like the Windows one? I.e. a binary distribution that you just
> unpack, in any directory of your choice, without any configuration or
> installation step.

There are a few reasons:

 * Relocatable GHC builds have only been supported for only a few
   releases now and only under the Hadrian build system, which is not
   currently used to produce our binary distributions (hopefully this
   will change for 9.2).

 * On Windows we have the luxury of having a very well-controlled
   environment as we rely on essentially nothing from the host
   system. We provide our own mingw toolchain, statically link
   against libc, and have no additional dynamic dependencies.

   By contrast, on Linux we have to deal with a much larger
   configuration space:

    * several linkers, each with their own bugs

    * several C compilers, supporting various subsets of functionality
      and quirks (e.g. some distributions enable -pie by default, others
      do not)

    * various LLVM packaging schemes

   Since it would be quite expensive to probe the toolchain
   characteristics on every compiler invocation, we rather do this once
   in the configure script during bindist installation and package the
   result in the installed `settings` file.

 * On Linux we may have additional dynamic dependencies (e.g. libdw,
   numactl) which we check for during configuration time, lest the user
   be faced with an unsightly linker error if they happen to be missing
   a library.

In principle we could perhaps avoid the need for many of these checks
by creating one binary distribution per operating system distribution.
However, we will first need to move to Hadrian to build our binary
distributions.

Cheers,

- Ben

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ghc-devs mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to