[Haskell-cafe] Fwd: Compatibility etiquette for apps, with cabal sandboxes and `stack`

Michael Orlitzky michael at orlitzky.com
Sun Nov 29 20:46:42 UTC 2015

On 11/29/2015 02:39 PM, Omari Norman wrote:
> So there's a distribution out there where end users pull source from
> Hackage, pull source for every dependency, and then build it all with
> GHC?  If they're not doing what distributors like Debian does--building
> binaries--then what's the point of distributing at all?

Sure, all of the source-based distributions use the upstream tarball and
compile it. The point of creating a "package" is so that you can have a
real package manager manage your dependencies. Since most of the
dependency info is contained in the cabal file, the packages are usually
trivial. Gentoo, Nix, and FreeBSD all have tools that will convert a
hackage package into a distribution package automatically.

>     When using a real package manager, every package's dependencies must be
>     satisfied simultaneously.
> True, but ouch, ultimately this is one factor that pushed me out of
> desktop Linux altogether.  It's too hard to get packages for things I
> want to use, and then I'm fending for myself by building things. 
> Centrally-planned packaging does not scale.

Given that almost all Linux systems in existence uses centrally-planned
packaging, I don't believe that last claim. How many programs can you
realistically keep installed and up-to-date with stack? Ten, twenty
maybe -- if this is a serious hobby for you. One or two hundred if it's
your full-time job?

A typical Linux system will have hundreds of packages, and a system
administrator will need to manage tens or hundreds of those systems.
It's just not possible to do with something like stack -- you need one
package manager that does everything.

I'm not saying you need to rely on e.g. Debian upstream to create
packages for you (I certainly don't), but you do need to have "system"
packages for everything installed. This actually isn't very hard with
those automated tools I mentioned earlier.

>     Using stack isolates the developer from
>     dependency conflicts with other packages during development, but when a
>     user goes to install it, he doesn't have that luxury.
> He does if he uses stack.  Grab a stack binary.  It even installs GHC
> for the user.

If the user is highly technical and he wants to make stack
administration his weekend activity. Otherwise, this isn't feasible for
more than one or two packages.

You can easily convince yourself of this: set up ten virtual machines,
and install 20 packages using stack on each of them. Now keep them
up-to-date for a year. If you're very good at bookkeeping and time
management, it might even be possible. But it's not going to be a fun
year. And 200 packages is barely enough to boot a single web server.

More information about the Haskell-Cafe mailing list