haskell / haskell-platform

Distribution of Haskell with batteries included
http://www.haskell.org/platform/
Other
381 stars 91 forks source link

Automatically bring cabal packages forward with Platform install? #43

Open r0ml opened 10 years ago

r0ml commented 10 years ago

Before installing the Haskell Platform, I had several versions of GHC installed, each with their own associated libraries. That was more by accident than on purpose, as I had not uninistalled older version of GHC.

Regardless, when I installed the platform, I had to install all those cabal packages again. That might get annoying if each new release of the Haskell platform requires me to rebuild my environment.

Note that I am talking about cabal packages that do NOT come with the Platform. I recognize Platform-included packages will be upgraded automatically by each install.

Note that I installed on Windows XP, but I don't think this is a OS-specific issue.

r0ml commented 10 years ago

Doesn't this already work on Unix-likes? The package.conf file is by default stored under $HOME/.ghc on these systems, and cabal-install installs to $HOME/.cabal, so the newly-installed GHC should pick up old up libraries out of the box (if the GHC versions are compatible).

On Windows, cabal-install modifies the system-wide package.conf and installs to $PROGRAMFILES\Haskell, so we'd need to merge the old package.conf file with the new one. This is something I'm considering for the next release.

r0ml commented 10 years ago

I'm not sure there's a lot we can do in general. Certainly everything needs rebuilding when we install new ghc versions. When a minor release includes the same ghc version then it's safe to re-register existing ghc packages if and only if the ABIs match. We currently have no way of checking if the ABIs match (though we may do with GHC 6.12 and later).

r0ml commented 10 years ago
  1. At the very least, we can assume that ABIs match iff the GHC versions match.
  2. It shouldn't be very hard to build a database of this information manually.
r0ml commented 10 years ago

So we need a tool that re-registers the existing packages iff the GHC versions match, and rebuilds them otherwise. Maybe this should be integrated with cabal-install (cabal upgrade-ghc?).