Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

cabal-install tries to upgrade the base package #167

Closed
bos opened this Issue May 24, 2012 · 7 comments

Comments

Projects
None yet
1 participant
Contributor

bos commented May 24, 2012

(Imported from Trac #174, reported by @dcoutts on 2007-11-12)

When using ghc-6.6.x, with some packages, cabal-install tries to upgrade the base package to satisfy dependnecies. This is obviously impossible. The dependency resolution mechanism needs to be taught this fact.

Contributor

bos commented May 24, 2012

(Imported comment by guest on 2007-11-12)

Replying to duncan:

When using ghc-6.6.x, with some packages, cabal-install tries to upgrade the base package to satisfy dependnecies. This is obviously impossible. The dependency resolution mechanism needs to be taught this fact.

Here's what I tried:

$ cabal install fastcgi
Data/List.hs:18:1: lexical error at character 'i'

$ cabal info fastcgi

Requested: fastcgi -any
Using: fastcgi-3000.0.0 Depends: base >=2.0, cgi >=3000.0.0 Options: Location: [http://hackage.haskell.org/packages/archive/fastcgi/3000.0.0/fastcgi-3000.0.0.tar.gz](http://hackage.haskell.org/packages/archive/fastcgi/3000.0.0/fastcgi-3000.0.0.tar.gz) Local: *Not downloaded
Requested: base >=2.0
Installed: base-2.1.1
Requested: cgi >=3000.0.0
Using: cgi-3001.1.5.1 Depends: base >=3, old-time -any, old-locale -any, containers -any, base >=2&&<3, network >=2.0, parsec >=2.0, mtl >=1.0, xhtml >=3000.0.0 Options: Location: [http://hackage.haskell.org/packages/archive/cgi/3001.1.5.1/cgi-3001.1.5.1.tar.gz](http://hackage.haskell.org/packages/archive/cgi/3001.1.5.1/cgi-3001.1.5.1.tar.gz) Local: *Not downloaded
Requested: base >=3
Using: base-3.0.0.0 Depends: Options: Location: [http://hackage.haskell.org/packages/archive/base/3.0.0.0/base-3.0.0.0.tar.gz](http://hackage.haskell.org/packages/archive/base/3.0.0.0/base-3.0.0.0.tar.gz) Local: /home/abram/.cabal/packages/hackage.haskell.org/base/3.0.0.0/base-3.0.0.0.tar.gz
Requested: old-time -any
Using: old-time-1.0.0.0 Depends: base -any, old-locale -any Options: Location: [http://hackage.haskell.org/packages/archive/old-time/1.0.0.0/old-time-1.0.0.0.tar.gz](http://hackage.haskell.org/packages/archive/old-time/1.0.0.0/old-time-1.0.0.0.tar.gz) Local: *Not downloaded
Requested: base -any
Installed: base-2.1.1
Requested: old-locale -any
Using: old-locale-1.0.0.0 Depends: base -any Options: Location: [http://hackage.haskell.org/packages/archive/old-locale/1.0.0.0/old-locale-1.0.0.0.tar.gz](http://hackage.haskell.org/packages/archive/old-locale/1.0.0.0/old-locale-1.0.0.0.tar.gz) Local: *Not downloaded
Requested: containers -any
Using: containers-0.1.0.0 Depends: base -any, array -any Options: Location: [http://hackage.haskell.org/packages/archive/containers/0.1.0.0/containers-0.1.0.0.tar.gz](http://hackage.haskell.org/packages/archive/containers/0.1.0.0/containers-0.1.0.0.tar.gz) Local: *Not downloaded
Requested: array -any
Using: array-0.1.0.0 Depends: base -any Options: Location: [http://hackage.haskell.org/packages/archive/array/0.1.0.0/array-0.1.0.0.tar.gz](http://hackage.haskell.org/packages/archive/array/0.1.0.0/array-0.1.0.0.tar.gz) Local: *Not downloaded
Requested: base >=2&&<3
Installed: base-2.1.1
Requested: network >=2.0
Installed: network-2.1.0.0
Requested: parsec >=2.0
Installed: parsec-2.0
Requested: mtl >=1.0
Installed: mtl-1.1.0.0
Requested: xhtml >=3000.0.0
Using: xhtml-3000.0.2.1 Depends: base -any Options: Location: [http://hackage.haskell.org/packages/archive/xhtml/3000.0.2.1/xhtml-3000.0.2.1.tar.gz](http://hackage.haskell.org/packages/archive/xhtml/3000.0.2.1/xhtml-3000.0.2.1.tar.gz) Local: *Not downloaded
These packages would be installed: base-3.0.0.0, old-locale-1.0.0.0, old-time-1.0.0.0, array-0.1.0.0, containers-0.1.0.0, xhtml-3000.0.2.1, cgi-3001.1.5.1, fastcgi-3000.0.0
Contributor

bos commented May 24, 2012

(Imported comment by ross on 2007-11-12)

Maybe base-3.0.0.0 should be removed from HackageDB.

Contributor

bos commented May 24, 2012

(Imported comment by @dcoutts on 2007-11-12)

Replying to ross:

Maybe base-3.0.0.0 should be removed from HackageDB.

I don't think that is the problem. Look at the output of cabal info, it thinks cgi depends on two versions of the base lib. It's just flattening the configurations incorrectly.

Contributor

bos commented May 24, 2012

(Imported comment by guest on 2007-11-12)

There are a number of issues here:

  • base should not be in HackageDB, since it is impossible to upgrade it.
  • The cgi package has been updated to use configurations to work with both base-2 and base-3, but fastcgi hasn't (it is updated in darcs, I just haven't gotten around to uploading it).
  • cabal-install picks the first working configuration. This has the result that fastcgi which dependes on base >= 2.0 is configured to use the installed base-2.1.1, and cgi which can use either base version is configured to use the available base-3.0.0. If base was not in HackageDB, cgi would be configured correctly.
There is a bug here, but it is not that configurations are flattened incorrectly. Rather, the problem is that cabal-install does not backtrack in the dependency resolution if it encounters an uninstallable package.
Contributor

bos commented May 24, 2012

(Imported comment by ross on 2007-11-12)

I added base-3.0.0.0 because I hoped to build Hugs with released packages. However the package doesn't work for that purpose, so I've removed it.

Contributor

bos commented May 24, 2012

(Imported comment by @dcoutts on 2007-11-19)

This is now trivial to fix. We just exclude all versions of the base package from the index of available packages that we hand to the dependency resolver:

  dependencyResolver resolver os arch comp installed available deps =
!   case resolver os arch comp (hideBrokenPackages installed) available deps of
      Left unresolved -> Left unresolved
--- 87,91 ----
  dependencyResolver resolver os arch comp installed available deps =
!   let installed' = hideBrokenPackages installed
!       available' = hideBasePackage available
!    in case resolver os arch comp installed' available' deps of
That encodes the fact that although the base package may be available, we cannot actually rebuild the base package or install any new version of it.

We should probably do the same for any other magic builtin ghc packages that are not upgradable.

Contributor

bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-05-21)

Wed May 21 16:37:00 BST 2008  Duncan Coutts <duncan@haskell.org>
  * Hide any available base and ghc-prim packages from the dep resolver
  Previously if the base package was available on hackage then the dep
  resolver might try to upgrade it. Unfortunately that's almost
  certainly technically impossible at the moment. So now since the dep
  resolver does not see these available packages it cannot pick them.
  This should fix ticket #174.

@bos bos closed this May 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment