hdevtools icon indicating copy to clipboard operation
hdevtools copied to clipboard

Not handling cabal-dev projects?

Open jwiegley opened this issue 11 years ago • 11 comments

I have a large project that I build with cabal-dev. "hdevtools check" claims that a module installed into my cabal-dev isn't available, while "ghc-mod check" works correctly.

jwiegley avatar Jan 16 '13 21:01 jwiegley

I personally use hsenv, rather than cabal-dev, which works great with hdevtools. (And I personally find it more powerful and easier to use, not requiring learning any new commands).

Since I'm not that familiar with cabal-dev, I'm not sure what is necessary to add support for it. I think I remember reading that ghc-mod had to specifically add support for it.

Anyway, cabal-dev support is definitely something that would be good to have in hdevtools.

bitc avatar Jan 17 '13 11:01 bitc

I would love to use hsenv, but I've never been able to get it to work for any of the meaningful projects I work on on my Mac, while cabal-dev has never given me any problems so far.

jwiegley avatar Jan 17 '13 21:01 jwiegley

I've switched to using hsenv, but am having the exact same problem. It can't find any of my installed packages, while GHC can in the same environment.

jwiegley avatar May 15 '13 06:05 jwiegley

when i was still using cabal-dev (i'm using cabal sandboxes now), the following vim snippet worked for me. it should be easy to adopt to your situation/editor. having said that, native integration would be great as well. it might be nice to teach hdevtools to read the cabal file...

function! FindCabalDevRoot()
    return finddir('cabal-dev', './;')
endfunction

function! FindCabalDevRootPackageConf()
    return glob(FindCabalDevRoot().'/packages-*.conf')
endfunction

let g:hdevtools_options = '-g-ilib -g-isrc -g-i. -g-Wall -g-XOverloadedStrings -g-package-conf='.FindCabalDevRootPackageConf()

ibotty avatar Sep 12 '13 18:09 ibotty

Use the new cabal sandbox feature. This issue should be able to be deprecated.

gregwebs avatar Sep 12 '13 19:09 gregwebs

Agreed, cabal sandbox has been working great, just need to convert over our tooling to use it.

jwiegley avatar Sep 15 '13 20:09 jwiegley

Looks like hdevtools explicitly searches for *.hs files even when only *.hi are installed:

[hsenv]➜  geometroid git:(master) ✗ hdevtools check -g '-v' Fighting.hs
...
<no location info>: *** Chasing dependencies:
<no location info>: Chasing modules from: *Fighting.hs
Fighting.hs:9:18:
    Could not find module `Data.Random.Extras'
    Perhaps you meant
      Data.Random.RVar (from random-fu-0.2.4.0)
      Data.Random.Source (from random-source-0.3.0.6)
    Locations searched:
      Data/Random/Extras.hs
      Data/Random/Extras.lhs
[hsenv]➜  geometroid git:(master) ✗ ls ../.hsenv/cabal/lib/random-extras-0.19/ghc-7.6.2/Data/Random/          
Distribution  Dovetail.hi  Extras.hi  Show  Shuffle

mkpankov avatar Oct 20 '13 18:10 mkpankov

@constantius9 Is this related to this issue #6 "Not handling cabal-dev projects?"? If not, could you please open a new issue for this? Thanks!

bitc avatar Nov 10 '13 23:11 bitc

@bitc Yes. More like "not handling hsenv properly", but since it all was discussed here, I posted it to this issue.

mkpankov avatar Nov 12 '13 19:11 mkpankov

Having a similar issue. *.hi is not seen.

tomberek avatar Dec 26 '13 17:12 tomberek

Is there any work around to tell hdevtools to check for .hi files?

tomberek avatar Jan 13 '14 04:01 tomberek