Why wasn't Cabal made a full package manager? [closed]
Asked Answered
S

1

13

(Before I start: I'm going to use Cabal for Everything that has Cabal in its name and has something to do with Haskell.)

Having had the usual "you need to update X to install Y, but this will break dependency Z" issue again the other day, I thought I'd just ask: why was Cabal not designed to be a full package manager, especially with the following features:

  • Versioning: install multiple versions of a package alongside each other, let packages pick the desired dependencies. If no package version is specified, use the latest one available.
  • Update packages - or better, also install the newest version.
  • Remove packages
  • Check package integrity

You see where this list is going. Right now, to me Cabal feels like a somewhat sophisticated build system (try finding out which version of Base your package requires when you want to start using it for the first time), that comes with a half-baked package installer.

So the question again: Why wasn't Cabal made a full-featured build/package system? I'm sure there was some design decision that led to the current state.

(This question was somewhat inspired by a rant on Reddit, but contrary to that guy don't mean to offend anyone by the above.) :-)

Shing answered 29/10, 2012 at 21:50 Comment(8)
This question should probably be on reddit as well--too far removed from the sort of programming questions that belong on SO.Downstairs
From the FAQ on questions to ask here: "software tools commonly used by programmers"? Check. "practical, answerable problems that are unique to the programming profession"? Check.Shing
Are you volunteering to flesh out Cabal into a full package manager?Backbreaker
@Shing But it's not a question about how to use a software tool, or about technical details of the tool, it's about why it is the way it is. There's definitely a grey area, because "why" questions often have specific objective technical answers. But when the answer would have to talk to why certain people in the past made the decisions they did, or why certain potential uses for the tool weren't foreseen or just haven't been fully addressed yet, the question becomes very hard to answer objectively.Osmen
We have free will and we can choose to deliberately disobey the Stack Overflow guidelines. I know I certainly plan on reopening this if people close it.Lyric
I'd suggest to move this question to programmers.stackexchange.com - there would be an appropriate place for it.Vernverna
Yes, @Osmen is correct. Questions of the form "why did certain people make a particular, not directly code-related, decision" are really outside the scope of SO, even if related to development tools otherwise.Downstairs
Just saying; imo cabal should have nothing more than a build tool.Kaule
D
10

Installing multiple versions of the same package works perfectly well right now (try cabal install ansi-terminal-0.5.4 && cabal install ansi-terminal-0.5.5), but installing multiple instances of the same package version doesn't. This is something we'd very much like to support, since that would allow us to implement hermetic builds and solve the "dependency hell" problem, but it's not entirely trivial. There was a GSoC project this year to add support for multiple instances to ghc-pkg and Cabal, but the patches aren't in the mainline yet. Here's a video of the HIW 2012 talk about the project's results, and here's the description of the internal design.

As to your other questions, there actually used to be a cabal upgrade command for installing the latest versions of all currently installed packages, but it was removed since it could break your installation (again, having support for multiple instances of the same package version would fix this). Uninstallation support has been on the wish list for a while now, it's just that no-one had time to implement it yet. I guess that the same goes for digitally-signed packages and HTTPS.

Additionally, if you're interested in seeing some of these features implemented, patches to Cabal are always welcome, and with the move to GitHub it became easier than ever to contribute code (contributing cash is also fine if you can afford it - I think Well-Typed will be very happy to talk to you about this).

Update (September 2016): for an update on the current state of affairs see this post by Edward Z. Yang: cabal new-build is a package manager.

Debar answered 30/10, 2012 at 1:4 Comment(1)
I'm struggling to understand how to maintain my Haskell configuration (as someone with a pip/Python model of how things "ought" to work). For example, suppose that the Haskel Platform changes (say GHC is updated). What do I need to do to update my configuration, which includes (a) several additional packages, and (b) IHaskell, which is (c) installed into Jupyter? Do I need to remove the platform, re-install it, reinstall my additional packages with Cabal, reinstall IHaskel, and re-run ihaskell install?Burial

© 2022 - 2024 — McMap. All rights reserved.