hdevtools icon indicating copy to clipboard operation
hdevtools copied to clipboard

hdevtools can't handle cabal packages with both library and executable sections

Open fizbin opened this issue 10 years ago • 12 comments

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).

fizbin avatar Jun 11 '15 10:06 fizbin

Do you have a specific project this is happening on?

schell avatar Jun 11 '15 16:06 schell

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.

fizbin avatar Jun 11 '15 23:06 fizbin

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.

schell avatar Jun 12 '15 05:06 schell

Does seem to work with ghc 7.10 and cabal 1.22. Thanks!

ranjitjhala avatar Jun 12 '15 19:06 ranjitjhala

:+1:

schell avatar Jun 12 '15 20:06 schell

@fizbin - I'm think maybe that's the problem you're seeing?

schell avatar Jun 12 '15 20:06 schell

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.

fizbin avatar Jun 17 '15 01:06 fizbin

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

fizbin avatar Jun 17 '15 01:06 fizbin

I can confirm this issue with 0.1.0.9.

nomeata avatar Jul 29 '15 13:07 nomeata

BTW, I’m still in a fix for 7.8 (with Cabal 1.22.1.1, if that helps).

nomeata avatar Sep 10 '15 08:09 nomeata

@nomeata - are you working on a fix?

schell avatar Sep 10 '15 16:09 schell

sorry, must have swallowed a word. I guess I wanted to write “I’m still in need for a fix for 7.8” :-]

nomeata avatar Sep 10 '15 16:09 nomeata