This should probably go into the policy. I've seen this mistake a couple of times.
/usr/bin/ghc and /usr/bin/ghc-pkg are managed by the alternatives system on Debian. That means that when you call ghc or ghc-pkg, you do NOT know whether you are getting ghc5 or ghc6. This has these implications:
1. It is ALWAYS wrong to call ghc or ghc-pkg in postinst/prerm/etc. scripts. Doing that runs the risk of registering your library/package with the wrong ghc installation.
2. It is USUALLY wrong to call ghc or ghc-pkg in debian/rules and related scripts, or to permit Cabal or other build systems to call ghc or ghc-pkg, since you do not know which version of ghc it will get. Exceptions are when you genuinely do not care whether something is built with ghc5 or ghc6.
Possible workarounds:
1. *Prepend* the appropriate /usr/lib/ghc-*/bin directory to PATH -- then you can safely use ghc and ghc-pkg, knowing the appropriate bins will be called.
2. Explicitly call ghc5 or ghc6 (or ghc-pkg-5.x.x or ghc-pkg-6.x.x)
3. Build-Conflict or Conflict with the compiler you do not want to use
-- John
On Wed, Oct 06, 2004 at 10:07:15AM -0500, John Goerzen wrote:
This should probably go into the policy. I've seen this mistake a couple of times.
/usr/bin/ghc and /usr/bin/ghc-pkg are managed by the alternatives system on Debian. That means that when you call ghc or ghc-pkg, you do NOT know whether you are getting ghc5 or ghc6.
Thanks, I've added this to my TODO list.
Possible workarounds:
- *Prepend* the appropriate /usr/lib/ghc-*/bin directory to PATH --
then you can safely use ghc and ghc-pkg, knowing the appropriate bins will be called.
This feels wrong to me.
- Explicitly call ghc5 or ghc6 (or ghc-pkg-5.x.x or ghc-pkg-6.x.x)
Yes. There should really be /usr/bin/ghc-pkg{5,6}.
- Build-Conflict or Conflict with the compiler you do not want to use
Euch, please don't do this, /especially/ conflict. :-)
Thanks Ian
debian-haskell@lists.urchin.earth.li