fltkhs icon indicating copy to clipboard operation
fltkhs copied to clipboard

fltkhs-0.1.0.0 does not compile

Open peti opened this issue 9 years ago • 8 comments

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’

peti avatar Feb 22 '15 17:02 peti

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.

deech avatar Feb 22 '15 18:02 deech

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

peti avatar Feb 22 '15 18:02 peti

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.

deech avatar Feb 22 '15 19:02 deech

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.

peti avatar Feb 22 '15 19:02 peti

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 avatar Feb 22 '15 19:02 deech

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.

deech avatar Feb 22 '15 19:02 deech

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 avatar Feb 22 '15 20:02 peti

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.

peti avatar Feb 22 '15 20:02 peti