In this blog I talk about some of the personal work I do in programming. I mainly do Java and JavaScript, but I'm learning functional programming in Haskell too...

Thursday, September 30, 2010

EclipseFP 2.0.0 released!

Hello all,

I'm proud to announce version 2.0.0 of EclipseFP, the Eclipse plugin for Haskell coding. The change in the major version number shows that some big changes have been made, even if under the hood:
- the Antlr parsing has been removed
- the JFace based syntax highlighter has been removed
We now rely solely on Scion and the GHC API to provide lexer tokens! This fixes some long standing syntax highlighting bugs while giving us more options for coloring.
Also, we now communicate to the Scion library via standard streams instead of network calls, which should solve some headaches.

There are also loads of bug fixes and small enhancements peppered a bit everywhere, either things that people asked or things that I did for myself, since EclipseFP is (of course) my IDE of choice for my Haskell coding. The release notes can be found here.

Another good news is that I'm not alone in hacking at EclipseFP, scooter has helped a lot with Helios, Cabal 1.6, GHC 6.10 and Mac OS X support, and has a few new features coming up soon!

Are you using MacPorts' cabal, MacPorts' cabal-0.8.0 or the Haskell Platform? Or just a non-standard cabal executable that's not named "cabal"?

Specifically, EclipseFP looks for a program named "cabal" on PATH and a few other places (like $HOME/.cabal/bin). It parses the cabal program's version and sets the flags passed to the scion-server "cabal install" command line appropriately.

But the executable has to be named "cabal"!

The next release of EclipseFP will include a combined cabal/scion preference page that will allow more flexibility in which installed cabal is used to build the built-in scion server.

Also, if you check your Eclipse log, you should see various cabal information reported, like the cabal library version and cabal-install version. That stuff is logged intentionally and should tell you where EclipseFP is picking up cabal.

hey JP, I am sorry, I thought eclipsefp would configure it fully.I updated cabal, but eclipefp has still a problem with a dependency on containers, see trace below.Is it the the case that ghc-6.10.3 is just too old?Maybe I should just wipe out my haskell installation and install the newest one.

TRACE:

cabal.exe: cannot configure list-tries-0.4. It requires containers ==0.3.*For the dependency on containers ==0.3.* there are these packages:containers-0.3.0.0. However none of them are available.containers-0.3.0.0 was excluded because template-haskell-2.3.0.1 requirescontainers ==0.2.0.1containers-0.3.0.0 was excluded because hpc-0.5.0.3 requires containers==0.2.0.1containers-0.3.0.0 was excluded because containers-0.2.0.1 was selectedinsteadcontainers-0.3.0.0 was excluded because Cabal-1.6.0.3 requires containers==0.2.0.1containers-0.3.0.0 was excluded because ghc-6.10.3 requires containers==0.2.0.1

No we don't run cabal update just in case it messes up somebody install with recent libraries they didn't want... EclipseFP should work on GHC 6.10 but it looks likes there's an issue now on the version of list-tries it downloads. I have list-tries 0.2 on my machine, so first force an install of this version and try again.

I tried your suggestion, for other people with the same problem it might be of interest:

C:\WINDOWS\system32>cabal install list-tries-0.2Resolving dependencies...cabal: cannot configure containers-0.3.0.0. It requires base >=4.2 && <6For the dependency on base >=4.2 && <6 there are these packages: base-4.2.0.0,base-4.2.0.1 and base-4.2.0.2. However none of them are available.base-4.2.0.0 was excluded because of the top level dependency base -anybase-4.2.0.1 was excluded because of the top level dependency base -anybase-4.2.0.2 was excluded because of the top level dependency base -any

-------------Next I found this: http://osdir.com/ml/haskell-cafe@haskell.org/2010-01/msg00305.html

C:\WINDOWS\system32>cabal install --reinstall hlintsetup.exe: happy version >=1.17 is required but it could not be found.cabal: Error: some packages failed to install:haskell-src-exts-1.9.4 failed during the configure step. The exception was:exit: ExitFailure 1hlint-1.8 depends on haskell-src-exts-1.9.4 which failed to install.

---C:\WINDOWS\system32>cabal install happy

setup.exe: perl is required but it could not be found.cabal: Error: some packages failed to install:

--- so wtf, now perl is required to run build happy?It seems like I cannot go further. This is turning to be a dependency hell. xD

Yep, not pretty. The problem is coming from containers-3.0.0, which is not compatible with GHC 6.10. I'm surprised that cabal doesn't recognize your version of base and stick to that. Maybe there are some flags we need to pass to get GHC 6.10 support.

C:\WINDOWS\system32>cabal install containers-0.2.0.1Resolving dependencies...No packages to be installed. All the requested packages are already installed.If you want to reinstall anyway then use the --reinstall flag.

Data\IntMap.hs:182:7: Could not find module `Data.Data': it is a member of the hidden package `base' Use -v to see a list of the files searched for.cabal: Error: some packages failed to install:containers-0.2.0.1 failed during the building phase. The exception was:exit: ExitFailure 1

C:\WINDOWS\system32>cabal install containers-0.3.0.0Resolving dependencies...cabal: cannot configure containers-0.3.0.0. It requires base >=4.2 && <6For the dependency on base >=4.2 && <6 there are these packages: base-4.2.0.0,base-4.2.0.1 and base-4.2.0.2. However none of them are available.base-4.2.0.0 was excluded because of the top level dependency base -anybase-4.2.0.1 was excluded because of the top level dependency base -anybase-4.2.0.2 was excluded because of the top level dependency base -any

---

containers-0.3.0.0 is the last one, which is in incompatible with ghc 6.10 as you said.I wonder what flags there are that could resolve the conflicts, but if that is difficult you could also force people to upgrade of course :)

Well we ensured that the code in the scion library is compatible with GHC 6.10 and 6.12, and several version of Cabal as well, so it's a shame that this cabal dependency hell forces people to upgrade... I'm not sure how come you cannot recompile a package that you add.Sometimes, in my experience, it only takes the install of one package with dubious dependencies to put the whole system in a mess... http://www.haskell.org/cabal/FAQ.html is probably a good place to look, but it should be easier, I agree...

xceptione, you may be able to use ghc-pkg. Use ghc-pkg list and look at the packages in your user package db, some may be the problem. It already happen to me before, on unrelated stuff, to start getting this same kind of errors when I started upgrading my packages a bit too eagerly. Of course, moving to GHC 6.12 with the latest version of the Haskell Platform would be a good move too...

Does the build system support FFI linkage to native libraries? I'm trying to call a function in the GNU Scientific Library, but during linkage I get an "undefined reference" regarding the function in question.

Weird thing is, 'cabal build' works perfectly. And I can also run the program from 'ghci Main.hs -lgsl' without problems, only build through EclipseFP complains. Any ideas?

Claus, I have no idea. EclipseFP builds projects through the scion API via a mixture of Cabal and GHC API calls, so fundamentally it's not that much different than doing Cabal builds. Could it be path related? Paths that cabal takes into account but not when we call it through scion... Maybe ask the scion mailing list and if they have a solution we can incorporate it in EclipseFP. I'm not too familiar with FFI and I work on Windows, but I can try to reproduce.

Does anyone else have problems where no changes to Haskell/Scion and Cabal can be made? I tried checking the built-in scion server, and manually inserting path to the externally built scion server, but no changes would be saved...