Skip to content
This repository

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

Open
bos opened this Issue · 4 comments

3 participants

Bryan O'Sullivan Abdel Rahman Hegazi Brent Yorgey
Bryan O'Sullivan
Owner
bos commented

(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.1.0.0, 2.2.0.0,
2.2.0.1, 2.2.1, 2.2.1.1, 2.2.1.2, 2.2.1.3, 2.2.1.4, 2.2.1.5, 2.2.1.6, 2.2.1.7,
2.2.1.8, 2.2.1.9, 2.2.1.10, 2.2.3 and 2.2.3.1
selecting base-4.3.0.0 (installed)
selecting ffi-1.0 (installed)
selecting ghc-prim-0.2.0.0 (installed)
selecting integer-gmp-0.2.0.2 (installed)
selecting rts-1.0 (installed)
selecting parsec-2.1.0.1 (hackage) and discarding parsec-2.0, 2.1.0.0, 3.0.0,
3.0.1 and 3.1.0
selecting unix-2.4.1.0 (installed) and discarding unix-2.0, 2.2.0.0, 2.3.0.0,
2.3.1.0, 2.3.2.0, 2.4.0.0, 2.4.0.1 and 2.4.0.2
selecting bytestring-0.9.1.8 (installed) and discarding bytestring-0.9,
0.9.0.1, 0.9.0.2, 0.9.0.3, 0.9.0.4, 0.9.1.0, 0.9.1.1, 0.9.1.2, 0.9.1.3,
0.9.1.4, 0.9.1.5, 0.9.1.6 and 0.9.1.7
In order, the following would be installed:
parsec-2.1.0.1 (new package)
network-2.3 (new package)
parsec-2.1.0.1 has already been downloaded.
Extracting
/home/tibell/.cabal/packages/hackage.haskell.org/parsec/2.1.0.1/parsec-2.1.0.1.tar.gz
to /tmp/parsec-2.1.0.117969...
Configuring parsec-2.1.0.1...
cabal: Cannot find the program 'ghc' at 'inplace/bin/ghc-stage2' or on the
path
cabal: Error: some packages failed to install:
network-2.3 depends on parsec-2.1.0.1 which failed to install.
parsec-2.1.0.1 failed during the configure step. The exception was:
ExitFailure 1
Bryan O'Sullivan
Owner
bos commented

(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.

Abdel Rahman Hegazi

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-0.1.0.9-31688/ghc-paths-0.1.0.9/Setup.hs, /tmp/ghc-paths-0.1.0.9-31688/ghc-paths-0.1.0.9/dist/setup/Main.o )
Linking /tmp/ghc-paths-0.1.0.9-31688/ghc-paths-0.1.0.9/dist/setup/setup ...
unrecognized option `--disable-tests'

unrecognized option `--disable-benchmarks'
cabal: Error: some packages failed to install:
ghc-paths-0.1.0.9 failed during the configure step. The exception was:
ExitFailure 1
hegazy@AHegazy:/sbin$
hegazy@AHegazy:/sbin$

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

Brent Yorgey
Collaborator

@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).

Abdel Rahman Hegazi

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
Something went wrong with that request. Please try again.