Ticket #227 (assigned defect)

Opened 5 years ago

Last modified 15 months ago

cabal-install doesn't consider build-tools as dependencies

Reported by: guest Owned by: duncan
Priority: normal Milestone: cabal-install-0.16
Component: cabal-install tool Version: 1.2.3.0
Severity: normal Keywords: dependencies build tools
Cc: kazuya@…, ezyang@…, conrad@… Difficulty: hard (< 1 day)
GHC Version: 6.12.3 Platform:

Description

On #haskell, nelhage mentioned that one of the bugs he ran into while trying to install Yi-0.3 through cabal-install was an error which looked like this:

<pre> Installing: /home/gwern/.cabal/lib/regex-posix-0.72.0.2/ghc-6.8.2/regex-posix-0.72.0.2/ghc-6.8.2 Registering regex-posix-0.72.0.2... Reading package info from "dist/installed-pkg-config" ... done. Saving old package config file... done. Writing new package config file... done. 'yi-0.3' is cached. [1 of 1] Compiling Main ( Setup.hs, dist/setup/Main.o ) Linking dist/setup/setup ... Configuring yi-0.3... setup: alex version >=2.0.1&&<3 is required but it could not be found. </pre>

That is, the dependency on Alex (a version which satisfied >=2.0.1&&<3) was not met. Perfectly sensible as he did not have Alex installed. Puzzled, he did a 'cabal install alex', which worked, and then re-started. (I guess he had his GHC installed locally?).

He and I were puzzled, because cabal-install is supposed/usually does track down dependencies. Is build-tools excluded for a reason, or was it just accidentally omitted from dependency-tracking? If the latter, I think this is a bit of a bug.

(I use Cabal-1.2.3.0, btw, and the error message above was my reproduction of Nelhage's problem. I had to uninstall Alex from my system, but that did the trick, and reinstalling bypassed the issue just fine - which is why I hadn't seen it before.)

-- gwern

Change History

Changed 5 years ago by duncan

One problem is that not all build-tools correspond to haskell packages. Some do some don't. We have a hard coded list of them at the moment (which can be extended in Setup.hs files) so we could extend that with what haskell package if any the tools correspond to. Any better suggestions to make it a tad more generic?

Changed 5 years ago by duncan

  • owner set to duncan
  • status changed from new to assigned
  • summary changed from Cabal-install does not track down build-tools: dependencies? to cabal-install does consider build-tools as dependencies

Changed 5 years ago by darrint

Seems like what you need is to be able to determine which packages provide which executables. Alex, for instance, declares that it provides an executable by that name. For the next release of cabal-install, maybe change the package repository metadata format to include more (all?) the cabal info instead of a file list. That will allow you to solve more situations and do a full install plan up front.

Would that work?

Changed 5 years ago by duncan

  • milestone set to Cabal-1.6

Changed 5 years ago by duncan

  • difficulty changed from normal to hard (< 1 day)
  • milestone changed from Cabal-1.6 to cabal-install-0.6

Changed 5 years ago by duncan

  • summary changed from cabal-install does consider build-tools as dependencies to cabal-install doesn't consider build-tools as dependencies

Changed 4 years ago by duncan

See also #342

Changed 4 years ago by duncan

  • milestone changed from cabal-install-0.6 to cabal-install-0.8

Changed 4 years ago by kazuya

  • cc kazuya@… added

Changed 3 years ago by ezyang

  • cc ezyang@… added

Changed 2 years ago by mcandre

  • keywords dependencies build tools added
  • ghcversion changed from 6.8.2 to 6.12.3

I have the same problem with ncurses and c2hs. I'd really like dependencies to be handled automatically whenever possible.

Changed 2 years ago by ConradParker

  • cc conrad@… added

Changed 15 months ago by kosmikus

  • milestone changed from cabal-install-0.8 to cabal-install-0.16
Note: See TracTickets for help on using tickets.