haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 695 forks source link

Cabal does not select newest packages to install #1880

Closed pmlodawski closed 10 years ago

pmlodawski commented 10 years ago

When I create an empty sandbox and install in it postgresql-simple-0.4.2.2, it installs old version of aeson (0.6.2.1). See log below:

$ cabal install -j postgresql-simple-0.4.2.2 
Resolving dependencies...
Notice: installing into a sandbox located at /tmp/test/.cabal-sandbox
Configuring blaze-builder-0.3.3.2...
Configuring byteable-0.1.1...
Configuring dlist-0.7.0.1...
Configuring postgresql-libpq-0.9.0.1...
Configuring network-info-0.2.0.3...
Building byteable-0.1.1...
Building blaze-builder-0.3.3.2...
Building dlist-0.7.0.1...
Building network-info-0.2.0.3...
Installed byteable-0.1.1
Configuring cryptohash-0.11.4...
Building postgresql-libpq-0.9.0.1...
Installed dlist-0.7.0.1
Building cryptohash-0.11.4...
Installed network-info-0.2.0.3
Installed blaze-builder-0.3.3.2
Configuring aeson-0.6.2.1...
Configuring blaze-textual-0.2.0.9...
Installed postgresql-libpq-0.9.0.1
Building blaze-textual-0.2.0.9...
Building aeson-0.6.2.1...
Installed blaze-textual-0.2.0.9
Installed cryptohash-0.11.4
Configuring uuid-1.3.3...
Building uuid-1.3.3...
Installed uuid-1.3.3
Installed aeson-0.6.2.1
Configuring postgresql-simple-0.4.2.2...
Building postgresql-simple-0.4.2.2...
Installed postgresql-simple-0.4.2.2

Installing newest version of aeson works, but must be forced by a command:

cabal install -j postgresql-simple-0.4.2.2 aeson-0.7.0.6
Resolving dependencies...
Configuring blaze-builder-0.3.3.2...
Configuring byteable-0.1.1...
Configuring network-info-0.2.0.3...
Configuring postgresql-libpq-0.9.0.1...
Downloading scientific-0.3.2.1...
Configuring scientific-0.3.2.1...
Building network-info-0.2.0.3...
Building byteable-0.1.1...
Building blaze-builder-0.3.3.2...
Building scientific-0.3.2.1...
Installed byteable-0.1.1
Configuring cryptohash-0.11.4...
Building postgresql-libpq-0.9.0.1...
Building cryptohash-0.11.4...
Installed network-info-0.2.0.3
Installed blaze-builder-0.3.3.2
Configuring blaze-textual-0.2.0.9...
Building blaze-textual-0.2.0.9...
Installed postgresql-libpq-0.9.0.1
Installed scientific-0.3.2.1
Downloading attoparsec-0.11.3.4...
Configuring attoparsec-0.11.3.4...
Installed blaze-textual-0.2.0.9
Building attoparsec-0.11.3.4...
Installed cryptohash-0.11.4
Configuring uuid-1.3.3...
Building uuid-1.3.3...
Installed uuid-1.3.3
Installed attoparsec-0.11.3.4
Downloading aeson-0.7.0.6...
Configuring aeson-0.7.0.6...
Building aeson-0.7.0.6...
Installed aeson-0.7.0.6
Configuring postgresql-simple-0.4.2.2...
Building postgresql-simple-0.4.2.2...
Installed postgresql-simple-0.4.2.2

I'm using cabal-install version 1.20.0.1 using version 1.20.0.0 of the Cabal library

kosmikus commented 10 years ago

I don't think this is a bug. I suspect that in the first case, cabal tries to reuse packages that you already have installed. Comparing the build outputs, attoparsec and scientific are good candidates that you might have around already. Now if your already installed version of scientific is too old for aeson-0.7.0.6, then cabal-install will pick an older one.

I'm closing this. Feel free to reopen if you disagree.