Question

Alors, c'est un peu un problème personnel, mais peut-être les gens auront de bons conseils ou des solutions de contournement.

Le problème est sur l'installation de cabale installer et haskell-plate-forme sous Debian.

Lorsque vous apt-get install haskell-platform, il est livré avec cabal-install, et sa commande cabal est disponible.

Maintenant, ce cabal-install est pas à jour:

> which cabal
/usr/bin/cabal
> /usr/bin/cabal --version
cabal-install version 0.8.0
using version 1.8.0.2 of the Cabal library

Mais, ma compréhension de cabal update est en cours d'exécution que les mises à jour cabale, mais comme il n'est pas un « Debian thingy », il le met dans ~/.cabal/bin/.

> ~/.cabal/bin/cabal --version
cabal-install version 0.8.2
using version 1.8.0.2 of the Cabal library

Maintenant, mon système a 2 cabales, et celui que je reçois en tapant cabal n'est pas celui que je veux utiliser ... Parce que ça va constamment mettre à jour l'autre au lieu de lui-même, et est donc inefficace.

Alors que je l'ai été, j'Aliased dans mon ~/.bashrc:

alias cabal='~/.cabal/bin/cabal'

> cabal --version
cabal-install version 0.8.2
using version 1.8.0.2 of the Cabal library

Alors, ma dernière question:

  • Y at-il un dépôt deb qui détient cabale 0.8.2?
  • ce que mon avance actuelle de solution aux problèmes? (Par exemple, which cabal encore des points à mon /usr/bin/cabal inutile, donc si les scripts utilisent cette commande ils vont se laisser berner ...)
  • que quelqu'un est venu avec une meilleure solution? (Le mien est un peu ad hoc, mais qui est tout ce que je pouvais venir avec mon mauvaise connaissance de ce qui se passe dans les coulisses ...)
  • S'il vous plaît me corriger si tout ce que je dis ci-dessus est faux ou inexact.
Était-ce utile?

La solution

What I do is installing cabal with the --global flag. This will install cabal into /usr/local/bin/cabal, thus it will always superseed the Debian packages cabal.

Another way, is to generally avoid the Debian packages and install the Haskell platform straight from its source. This approach is also better, if you always want to have the latest releases of the Haskell libs.

Autres conseils

I keep my user-local $HOME/.cabal/bin in the front of the PATH. I install only ghc6, ghc6-prof, ghc6-doc and cabal-install from the distribution packages. I don't use distribution cabal-install for anything more than to bootstrap the new ~/.cabal. All the rest I install with cabal install, including the newer cabal itself.

When I want to use newer GHC, I deploy it in /usr/local/stow/ghcVERSION, and enable it with GNU stow (it adds symlinks in /usr/local which, again, has precedence in my PATH). When I want to switch back to the distribution GHC I just run stow -D to remove all symbolic links to it.

I consider using cabal-dev to have project-specific cabal installations, and avoid broken dependencies which happen with cabal from time to time.

As a matter of fact I don't use Haskell Platform at all because I don't need all of it and find it easier to be able to install individual libraries. I do not install distribution libraries, because not all of them are available or are exactly the versions I need; and it is much easier to control conflicts if all of them are installed in the same place (~/.cabal in my case). I do not install anything with --global, because I think it is wrong and difficult to rollback.

Of course this information gets out of date, but yes, Debian unstable and testing have, at the time of writing, cabal-install 0.10.2.

Generally, the Debian packaging of Haskell stuff is aimed at users who want a set of packages that is known to work together, i.e. no dependency hell, at the expense of not always having the latest and greatest. This includes cabal-install. I use cabal-install from the repositories, and only to install those libraries that have not been packaged for Debian yet.

Disclaimer: I am one of the guys that create those packages for Debian.

On Ubuntu I also tend to install GHC via stow, ignoring the system packages altogether.

One slight twist from jetxee's approach is that I do install the Haskell Platform (from source), lumping it in with the GHC stow directory. I suppose I ought to call the paths /usr/local/stow/haskell-platform-VERSION, but I tend to use /usr/local/stow/ghc-VERSION instead.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top