Repository navigation
Open
Description
I was working with the new sandboxing support (which uses a package DB in .cabal-sandbox/ghc-<version>-packages.conf.d instead of the user package DB) when I ran into this curious error.
First, Cabal claims that aeson is broken:
$ cabal configure --constraint="hashable == 1.1.2.5" -v --enable-benchmarks --package-db=.cabal-sandbox/ghc-7.6.1-packages.conf.d/
'/usr/local/bin/ghc' '--numeric-version'
looking for tool "ghc-pkg" near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
'/usr/local/bin/ghc-pkg' '--version'
'/usr/local/bin/ghc' '--supported-languages'
'/usr/local/bin/ghc' '--info'
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Could not resolve dependencies:
trying: unordered-containers-0.2.3.0 (user goal)
rejecting: unordered-containers-0.2.3.0:!bench (global constraint requires
opposite flag selection)
trying: unordered-containers-0.2.3.0:*bench
trying: criterion-0.6.2.0/installed-ff8... (dependency of
unordered-containers-0.2.3.0:*bench)
next goal: aeson (dependency of criterion-0.6.2.0/installed-ff8...)
rejecting: aeson-0.6.1.0/installed-d58... (package is broken)
Configuring unordered-containers-0.2.3.0...
Flags chosen: debug=False
Dependency base ==4.*: using base-4.6.0.0
Dependency bytestring -any: using bytestring-0.10.0.0
Dependency containers -any: using containers-0.5.0.0
Dependency criterion -any: using criterion-0.6.2.0
Dependency deepseq >=1.1: using deepseq-1.3.0.1
Dependency hashable >=1.0.1.1: using hashable-1.1.2.5
Dependency hashmap -any: using hashmap-1.3.0.1
Dependency mtl -any: using mtl-2.1.2
Dependency random -any: using random-1.0.1.1
'/usr/local/bin/ghc' '--info'
Using Cabal-1.17.0 compiled by ghc-7.4
Using compiler: ghc-7.6.1
Using install prefix:
/Users/tibell/Library/Haskell/ghc-7.6.1/lib/unordered-containers-0.2.3.0
Binaries installed in:
/Users/tibell/Library/Haskell/ghc-7.6.1/lib/unordered-containers-0.2.3.0/bin
Libraries installed in:
/Users/tibell/Library/Haskell/ghc-7.6.1/lib/unordered-containers-0.2.3.0/lib
Private binaries installed in:
/Users/tibell/Library/Haskell/ghc-7.6.1/lib/unordered-containers-0.2.3.0/libexec
Data files installed in:
/Users/tibell/Library/Haskell/ghc-7.6.1/lib/unordered-containers-0.2.3.0/share
Documentation installed in:
/Users/tibell/Library/Haskell/ghc-7.6.1/lib/unordered-containers-0.2.3.0/doc
Using alex version 3.0.2 found on system at: /usr/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.2.1 found on system at: /usr/bin/gcc
Using ghc version 7.6.1 found on system at: /usr/local/bin/ghc
Using ghc-pkg version 7.6.1 found on system at: /usr/local/bin/ghc-pkg
No greencard found
Using haddock version 2.12.0 found on system at: /usr/local/bin/haddock
Using happy version 1.18.10 found on system at: /usr/bin/happy
No hmake found
Using hpc version 0.6 found on system at: /usr/local/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/local/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
No pkg-config found
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
However, ghc-pkg disagrees:
$ ghc-pkg list --package-db=.cabal-sandbox/ghc-7.6.1-packages.conf.d
.cabal-sandbox/ghc-7.6.1-packages.conf.d
HUnit-1.2.5.1
abstract-deque-0.1.6
abstract-par-0.3.1
aeson-0.6.1.0
attoparsec-0.10.3.0
blaze-builder-0.3.1.0
cereal-0.3.5.2
criterion-0.6.2.0
dlist-0.5
erf-2.0.0.0
hashable-1.1.2.5
hashmap-1.3.0.1
hastache-0.4.2
ieee754-0.7.3
math-functions-0.1.1.2
monad-par-0.3
monad-par-extras-0.3.2
mtl-2.1.2
mwc-random-0.12.0.1
parallel-3.2.0.3
parsec-3.1.3
primitive-0.5.0.1
random-1.0.1.1
statistics-0.10.2.0
syb-0.3.7
text-0.11.2.3
transformers-0.3.0.0
unordered-containers-0.2.3.0
utf8-string-0.3.7
vector-0.10.0.1
vector-algorithms-0.5.4.2
$ ghc-pkg check --package-db=.cabal-sandbox/ghc-7.6.1-packages.conf.d
# empty output
Activity
tibbe commentedon Jan 24, 2013
The top-down solver fails too, but in a different way:
It says
There is no available version of criterion that satisfies -any, which is clearly incorrect if we look at the ghc-pkg output in the bug description.tibbe commentedon Jan 24, 2013
@kosmikus Do you mind taking a look. You can reproduce this using GHC 7.6.1, and empty user package DB, and the latest HEAD of unordered-containers from https://github.com/tibbe/unordered-containers.
You will have to run:
Before trying the above command, to make sure you have the right dependencies. The reason you have to install criterion and hashmap separately, is due to a circular dependency (cabal treats the whole package as one unit, where it ought to consider the benchmark section separately).
kosmikus commentedon May 3, 2013
@tibbe Sorry for not replying earlier. I have apparently configured my mail system such that github notifications ended up in some unimportant folder. I will try to take a look.
kosmikus commentedon May 3, 2013
@tibbe Ok, I know why this is happening, at least: the code in
Configure.hsinvokes a function calledstandardInstallPolicyas follows:The final argument is a list of package ids (in this situation, containing the
unordered-containerspackage) that are deleted from the index in the definition ofstandardInstallPolicy(which is inDistribution/Client/Dependency.hs):and
The TODO has been left by @dcoutts a long time ago, but I think it is accurate. Deleting stuff from the index is evil. It subsequently makes the modular solver think that the reverse dependencies of the deleted package are broken (including
aeson, which depends onunordered-containers), which is true according to the view of the world that that code gets. So the correct fix would be to not modify the index, but instead to add constraints that will make the solver exclude the package.At the moment, I'm not quite sure how much work that would be, and whether there's a risk that something else breaks once this is done.
kosmikus commentedon May 3, 2013
Thinking about this somewhat more, I do not think that fixing this particular issue would help in any substantial way: while
unordered-containerswould no longer be considered broken, you'd still get a dependency resolution failure becauseaesonnow depends on another instance ofunordered-containersthan the one you are about to install; it will thus still be rejected. (BTW, thetopdownsolver complains aboutcriterion, whereasmodularcomplains aboutaesonwhich is a dependency ofcriterion, but the underlying problem is the same for both solvers).'cabal configure': honor the --constraint flag.
'cabal configure': honor the '--constraint' flag.
ttuegel commentedon Apr 23, 2015
Is this still an issue?
23Skidoo commentedon Apr 23, 2015
My fix was reverted because it broke
containerstest suite. Now that @edsko implemented independent goals we should fix #1575 and then reapply it.