Cabal cannot find GHC when using relative path in -w flag #758

bos opened this Issue May 24, 2012 · 4 comments


None yet

3 participants

bos commented May 24, 2012

(Imported from Trac #768, reported by @tibbe on 2010-11-19)

Trying to build the network package while standing at the root of a GHC build tree fails to find GHC:

$ cabal install -w inplace/bin/ghc-stage2 network -v2
inplace/bin/ghc-stage2 --numeric-version
looking for package tool: ghc-pkg near compiler in inplace/bin
found package tool in inplace/bin/ghc-pkg
inplace/bin/ghc-pkg --version
inplace/bin/ghc-stage2 --supported-languages
Reading installed packages...
inplace/bin/ghc-pkg dump --global
inplace/bin/ghc-pkg dump --user
inplace/bin/ghc-stage2 --print-libdir
Reading available packages...
Resolving dependencies...
selecting network-2.3 (hackage) and discarding network-2.0,,,, 2.2.1,,,,,,,,,,, 2.2.3 and
selecting base- (installed)
selecting ffi-1.0 (installed)
selecting ghc-prim- (installed)
selecting integer-gmp- (installed)
selecting rts-1.0 (installed)
selecting parsec- (hackage) and discarding parsec-2.0,, 3.0.0,
3.0.1 and 3.1.0
selecting unix- (installed) and discarding unix-2.0,,,,,, and
selecting bytestring- (installed) and discarding bytestring-0.9,,,,,,,,,,, and
In order, the following would be installed:
parsec- (new package)
network-2.3 (new package)
parsec- has already been downloaded.
to /tmp/parsec-
Configuring parsec-
cabal: Cannot find the program 'ghc' at 'inplace/bin/ghc-stage2' or on the
cabal: Error: some packages failed to install:
network-2.3 depends on parsec- which failed to install.
parsec- failed during the configure step. The exception was:
ExitFailure 1
bos commented May 24, 2012

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

Presumably due to cabal-install changing the current directory when it builds the package in question. See SetupWrapper? in cabal-install.


Any solution suggestions as I got a similar error here ?

When I was trying to build an operating systems and the course requires that ghc and cabal should be installed, and because I am trying to do it on a ubuntu 12.04

hegazy@AHegazy:/sbin$ cabal install ghc-paths
Warning: Falling back to topdown solver for GHC < 7.
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/ghc-paths-, /tmp/ghc-paths- )
Linking /tmp/ghc-paths- ...
unrecognized option `--disable-tests'

unrecognized option `--disable-benchmarks'
cabal: Error: some packages failed to install:
ghc-paths- failed during the configure step. The exception was:
ExitFailure 1

I will be grateful if you listed how did you solve this thing happened to you ?!

byorgey commented Jan 4, 2013

@Ahegazy that doesn't look like the same problem to me, I think you are running into #1004 , which was fixed by #1133 . It should work if you install the most recent version of cabal-install (cabal install cabal-install).


Thanks byorgey, you are right it worked.

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