haskell / haskell/cabal

configure incorrectly reports package as broken

Open
#1,185 7 comments 0 reactions 1 assignee Claimed by @kosmikus View on GitHub
cabal-install: solver type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I was working with the new sandboxing support (which uses a package DB in `.cabal-sandbox/ghc--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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.