haskell-idea-plugin icon indicating copy to clipboard operation
haskell-idea-plugin copied to clipboard

Error:cabal: configure failed

Open atsky opened this issue 10 years ago • 29 comments

I keep getting this error when I attempt to compile a module: "Error:cabal: configure failed." GHC sdk is set, and it works when I run "cabal run" from the command line. Any idea what could cause this?

atsky avatar Oct 21 '14 10:10 atsky

Same here. Everything works when I run it with ghci or compile it with ghc.

Information:cabal: Start configure Information:cabal: cabal: ghc: missing -B<dir> option Information:Module "Formal" was fully rebuilt due to project configuration/dependencies changes Information:Compilation completed with 1 error and 0 warnings in 4 sec Information:1 error Information:0 warnings Error:cabal: configure failed.

strelec avatar Oct 21 '14 17:10 strelec

Hi, here are some details about my system, on which this bug is reproducing every time: *OS: Manjaro 0.8.10 64-bit *ghc: 7.8.3 *ghc-mod: 5.0.1.1 *cabal: 1.20.0.3 using version 1.20.0.2 of the Cabal lib *buildwrapper: 1.18.1.3 using version 1.18.1.3 of the Cabal lib (might this cause problems?) *latest Idea Community (13.1.5) *idea.log when this happens: INFO - lij.compiler.impl.CompilerUtil - COMPILATION FINISHED (BUILD PROCESS); Errors: 1; warnings: 0 took 812 ms: 0 min 0s

Please let me know if you need anything else. Thanks

teodanciu avatar Oct 21 '14 18:10 teodanciu

Arch linux for me.

The bug occurs if I use either cabal of arch-haskell repository.

strelec avatar Oct 21 '14 19:10 strelec

I have found workaroud. You have to specify in SDK

GHC home path: /usr

atsky avatar Oct 23 '14 11:10 atsky

Nope, doesn't work:

18:00:30 Compilation completed successfully in 8 sec 18:00:30 Error running haskell2: Module not specified

strelec avatar Oct 23 '14 16:10 strelec

@strelec, this is another problem. Something wrong with your run configuration.

atsky avatar Oct 23 '14 17:10 atsky

@Atsky This works for me. I can use the plugin now, thanks!

teodanciu avatar Oct 24 '14 08:10 teodanciu

Can't seem to point GHC home path to /usr, keep on getting the message that this is not a valid ghc home path. Don't get that message when I use /usr/local (ghc is in /usr/local/bin/ghc), but then I get the compilation problem. Ubuntu 14.04, IntelliJ 13.1.5. I use a cabal sandbox.

KasperJanssens avatar Nov 14 '14 09:11 KasperJanssens

@KasperJanssens, you should use /usr/local. What compilation problem you get?

atsky avatar Nov 14 '14 10:11 atsky

Same one as mentioned in the topic, as soon as I start the compilatoin I get cabal: configure failed. I found this thread where you mentioned as a workaround to this problem to specify in SDK GHC home path: /usr. So I thought to try this, but that doesn't seem to do the trick for me. Did I misunderstand the work around? Or is this work around just for arch linux?

KasperJanssens avatar Nov 14 '14 10:11 KasperJanssens

@KasperJanssens , This is workaround just for problem with Arch and Manjaro. Did you get another messages except "cabal: configure failed"?

atsky avatar Nov 14 '14 10:11 atsky

No, that seems to be it, the paths are pointing to the correct directories, so it should find cabal. I am using a cabal sandbox though, something to do with that?

2014-11-14 11:53 GMT+01:00 Evgeny Kurbatsky [email protected]:

@KasperJanssens https://github.com/KasperJanssens , This is workaround just for problem with Arch and Manjaro. Did you get another messages except "cabal: configure failed"?

— Reply to this email directly or view it on GitHub https://github.com/Atsky/haskell-idea-plugin/issues/58#issuecomment-63042368 .

KasperJanssens avatar Nov 14 '14 17:11 KasperJanssens

Hmm, I don't have it with my Intellij 14 at home, I do have it with the one at work. I'll try to compare and check what the differences are on Monday. Might be something else wrong...

2014-11-14 18:20 GMT+01:00 Kasper Janssens < [email protected]>:

No, that seems to be it, the paths are pointing to the correct directories, so it should find cabal. I am using a cabal sandbox though, something to do with that?

2014-11-14 11:53 GMT+01:00 Evgeny Kurbatsky [email protected]:

