Repository navigation
Closed
Description
configure seems to ignore the --contraint flag. For example, here I'm specifying a specific version of hashable, but configures picks another one:
$ cabal configure --disable-library-profiling --enable-benchmarks --enable-tests --constraint "hashable == 1.2.0.0" -v
'/usr/bin/ghc' '--numeric-version'
looking for tool "ghc-pkg" near compiler in /usr/bin
found ghc-pkg in /usr/bin/ghc-pkg
'/usr/bin/ghc-pkg' '--version'
'/usr/bin/ghc' '--supported-languages'
'/usr/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-98e... (dependency of
unordered-containers-0.2.3.0:*bench)
next goal: aeson (dependency of criterion-0.6.2.0/installed-98e...)
rejecting: aeson-0.6.0.2/installed-386... (conflict:
unordered-containers==0.2.3.0, aeson =>
unordered-containers==0.2.2.1/installed-d70...)
Configuring unordered-containers-0.2.3.0...
Flags chosen: debug=False
Dependency ChasingBottoms -any: using ChasingBottoms-1.3.0.5
Dependency HUnit -any: using HUnit-1.2.5.1
Dependency QuickCheck >=2.4.0.1: using QuickCheck-2.5.1.1
Dependency base ==4.*: using base-4.5.1.0
Dependency bytestring -any: using bytestring-0.9.2.1
Dependency containers >=0.4.2: using containers-0.4.2.1
Dependency criterion -any: using criterion-0.6.2.0
Dependency deepseq >=1.1: using deepseq-1.3.0.0
Dependency hashable >=1.0.1.1: using hashable-1.1.2.5
Dependency mtl -any: using mtl-2.1.2
Dependency random -any: using random-1.0.1.1
Dependency test-framework >=0.3.3: using test-framework-0.6.1
Dependency test-framework-hunit -any: using test-framework-hunit-0.2.7
Dependency test-framework-quickcheck2 >=0.2.9: using
test-framework-quickcheck2-0.2.12.3
Dependency unordered-containers -any: using unordered-containers-0.2.3.0
'/usr/bin/ghc' '--info'
Using Cabal-1.17.0 compiled by ghc-7.4
Using compiler: ghc-7.4.2
Using install prefix:
/Users/tibell/Library/Haskell/ghc-7.4.2/lib/unordered-containers-0.2.3.0
Binaries installed in:
/Users/tibell/Library/Haskell/ghc-7.4.2/lib/unordered-containers-0.2.3.0/bin
Libraries installed in:
/Users/tibell/Library/Haskell/ghc-7.4.2/lib/unordered-containers-0.2.3.0/lib
Private binaries installed in:
/Users/tibell/Library/Haskell/ghc-7.4.2/lib/unordered-containers-0.2.3.0/libexec
Data files installed in:
/Users/tibell/Library/Haskell/ghc-7.4.2/lib/unordered-containers-0.2.3.0/share
Documentation installed in:
/Users/tibell/Library/Haskell/ghc-7.4.2/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.4.2 found on system at: /usr/bin/ghc
Using ghc-pkg version 7.4.2 found on system at: /usr/bin/ghc-pkg
No greencard found
Using haddock version 2.11.0 found on system at: /usr/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/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/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
Metadata
Metadata
Assignees
Labels
No labels
Activity
tibbe commentedon Dec 14, 2012
I just verified that this works correctly with the old, topdown, solver.
kosmikus commentedon Dec 14, 2012
There's something I don't understand about the way cabal works here. As you can see from your log output, what actually happens is that the solver fails. However,
Distribution.Client.Configureseems to just invokesetupWrapperin such as case, which will still configure the package (but obviously ignoring any solver output, because there is none).So there are two points to investigate here:
-v3trace.kosmikus commentedon Dec 14, 2012
Oh, perhaps I should add that as far as I can see this isn't a HEAD regression. I don't have your use case, but if you specify a clearly unsolvable constraint (such as "base == 1.0.0.0"), then you get similar behaviour with both solvers, already in 0.14.0.
dmwit commentedon Aug 26, 2013
I am still seeing behavior like this in very new cabal-installs:
As you can see, I've specified a constraint (
xmonad>=0.12) that completely conflicts with one from the cabal file (xmonad<0.12), but configuration still succeeds. Full output from-v3is attached below.dmwit commentedon Aug 26, 2013
Hm, issue #385 also looks relevant. Perhaps this was a conscious design choice? If so, put me down as requesting a feature that reports a little bit about what happened when the solver failed but configure succeeded anyway. It's a very confusing outcome.
'cabal configure': honor the '--constraint' flag.