hdevtools
hdevtools copied to clipboard
Not handling cabal-dev projects?
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.
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.
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.
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.
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()
Use the new cabal sandbox feature. This issue should be able to be deprecated.
Agreed, cabal sandbox has been working great, just need to convert over our tooling to use it.
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
@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 Yes. More like "not handling hsenv properly", but since it all was discussed here, I posted it to this issue.
Having a similar issue. *.hi is not seen.
Is there any work around to tell hdevtools to check for .hi files?