deech / fltkhs

Haskell bindings to FLTK GUI toolkit.
MIT License
190 stars 24 forks source link

fltkhs-0.1.0.0 does not compile #7

Open peti opened 9 years ago

peti commented 9 years ago

Citing from http://hydra.cryp.to/build/578083/nixlog/2/raw:

[1 of 1] Compiling Main             ( Setup.hs, /tmp/nix-build-haskell-fltkhs-0.1.0.0.drv-0/Main.o )

Setup.hs:168:51: Not in scope: ‘buildNumJobs’
deech commented 9 years ago

The short answer is that this is due to using an incompatible version of Cabal. >= 1.20 is required. Which version is this build server using?

Cabal >= 1.20 made a breaking change which requires this field to be passed in when building an executable. I don't actually use buildNumJobs anywhere but since I have customized hooks I need to pass it to buildExe simply to keep compiler happy.

I'm not sure how to fix this elegantly without resorting to ugly #ifdef's.

peti commented 9 years ago

This build was run with GHC 7.8.4, which ships Cabal version 1.18.x.

deech commented 9 years ago

Hmm ... it should have spit out an error before it got to this stage because fltkhs.cabal specifies cabal-version: >=1.20. Try upgrading cabal with cabal install cabal-install and try the build again.

peti commented 9 years ago

Note that this error occurs while compiling Setup.hs. The error message about Cabal would be printed by ./Setup configure, but we don't even get to that stage.

deech commented 9 years ago

Yeah, not quite sure what to do here. The problem is breaking API changes between Cabal 1.18 and 1.20. Do you know what CPP macro detects Cabal version?

deech commented 9 years ago

Had this been installed with cabal install this would have been detected. Unless you have a better suggestion I'm going to hunt for some #define that has the current Cabal version.

peti commented 9 years ago

I don't believe that there's any such define available. It's available after the configure stage, but regular ghc doesn't provide anything like that, IMHO.

peti commented 9 years ago

Maybe it would be worthwhile to open an issue at https://github.com/haskell/Cabal for this? The fact that you need to pass buildNumJobs even though you don't need it doesn't feel like it's intended to be this way.