hdevtools can't handle cabal packages with both library and executable sections
Starting with version 0.1.0.7, the hdevtools server will crash if asked to check a file in a .cabal package that has both a library and one or more executable sections.
On my box, I see this in the window where I start the server:
$ hdevtools admin -n --start-server
Configuring MYPACKAGE-1.2.1.1...
hdevtools: internal error: unexpected package db stack: [GlobalPackageDB,UserPackageDB,SpecificPackageDB "/Users/me/MYPACKAGE/.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d",GlobalPackageDB,UserPackageDB,SpecificPackageDB "/Users/me/MYPACKAGE/.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d"]
The client exits with the error message:
hdevtools: <socket: 15>: hGetLine: end of file
This does not happen in version 0.1.0.6, but happens in 0.1.0.7 and in the most recent version (0.1.0.9).
Do you have a specific project this is happening on?
I first encountered this on some proprietary code for work, but I also see the same symptoms on my small cabal test project at https://github.com/fizbin/cabal-demo-backflip
Note that I can hdevtools check files in this project just fine with version 0.1.0.6, but not with any subsequent version.
What is the output of hdevtools --version? I can't reproduce this bug with the project you listed. It seems to be type checking just fine (and displaying errors I introduce). I'm using hdevtools: version 0.1.0.9 (ghc-7.10.1-x86_64-darwin, cabal-1.22.2.0) and I'm thinking that if you're still on ghc 7.8.3 then maybe some of hdevtool's newer CPP conditions are funky.
Does seem to work with ghc 7.10 and cabal 1.22. Thanks!
:+1:
@fizbin - I'm think maybe that's the problem you're seeing?
Yes, sorry for the much-delayed reply. That is the issue I am seeing.
fizbin@Mac backflip$ hdevtools --version
hdevtools: version 0.1.0.9 (ghc-7.8.3-x86_64-darwin, cabal-1.18.1.4)
I'll look into switching to 7.10, though some of the code I'm maintaining needs to continue to compile against GHC 7.4.1, so I'll see how painful it is to be bridging both sides of the AMP.
In the meantime, I do have a workaround: use hdevtools 0.1.0.6.
Also, the exact error shown above requires that you be working in a cabal sandbox, though a very similar error (showing a bad stack of [GlobalPackageDB,UserPackageDB,GlobalPackageDB,UserPackageDB]) happens without the sandbox
I can confirm this issue with 0.1.0.9.
BTW, I’m still in a fix for 7.8 (with Cabal 1.22.1.1, if that helps).
@nomeata - are you working on a fix?
sorry, must have swallowed a word. I guess I wanted to write “I’m still in need for a fix for 7.8” :-]