Open bos opened 12 years ago
(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-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 ?!
@Ahegazy that doesn't look like the same problem to me, I think you are running into #1004 , which was fixed by https://github.com/haskell/cabal/pull/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.
This is still an issue on windows using:
$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.1 of the Cabal library
Could someone with access to a Windows machine try this? (@jneira?) It works fine on Linux. At least, we could stick the windows
label on it.
Thanks for the mention, i have been able to test it amd it works for me using cabal-3.6.0.0 build -w ..\..\..\..\ghcup\ghc\8.10.7\bin\ghc.exe
so iam gonna close it optimistically
Still broken for me:
andi@Ryzen MINGW64 ~/ghc_master
$ cabal install dom-lt -w _dwarf/stage1/bin/ghc.exe
Resolving dependencies...
Build profile: -w ghc-9.1.20210216 -O1
In order, the following will be built (use -v for more details):
- dom-lt-0.2.3 (lib) (requires build)
Starting dom-lt-0.2.3 (lib)
Failed to build dom-lt-0.2.3. The failure occurred during the configure step.
Build log (
C:\ghcup\cabal\logs\ghc-9.1.20210216\dom-lt-0.2.3-4ab9b330e981bfcfe12250dc7b82fd00a91f4384.log
):
Configuring library for dom-lt-0.2.3..
cabal.exe: Cannot find the program 'ghc'. User-specified path
'_dwarf/stage1/bin/ghc.exe' does not refer to an executable and the program is
not on the system path.
cabal.exe: Failed to build dom-lt-0.2.3. See the build log above for details.
andi@Ryzen MINGW64 ~/ghc_master
$ cabal install dom-lt -w ~/ghc_master/_dwarf/stage1/bin/ghc.exe
Resolving dependencies...
Build profile: -w ghc-9.1.20210216 -O1
In order, the following will be built (use -v for more details):
- dom-lt-0.2.3 (lib) (requires build)
Starting dom-lt-0.2.3 (lib)
Building dom-lt-0.2.3 (lib)
andi@Ryzen MINGW64 ~/ghc_master
$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.3.0 of the Cabal library
andi@Ryzen MINGW64 ~/ghc_master
$ cabal install dom-lt -w ../ghc_master/_dwarf/stage1/bin/ghc.exe
Resolving dependencies...
Build profile: -w ghc-9.1.20210216 -O1
In order, the following will be built (use -v for more details):
- dom-lt-0.2.3 (lib) (requires build)
Starting dom-lt-0.2.3 (lib)
Failed to build dom-lt-0.2.3. The failure occurred during the configure step.
Build log (
C:\ghcup\cabal\logs\ghc-9.1.20210216\dom-lt-0.2.3-4ab9b330e981bfcfe12250dc7b82fd00a91f4384.log
):
Configuring library for dom-lt-0.2.3..
cabal.exe: Cannot find the program 'ghc'. User-specified path
'../ghc_master/_dwarf/stage1/bin/ghc.exe' does not refer to an executable and
the program is not on the system path.
cabal.exe: Failed to build dom-lt-0.2.3. See the build log above for details.
andi@Ryzen MINGW64 ~/ghc_master
$ ../ghc_master/_dwarf/stage1/bin/ghc.exe --version
The Glorious Glasgow Haskell Compilation System, version 9.1.20210216
@AndreasPK: does cabal build
work for you? @jneira: does cabal install
work for you? If not, how about on master branch?
@AndreasPK: does
cabal build
work for you? @jneira: doescabal install
work for you? If not, how about on master branch?
cabal build behaves quite strangly:
andi@Ryzen MINGW64 ~/dom-lt
$ ../ghc_master/_dwarf/stage1/bin/ghc.exe --version
The Glorious Glasgow Haskell Compilation System, version 9.1.20210216
andi@Ryzen MINGW64 ~/dom-lt
$ cabal build -w ../ghc_master/_dwarf/stage1/bin/ghc.exe
Build profile: -w ghc-9.1.20210216 -O1
In order, the following will be built (use -v for more details):
- call-stack-0.4.0 (lib) (requires build)
- dom-lt-0.2.3 (lib) (first run)
- HUnit-1.6.2.0 (lib) (requires build)
- dom-lt-0.2.3 (test:dom-lt-tests) (first run)
Starting call-stack-0.4.0 (lib)
Configuring library for dom-lt-0.2.3..
Preprocessing library for dom-lt-0.2.3..
Building library for dom-lt-0.2.3..
[1 of 2] Compiling Data.Graph.Dom ( Data\Graph\Dom.hs, C:\ghc\msys64\home\andi\dom-lt\dist-newstyle\build\x86_64-windows\ghc-9.1.20210216\dom-lt-0.2.3\build\Data\Graph\Dom.o )
[2 of 2] Compiling Data.Graph.Dom.Internal ( Data\Graph\Dom\Internal.hs, C:\ghc\msys64\home\andi\dom-lt\dist-newstyle\build\x86_64-windows\ghc-9.1.20210216\dom-lt-0.2.3\build\Data\Graph\Dom\Internal.o )
Failed to build call-stack-0.4.0. The failure occurred during the configure
step.
Build log (
C:\ghcup\cabal\logs\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f.log
):
Configuring library for call-stack-0.4.0..
cabal.exe: Cannot find the program 'ghc'. User-specified path
'../ghc_master/_dwarf/stage1/bin/ghc.exe' does not refer to an executable and
the program is not on the system path.
cabal.exe: Failed to build call-stack-0.4.0 (which is required by
test:dom-lt-tests from dom-lt-0.2.3). See the build log above for details.
very weird, i've tried to get close to @AndreasPK use case, using msys2 console, with ghc-8.10.7 and 9.2.1 (i dont have a ghc built from source at hand) and trying cabal build and install and i cant reproduce 🤔 :
atrey@FNTSY MINGW64 /d/dev/ws/haskell/cabal-test
$ ../../../../ghcup/ghc/9.2.1/bin/ghc.exe --version
The Glorious Glasgow Haskell Compilation System, version 9.2.1
atrey@FNTSY MINGW64 /d/dev/ws/haskell/cabal-test
$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
atrey@FNTSY MINGW64 /d/dev/ws/haskell/cabal-test
$ which cabal
/d/ghcup/bin/cabal
atrey@FNTSY MINGW64 /d/dev/ws/haskell/cabal-test
$ cabal build -w ../../../../ghcup/ghc/9.2.1/bin/ghc.exe
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
- cabal-test-0.1.0.0 (lib) (first run)
- cabal-test-0.1.0.0 (exe:cabal-test) (first run)
Preprocessing library for cabal-test-0.1.0.0..
Building library for cabal-test-0.1.0.0..
[1 of 3] Compiling MyModule2 ( src\MyModule2.hs, D:\\dev\ws\haskell\cabal-test\dist-newstyle\build\x86_64-windows\ghc-9.2.1\cabal-test-0.1.0.0\build\MyModule2.o )
.....
$ mkdir test && cd test && cabal init -n && cabal install -w ../../../../../ghcup/ghc/8.10.7/bin/ghc.exe
Wrote tarball sdist to
D:\dev\ws\haskell\issues\test\dist-newstyle\sdist\test-0.1.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
- test-0.1.0.0 (exe:test) (requires build)
Configuring executable 'test' for test-0.1.0.0..
Preprocessing executable 'test' for test-0.1.0.0..
Building executable 'test' for test-0.1.0.0..
[1 of 1] Compiling Main ( app\Main.hs, dist\build\test\test-tmp\Main.o )
.....
Dont know where could be the difference, could you create a fresh simple cabal project like i did? i even would use a fresh cabal global config just in case. Another check could be use a ghc release (like mine one from ghcup) or start the path with ./
Dont know where could be the difference
What I observed was that the configure step of a dependency failed. By extension this would mean if you (re)compile a project where all dependencies are already available your build might succeed. Which would explain the difference.
Good point, still cant reproduce with rm -rf ./store-dir && cabal --store-dir ./store build all -w ../../../../../ghcup/ghc/8.10.7/bin/ghc.exe
, setting call-stack
(or netwotk
usually more problematic) as dependency. call-stack
build type is simple
so it seems configure
problems should not apply.
I wonder if cabal does not like the ghc dir layout, checking a regular distribution may discard it.
Otoh unix like paths are source of problems so maybe trying -w "../ghc_master/_dwarf/stage1/bin/ghc.exe"
could help
I did try cabal build -w ../ghc_master/_dwarf/stage1/bin/ghc.exe
above and it didn't work.
I just tried it quoting the compiler path cabal build -w "../ghc_master/_dwarf/stage1/bin/ghc.exe"
and that fails the same way.
Same for a windows-style path: cabal build -w "..\ghc_master\_dwarf\stage1\bin\ghc.exe"
It seems the path isn't turned into an absolute path for configure because with high verbosity I see:
...
dwarf\\stage1\\bin\\ghc-pkg.exe","--ghc-option=-hide-all-packages","lib:call-stack"]
C:\ghcup\cabal\bin\cabal.exe act-as-setup --build-type=Simple -- configure
--verbose=3 --builddir=dist --ghc
--prefix=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f
--bindir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\bin
--libdir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\lib
--libsubdir=
--dynlibdir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\lib
--libexecdir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\libexec
--libexecsubdir=
--datadir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\share
--datasubdir=
--docdir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\share\doc
--htmldir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\share\doc\html
--haddockdir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\share\doc\html
--sysconfdir=C:\ghcup\cabal\store\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f\etc
--enable-library-vanilla --disable-library-profiling --disable-shared
--disable-static --disable-executable-dynamic --disable-executable-static
--disable-profiling --profiling-detail=default
--library-profiling-detail=default --enable-optimization --disable-debug-info
--disable-library-for-ghci --disable-split-sections --disable-split-objs
--disable-executable-stripping --disable-library-stripping --package-db=clear
--package-db=global
--package-db=C:\ghcup\cabal\store\ghc-9.1.20210216\package.db
--extra-include-dirs=C:\ghcup\ghcup\msys64\mingw64\include
--cid=call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f
--extra-lib-dirs=C:\ghcup\ghcup\msys64\mingw64\lib
--extra-prog-path=C:\ghcup\ghcup\bin --extra-prog-path=C:\ghcup\cabal\bin
--extra-prog-path=C:\ghcup\ghcup\msys64\usr\bin
--extra-prog-path=C:\ghcup\ghcup\msys64\mingw64\bin
--dependency=base=base-4.16.0.0 --dependency=filepath=filepath-1.4.2.1
--disable-coverage --exact-configuration
--with-ghc=..\ghc_master\_dwarf\stage1\bin\ghc.exe
--with-ghc-pkg=C:\ghc\msys64\home\andi\ghc_master\_dwarf\stage1\bin\ghc-pkg.exe
--ghc-option=-hide-all-packages lib:call-stack
Redirecting build log to {handle:
C:\ghcup\cabal\logs\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f.log}
packages definitely up to date: dom-lt-0.2.3-inplace
packages previously probably up to date: dom-lt-0.2.3-inplace
packages now probably up to date: dom-lt-0.2.3-inplace
packages newly up to date:
packages out to date: dom-lt-0.2.3-inplace-dom-lt-tests
packages invalid due to dep change: HUnit-1.6.2.0-ab6f2878db39ff0501faac24ea421756787332b7, call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f, dom-lt-0.2.3-inplace-dom-lt-tests
packages invalid due to build failure: call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f
Failed to build call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f. The
failure occurred during the configure step.
Build log (
C:\ghcup\cabal\logs\ghc-9.1.20210216\call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f.log
):
Using Parsec parser
Configuring library for call-stack-0.4.0..
creating dist\build
Searching for ..\ghc_master\_dwarf\stage1\bin\ghc.exe in path.
Cannot find ..\ghc_master\_dwarf\stage1\bin\ghc.exe on the path
cabal.exe: Cannot find the program 'ghc'. User-specified path
'..\ghc_master\_dwarf\stage1\bin\ghc.exe' does not refer to an executable and
the program is not on the system path.
cabal.exe: Failed to build HUnit-1.6.2.0 because it depends on HUnit-1.6.2.0
which itself failed to build.
Failed to build call-stack-0.4.0-948672797ec2c144d9221e5d447f5e9d2b8d687f. The
failure occurred during the configure step.
Failed to build dom-lt-0.2.3 because it depends on dom-lt-0.2.3 which itself
failed to build.
Of particular note being that there is an absolute path for ghc-pkg but a relative path for ghc and this error message:
Searching for ../ghc_master/_dwarf/stage1/bin/ghc.exe in path. Cannot find ../ghc_master/_dwarf/stage1/bin/ghc.exe on the path
It's supposed to be a relative path and NOT something in path.
I think this happens because in Distribution.Simple.GHC.Internal
has this code:
findProg :: String -> [FilePath]
-> Verbosity -> ProgramSearchPath
-> IO (Maybe (FilePath, [FilePath]))
findProg progName extraPath v searchpath =
findProgramOnSearchPath v searchpath' progName
where
searchpath' = (map ProgramSearchPathDir extraPath) ++ searchpath
and findProgramOnSearchPath
seems to look for .../foo/bar/ghc.exe
in PATH
. But I might be mistaken.
It seems to work with the version of cabal I built from source today.
weird, I've observed my cabal version mentions Cabal-3.6.2.0 and yours 3.6.3.0, not sure if it would be related I think mine is the released version, installed with ghcup but I will double check
Actually, Cabal 3.6.3.0 has been released (but not cabal-install 3.6.3.0). I don't remember what the changes were, but I think they were requested by the kind GHC folk. I wonder how master branch would fare...
Actually, Cabal 3.6.3.0 has been released (but not cabal-install 3.6.3.0). I don't remember what the changes were, but I think they were requested by the kind GHC folk. I wonder how master branch would fare...
I did test master (0a2e68cbde9ad8dafd67c18511e7117956060f9b) and it worked there.
Great news. I hope that means 3.8 has the fix, too, whatever it is. Is it important that we identify which PR fixed this, or can we close as is?
For me closing as is is fine.
Thank you all. Closing.
I just encountered this, using cabal-3.10.1.0 on Linux, while trying to build with a modified GHC 9.4.4.
Error: cabal-3.10.1.0: Cannot find the program 'ghc'. User-specified path
'../ghc-9.4.4-x86_64-unknown-linux/bin/ghc' does not refer to an executable
and the program is not on the system path.
Using an absolute path solves the issue.
@konsumlamm thank you for reporting! Would it be possible to try cabal 3.8 on your end?
With cabal 3.8 (and cabal 3.6) I get the same result.
This is still something that happens with 3.13.0.0
! Especially it's quite irritating when working on Haddock:
-with-compiler: ghc-9.7
+with-compiler: ../../_build/stage1/bin/ghc
Build profile: -w ghc-9.11.20240611 -O1
In order, the following will be built (use -v for more details):
- ghc-paths-0.1.0.12 (lib:ghc-paths) (requires build)
- haddock-library-1.11.0 (lib) (first run)
- haddock-api-2.30.0 (lib) (first run)
- haddock-2.30.0 (exe:haddock) (first run)
Warning: this is a debug build of cabal-install with assertions enabled.
Starting ghc-paths-0.1.0.12 (all, legacy fallback: build-type is Custom)
Configuring library for haddock-library-1.11.0...
Error: [Cabal-5490]
Cannot find the program 'ghc'. User-specified path '../../_build/stage1/bin/ghc' does not refer to an executable and the program is not on the system path.
It also happens on arm macos. Could we resolve the relative path instead of passing it around?
(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: