--constraint= is not respected for base #531

bos opened this Issue May 24, 2012 · 4 comments


None yet

3 participants

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-, 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- anyway.

saizan@astarte:~/trash/directory-$ cabal configure --constraint="base >= 4"
Resolving dependencies...
Configuring directory-
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-$ cabal build -v
Creating dist/build (and its parents)
Creating dist/build/autogen (and its parents)
Preprocessing library directory-
Building directory-
Building library...
Creating dist/build (and its parents)
/usr/local/bin/ghc -package-name directory- --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- -package filepath- -package old-time- -package unix- -O -XCPP -XForeignFunctionInterface System.Directory
    Could not find module `Control.Exception.Base':
      it is a member of package base, which is hidden
@kosmikus kosmikus was assigned May 24, 2012
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.

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.

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.

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