EclipseFP is searching for GHC and cannot find it
I have working Eclipse (Kepler Service Release 2) + EclipseFP (2.6.0) + Haskell Platform under Windows 8.1 x64. In one moment after some cabal install, EclipseFP stopped working and showing me:
The program ghc version >=6.4 is required but it could not be found.
I have:
EclipseFP configuration found all Haskell Helper executables. It found Cabal 1.16.0.2 and GHC 7.6.3 already. From command-line GHC and cabal are found and are working. "cabal build" is working on the project from command-line, too.
This message doesn't say almost anything! If I could see the path it is searching for GHC or where it get this path from...
EDIT: Message from buildwrapper:
"C:UsershomeAppDataRoamingcabalbinbuildwrapper.exe synchronize --force=false --tempfolder=.dist-buildwrapper --cabalpath=C:Program Files (x86)Haskell Platform2013.2.0.0libextralibsbincabal.exe --cabalfile=D:Projecthaskell2SomeGLSomeGL.cabal --cabalflags= --logcabal=true
configuring because setup_config not present
"C:Program Files (x86)Haskell Platform2013.2.0.0libextralibsbincabal.exe" "configure" "--verbose=1" "--user" "--enable-tests" "--enable-benchmarks" "--builddir=D:Projecthaskell2SomeGL.dist-buildwrapperdist" cabal.exe: The program ghc version >=6.4 is required but it could not be found."
Calling exactly the last line from cmd.exe (as normal non-admin user) everything is working fine:
"C:Program Files (x86)Haskell Platform2013.2.0.0libextralibsbincabal.exe" "configure" "--verbose=1" "--user" "--enable-tests" "--enable-benchmarks" "--builddir=D:Projecthaskell2SomeGL.dist-buildwrapperdist"
EDIT: To find the potential path environement that is used I tried to run GHCi console inside Eclipse and tried:
import System.Environment
x <- getEnvironment
filter ( (a,_) -> a == "Path") x
and got something that is starting with:
[("Path","C:Program Files (x86)Haskellbin;C:Program Files (x86)Haskell Platform2013.2.0.0libextralibsbin;C:Program Files (x86)Haskell Platform2013.2.0.0bin;...")]
First folder is invalid, but Haskell Platform is valid and working. Another thing I found. One of times I have run "Build All" command there was run Process in Eclipse with GHC and the path was:
Running executable C:Program Files (x86)Haskell Platform2013.2.0.0binghc.exe
I went to see this process details and it is run from the same user that is currently Eclipse run with. And the path is correct, but I still got the error:
The program ghc version >=6.4 is required but it could not be found.
Running from command-line still it is working. The program has errors, but only in command-line I see them.
Could someone help with finding this problem?
EDIT: I found some interesting issue. Running "Build All" command is executing this command:
C:UsersmyuserAppDataRoamingcabalbinbuildwrapper.exe synchronize --force=false --tempfolder=.dist-buildwrapper --cabalpath=C:Program Files (x86)Haskell Platform2013.2.0.0libextralibsbincabal.exe --cabalfile=D:haskellSomeGLSomeGL.cabal --cabalflags= --logcabal=true
Which run from command-line gives an error. The problem is that there are no quotes around cabalpath, because it has spaces in it. When I run it that way from command-line it works:
C:UsersmyuserAppDataRoamingcabalbinbuildwrapper.exe synchronize --force=false --tempfolder=.dist-buildwrapper --cabalpath="C:Program Files (x86)Haskell Platform2013.2.0.0libextralibsbincabal.exe" --cabalfile=D:haskellSomeGLSomeGL.cabal --cabalflags= --logcabal=true
I think that all "--cabalfile" parameters should have quotes, because paths could have spaces in them. I still don't know if this is the problem under Eclipse.
I found the problem!
It is that EclipseFP 2.6.0 is using upper case "PATH" variable, but my Windows 8.1 use "Path" and programatically some kind it is possible to have valid two variables "PATH" and "Path" when executing BuildWrapper and Cabal. So something is messing up.
Workaround for this problem is if you rename from Control Panel | System | Environment variables for both User and System from "Path" to "PATH".
I hope this could be fixed in EclipseFP so it could in future work in any case.
Building your project means that under the scenes, cabal build is launched. If you activate the debugging mode in the Haskell helper executable preference page (show BuildWrapper responses), you should see the exact cabal build command being sent. It could be that the path used in Eclipse is different than the path used in the command line, check you eclipse shortcuts. EclipseFP can find the executables because it searches also in some well known folders on windows. You can also take the current dev version of EclipseFP from github. It should now pass --with-ghc to cabal invocations to make sure the path detected in Eclipse is the one used.
链接地址: http://www.djcxy.com/p/43404.html上一篇: GHC版本检入代码