Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fizbin opened this issue Jun 11, 2015 · 12 comments

Comments

@fizbin
Copy link

fizbin commented Jun 11, 2015

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

@schell
Copy link

schell commented Jun 11, 2015

Do you have a specific project this is happening on?

@fizbin
Copy link
Author

fizbin commented Jun 11, 2015

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.

@schell
Copy link

schell commented Jun 12, 2015

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 schell mentioned this issue Jun 12, 2015
@ranjitjhala
Copy link

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

@schell
Copy link

schell commented Jun 12, 2015

👍

@schell
Copy link

schell commented Jun 12, 2015

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

@fizbin
Copy link
Author

fizbin commented Jun 17, 2015

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
Copy link
Author

fizbin commented Jun 17, 2015

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

@nomeata
Copy link

nomeata commented Jul 29, 2015

I can confirm this issue with 0.1.0.9.

@nomeata
Copy link

nomeata commented Sep 10, 2015

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

@schell
Copy link

schell commented Sep 10, 2015

@nomeata - are you working on a fix?

@nomeata
Copy link

nomeata commented Sep 10, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants