Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

non-exhaustive patterns when trying to install base #590

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

Comments

Projects
None yet
2 participants
Contributor

bos commented May 24, 2012

(Imported from Trac #597, reported by guest on 2009-10-03)

I was trying to install regex-dfa. I should mention that I have library profiling enabled in my cabal-install config. So when a dependency claims to be hidden I usually just reinstall it and everything works.

Here, I tried that and base showed up as a dependency (shouldn't I have the profiled version of base already?), and when I tried to cabal install base, I get a funny error.

Transcript below (note that I've selected 1.6.0.2 from the version drop down, but my version is actually 1.6.0.3, but isn't in the list). My GHC version is also not in the lits. I have 6.10.4.

$ cabal --version
cabal-install version 0.6.2
using version 1.6.0.3 of the Cabal library
$ cabal install regex-dfa
Resolving dependencies...
[1 of 1] Compiling Main             ( /var/folders/s-/s-WdqsnuGFyUGEeXB-+sZk+++TI/-Tmp-/regex-base-0.93.18737/regex-base-0.93.1/Setup.hs, /var/folders/s-/s-WdqsnuGFyUGEeXB-+sZk+++TI/-Tmp-/regex-base-0.93.18737/regex-base-0.93.1/dist/setup/Main.o )
Linking /var/folders/s-/s-WdqsnuGFyUGEeXB-+sZk+++TI/-Tmp-/regex-base-0.93.18737/regex-base-0.93.1/dist/setup/setup ...
Configuring regex-base-0.93.1...
Warning: No 'build-type' specified. If you do not need a custom Setup.hs or
./configure script then use 'build-type: Simple'.
Preprocessing library regex-base-0.93.1...
Building regex-base-0.93.1...
[1 of 4] Compiling Text.Regex.Base.RegexLike ( Text/Regex/Base/RegexLike.hs, dist/build/Text/Regex/Base/RegexLike.o )
[2 of 4] Compiling Text.Regex.Base.Context ( Text/Regex/Base/Context.hs, dist/build/Text/Regex/Base/Context.o )
[3 of 4] Compiling Text.Regex.Base  ( Text/Regex/Base.hs, dist/build/Text/Regex/Base.o )
[4 of 4] Compiling Text.Regex.Base.Impl ( Text/Regex/Base/Impl.hs, dist/build/Text/Regex/Base/Impl.o )
[1 of 4] Compiling Text.Regex.Base.RegexLike ( Text/Regex/Base/RegexLike.hs, dist/build/Text/Regex/Base/RegexLike.p_o )
[2 of 4] Compiling Text.Regex.Base.Context ( Text/Regex/Base/Context.hs, dist/build/Text/Regex/Base/Context.p_o )
[3 of 4] Compiling Text.Regex.Base  ( Text/Regex/Base.hs, dist/build/Text/Regex/Base.p_o )
[4 of 4] Compiling Text.Regex.Base.Impl ( Text/Regex/Base/Impl.hs, dist/build/Text/Regex/Base/Impl.p_o )
ar: creating archive dist/build/libHSregex-base-0.93.1.a
ar: creating archive dist/build/libHSregex-base-0.93.1_p.a
Installing library in /Users/dagit/.cabal/lib/regex-base-0.93.1/ghc-6.10.4
Registering regex-base-0.93.1...
Reading package info from "dist/installed-pkg-config" ... done.
Writing new package config file... done.
Downloading regex-dfa-0.91...
[1 of 1] Compiling Main             ( /var/folders/s-/s-WdqsnuGFyUGEeXB-+sZk+++TI/-Tmp-/regex-dfa-0.918737/regex-dfa-0.91/Setup.hs, /var/folders/s-/s-WdqsnuGFyUGEeXB-+sZk+++TI/-Tmp-/regex-dfa-0.918737/regex-dfa-0.91/dist/setup/Main.o )
Linking /var/folders/s-/s-WdqsnuGFyUGEeXB-+sZk+++TI/-Tmp-/regex-dfa-0.918737/regex-dfa-0.91/dist/setup/setup ...
Configuring regex-dfa-0.91...
Warning: No 'build-type' specified. If you do not need a custom Setup.hs or
./configure script then use 'build-type: Simple'.
Preprocessing library regex-dfa-0.91...
Building regex-dfa-0.91...
Text/Regex/DFA/Common.hs:6:7:
    Could not find module `Data.IntMap':
      it is a member of the hidden package `containers-0.2.0.1'
      Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
regex-dfa-0.91 failed during the building phase. The exception was:
exit: ExitFailure 1
[04:55 PM][dagit@apricot~/local-data/regex-tests/darcs.net-regex-base]
$ cabal install containers-0.2.0.1
Resolving dependencies...
No packages to be installed. All the requested packages are already installed.
If you want to reinstall anyway then use the --reinstall flag.
[04:55 PM][dagit@apricot~/local-data/regex-tests/darcs.net-regex-base]
$ cabal install containers-0.2.0.1 --reinstall
Resolving dependencies...
Downloading containers-0.2.0.1...
Configuring containers-0.2.0.1...
Preprocessing library containers-0.2.0.1...
Building containers-0.2.0.1...
Data/IntMap.hs:182:7:
    Could not find module `Data.Data':
      it is a member of the hidden package `base'
      Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
containers-0.2.0.1 failed during the building phase. The exception was:
exit: ExitFailure 1
[04:55 PM][dagit@apricot~/local-data/regex-tests/darcs.net-regex-base]
$ cabal install base
Resolving dependencies...
cabal: Distribution/Client/Dependency/TopDown.hs:170:37-73: Non-exhaustive patterns in lambda
[04:55 PM][dagit@apricot~/local-data/regex-tests/darcs.net-regex-base]
$ cabal install base
Resolving dependencies...
cabal: Distribution/Client/Dependency/TopDown.hs:170:37-73: Non-exhaustive patterns in lambda
Contributor

bos commented May 24, 2012

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

The key bit is:

$ cabal install base
Resolving dependencies...
cabal: Distribution/Client/Dependency/TopDown.hs:170:37-73: Non-exhaustive patterns in lambda
Yep, trying to install base will not work. We should produce a better error message though.

As for the other bits, your getting confused about the error messages. The message you get when the profiled version is missing is different. The regex-dfa-0.91 package really is from the ghc-6.6 era and is missing the dependency on the containers package.

The problem when you build containers is that the package does not specify the version of base that it needs. It needs version 4 but does not say so, and by default cabal will pick base 3, because that's the choice that makes all the older stuff work. But as I say, you've got the profiled version of containers already, so don't re-install it.

Contributor

bos commented May 24, 2012

(Imported comment by guest on 2009-10-03)

The problem persists in Cabal-1.8.0.6.

Installing library in /Users/abel/.cabal/lib/Cabal-1.8.0.6/ghc-6.12.1

Registering Cabal-1.8.0.6...

$ cabal install base

Resolving dependencies...

cabal: Distribution/Client/Dependency/TopDown.hs:171:37-73: Non-exhaustive patterns in lambda

--Andreas Abel

Contributor

bos commented May 24, 2012

(Imported comment by @dcoutts on 2010-11-09)

If someone wants to fix this, the other thing to check is with and older or newer GHC that does not have two versions of base. A user reported that with ghc-6.6 they get an "impossible" internal error in this situation.

The general fix here is to have a per-compiler list of packages that are impossible to upgrade. If the user explicitly asks to install one then they should get a sensible error. For all other cases it should use a constraint on picking an installed instance of these packages.

Contributor

bos commented May 24, 2012

(Imported comment by @kosmikus on 2010-11-09)

This one is still there.

Contributor

bos commented May 24, 2012

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

This is still present with the topdown solver, but the modular solver handles it ok:

$ cabal install base-4.5.0.0
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: base (user goal)
rejecting: base-3.0.3.2, 3.0.3.1 (global constraint requires ==4.5.0.0)
rejecting: base-4.5.0.0 (only already installed instances can be used)
rejecting: base-4.4.1.0, 4.4.0.0, 4.3.1.0/installed-20f..., 4.3.1.0, 4.3.0.0,
4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0 (global constraint requires
==4.5.0.0)
There's still an issue here to figure out a sensible way to specify non-upgradeable packages per compiler.

@ttuegel ttuegel added the obsolete label Feb 28, 2015

@ttuegel ttuegel closed this Feb 28, 2015

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