@KasperJanssens https://github.com/KasperJanssens , This is workaround just for problem with Arch and Manjaro. Did you get another messages except "cabal: configure failed"?

— Reply to this email directly or view it on GitHub https://github.com/Atsky/haskell-idea-plugin/issues/58#issuecomment-63042368 .

KasperJanssens avatar Nov 14 '14 17:11 KasperJanssens

@Atsky Thanks! Specifying /usr as GHC SDK path helps a lot.

AlexanderKaraberov avatar Nov 15 '14 12:11 AlexanderKaraberov

@Atsky Specifying /usr as GHC SDK path worked for me as well. Thanks!

amrhassan avatar Nov 16 '14 14:11 amrhassan

Rebuilt my docker container again, so I started fresh with cabal and intellij and so on, and nor more issues with cabal configure, it seems.

KasperJanssens avatar Nov 17 '14 08:11 KasperJanssens

for mac users the GHC home path should be the first suggested, not any subdirectory: /Library/Frameworks/GHC.framework/Versions/7.8.3-x86_64/usr However my next target now is getting debugger work..

vilinski avatar Nov 25 '14 18:11 vilinski

@KasperJanssens do you run your idea also in docker? can you share the Dockerfile?

vilinski avatar Nov 25 '14 19:11 vilinski

It's the dockerfile from work, so it's full of stuff that's only accessible through work. I'll try to provide you with a stripped down version from it, hopefully in the weekend. It's basically a fresh ubuntu 14.04 with ghc, cabal and cabal-install compiled from source, intellij downloaded. The plugin still needs to be enabled manually then.

KasperJanssens avatar Nov 27 '14 13:11 KasperJanssens

@Atsky Thanks, you saved my day with this workaround! But is there any investigation on this? Is it possible to help on this issue?

aka-bash0r avatar Dec 08 '14 13:12 aka-bash0r

Just for the issue update, it still happens, my OS is a Debian 8 (sid), and the /usr hack solved for me too.

leonardiwagner avatar Aug 23 '15 18:08 leonardiwagner

It's still here for me. I use Exherbo (source based distribution), ghc home are /usr/x86_64-pc-linux-gnu/bin/ghc and /usr/lib/ghc-7.10.2. The issue is strange. Why this problem happens?

GauthierPLM avatar Nov 02 '15 16:11 GauthierPLM

@Kendos-Kenlen, problem is that there are two ghc executables in system: one is wrapper script that add command line parameter -B. If plugin run wrong ghc executable everything it fails.

atsky avatar Nov 03 '15 15:11 atsky

@atsky Sorry, but the bug is still there. I am trying to run the plugin with Haskell on Windows and has been running into the same error message. When I try to change the SDK home to C:/Users/xxxx/ (as mentioned in your initial workaround), it fails to recognize the directory as a valid home directory for the GHC. I couldn't either find a /user/ in the sub-directories of Haskell installation.

chiffa avatar Dec 13 '15 23:12 chiffa

Is this already solved? I also have a Windows installation and failing with the same message.

c05m1x avatar Mar 18 '16 12:03 c05m1x

There is a solution for Windows?

cosmin-ionita avatar Apr 13 '16 09:04 cosmin-ionita

On Ubuntu 16.04 setting the GHC home path to /usr/lib/ghc fixed this issue for me. I changed it under the project's module settings (F4) > SDKs.

hcvst avatar May 28 '16 12:05 hcvst

Also had this on Arch, with default GHC from yaourt/community and a fresh copy of IntelliJ set up with no custom settings related to GHC.

Still fixable by just changing GHC home to /usr, but this isn't very user friendly to have to do, and I had almost given up and just fallen back to using terminal before I found this issue.

That said, it seems like an excellent plugin otherwise - thanks! :)

ashleydavies avatar Nov 12 '16 01:11 ashleydavies

Same problem in Windows 10. Here is the return message:

Information:cabal: Start configure Information:cabal: cabal: haskell_hello_world.cabal:1: Parse of field 'name' failed. Information:11/23/2016 10:49 PM - Compilation completed with 1 error and 0 warnings in 3s 368ms Error:cabal: configure failed.

I checked about the path of GHC and SDK, everything seem to be OK. With command line compile "ghc -o helloworld Main.hs", and compile succeed. Any solution?

tonyfloatersu avatar Nov 23 '16 15:11 tonyfloatersu