--constraint= is not respected for base #531

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

Projects

None yet

3 participants

@bos
Haskell member

(Imported from Trac #538, reported by @saizan on 2009-04-03)

the --constraint= flag apparently does nothing when the constraint involves base.
e.g. to install directory-1.0.0.3, that imports Control.Exception.Base and only lists "base" in build-depends, you need to add "base >= 4", but cabal install directory --constraint="base >= 4" picks base-3.0.3.0 anyway.

saizan@astarte:~/trash/directory-1.0.0.3$ cabal configure --constraint="base >= 4"
Resolving dependencies...
Configuring directory-1.0.0.3...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/stat.h... (cached) yes
configure: creating ./config.status
config.status: creating include/HsDirectoryConfig.h
config.status: include/HsDirectoryConfig.h is unchanged
saizan@astarte:~/trash/directory-1.0.0.3$ cabal build -v
Creating dist/build (and its parents)
Creating dist/build/autogen (and its parents)
Preprocessing library directory-1.0.0.3...
Building directory-1.0.0.3...
Building library...
Creating dist/build (and its parents)
/usr/local/bin/ghc -package-name directory-1.0.0.3 --make -hide-all-packages -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -Iinclude -optP-include -optPdist/build/autogen/cabal_macros.h -#include "HsDirectory.h" -odir dist/build -hidir dist/build -stubdir dist/build -package base-3.0.3.0 -package filepath-1.1.0.1 -package old-time-1.0.0.1 -package unix-2.3.1.0 -O -XCPP -XForeignFunctionInterface System.Directory
System/Directory.hs:81:7:
    Could not find module `Control.Exception.Base':
      it is a member of package base, which is hidden
@kosmikus kosmikus was assigned May 24, 2012
@bos
Haskell member

(Imported comment by @dcoutts on 2009-04-03)

The problem is in the cabal-install constraint solver. We handle packages like base specially (base 3 depends on base 4). We do it by whenever we select one we also select the other. However clearly at the end when we pick one we're ignoring some constraint.

@bos
Haskell member

(Imported comment by @kosmikus on 2010-07-23)

I think this is only a problem in the strange base-wrapping situation we had with base-3 and base-4. Still, something to verify again.

@bos
Haskell member

(Imported comment by @kosmikus on 2012-03-06)

Confirmed that constraints on base work normally in most circumstances. We still don't have a proper solution for the base-wrapping situation, but that's very rare now. Deferring to a later release and lowering priority for now.

@gregorycollins
Haskell member

Nobody is ever going to get to this. Closing with prejudice, and should not be reopened without a patch :)

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