Cabal support
This patch adds support of Cabal packages.
Hdevtools currently doesn't know anything about Cabal system: it can't find out source code directories, package database locations, list of packages or Haskell language extensions to use.
This patch adds support of extracting GHC options based on Cabal package description, support for Cabal sandboxes.
Great!
Yes please. Is this mergeable?
I'm planning to work on this further to improve usability but it is pretty usable already.
:+1: Yay!
Looking forward to this :)
:+1:
Are cabal sandboxes working in this current branch? If so - what is the process for using sandboxes with hdevtools?
You need to have cabal.sandbox.config next to your *.cabal file (as you normally do). Then you run hdevtools command for some file inside your cabal package and the rest is take care automatically.
I think my problem may be that I'm running ghc7.8. hdevtools -V shows "no cabal support".
Right. Hdevtools depends on GHC which depends on particular Cabal version (1.16 for GHC 7.6 and 1.18 for GHC 7.8). Hdevtools cabal code depends on Cabal API which has changed. I do not have GHC 7.8 available so I can't support that version. If you can point me to instructions on how to install GHC 7.8, that would help.
I'm also working on a patch, though I'm working beyond my skill level :(.
Here's the rc2 release http://www.well-typed.com/blog/87/ which links to a list of binary distributions. Each has a README (and I think an INSTALL). Installing is a simple ./configure, sudo make install.
@maximkulkin I've made a pull request to your branch that adds support for ghc 7.8. https://github.com/maximkulkin/hdevtools/pull/1
+1
@maximkulkin yep, installing GHC 7.8 is really easy (as schell suggests) and works cleanly alongside whatever other versions of GHC you have installed (the only thing that might be overwritten is the symlinks e.g. /usr/bin/ghc, at least for me on Debian).
For Debian x86 I do this (but see here for other options):
$ wget https://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-i386-unknown-linux-deb7.tar.xz
$ tar xf ghc-7.8.2-i386-unknown-linux-deb7.tar.xz
$ cd ghc-7.8.2
$ ./configure && sudo make install
I'm also very keen on using this with 7.8; thanks for your work.
Will this automatically take into account the extensions defined in the .cabal file?
I'm asking this because I just tried this on a Yesod scaffold project, which defines TemplateHaskell in the .cabal file, but when I hdevtools check Model.hs, which uses TemplateHaskell, I'll get an error
Parse error: naked expression at top level
Perhaps you intended to use TemplateHaskell
Yes, this patch takes default language extensions defined in .cabal file into account.
@maximkulkin In that case something probably isn't working properly. At least QuasiQuotes aren't being recognized in a scaffolded Yesod project.
Settings.hs:41:24: parse error on input ‘{’
Here's the specific file, I've pushed the whole project so that we can more easily reproduce it https://github.com/darthdeus/hdevtools-pikachu/blob/master/Settings.hs
It might be because I'm trying this on GHC 7.8.2. I tested this by merging your branch with #28, here's the final version for reference https://github.com/darthdeus/hdevtools/tree/ghc7.7
@darthdeus Yes, this patch doesn't support GHC 7.8 yet. You might see "no cabal support" in output of "hdevtools --version". I plan to work on this in near future.
@maximkulkin, @darthdeus - I've been using my branch that added support for GHC 7.8 and it seems to be working well :)
https://github.com/maximkulkin/hdevtools/pull/1
@schell I hope it gets merged soon then :(
Hi folks, just checking on this: is this still open? Any chance of merging into the mainline soon? (And if so will it work for 1.20?) Thanks!
This is merged in my fork. I don't have collaboration rights to this repo but I do have access to the hdevtools hackage, so my fork (https://github.com/schell/hdevtools) is what is currently on hackage. @bitc can you make me a collaborator with admin privileges so we can sync hdevtools work? I can also manage the tickets here.
A side note: I would strongly advise moving to GHC 7.10. GHC before 7.10 had a dependency on particular Cabal version which made using hdevtools with support for newer Cabal versions a problem. Starting from GHC 7.10 there is no such dependency and you can build hdevtools against Cabal version that you have. This is in theory: I haven't chance to play with GHC 7.10 and update this pull request yet.
Super! So the version I have after cabal installing (1.0.9) should have it right?
On Jun 12, 2015, at 10:38 AM, Schell Carl Scivally [email protected] wrote:
This is merged in my fork. I don't have collaboration rights to this repo but I do have access to the hdevtools hackage, so my fork (https://github.com/schell/hdevtools) is what is currently on hackage. @bitc can you make me a collaborator with admin privileges so we can sync hdevtools work? I can also manage the tickets here.
— Reply to this email directly or view it on GitHub.
Yes - cabal should install the newest version just fine on GHC 7.8.3 and even GHC 7.10.1.
On Jun 12, 2015, at 10:43 AM, Ranjit Jhala [email protected] wrote:
Super! So the version I have after cabal installing (1.0.9) should have it right?
On Jun 12, 2015, at 10:38 AM, Schell Carl Scivally [email protected] wrote:
This is merged in my fork. I don't have collaboration rights to this repo but I do have access to the hdevtools hackage, so my fork (https://github.com/schell/hdevtools) is what is currently on hackage. @bitc can you make me a collaborator with admin privileges so we can sync hdevtools work? I can also manage the tickets here.
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub https://github.com/bitc/hdevtools/pull/30#issuecomment-111571191.
hmm. I get this odd error:
hdevtools: <socket: 4>: hGetLine: end of file
Any idea? (I thought it might be some difficulty with parsing a new cabal format)
On Fri, Jun 12, 2015 at 11:06 AM, Schell Carl Scivally < [email protected]> wrote:
Yes - cabal should install the newest version just fine on GHC 7.8.3 and even GHC 7.10.1.
On Jun 12, 2015, at 10:43 AM, Ranjit Jhala [email protected] wrote:
Super! So the version I have after cabal installing (1.0.9) should have it right?
On Jun 12, 2015, at 10:38 AM, Schell Carl Scivally < [email protected]> wrote:
This is merged in my fork. I don't have collaboration rights to this repo but I do have access to the hdevtools hackage, so my fork ( https://github.com/schell/hdevtools) is what is currently on hackage. @bitc can you make me a collaborator with admin privileges so we can sync hdevtools work? I can also manage the tickets here.
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub < https://github.com/bitc/hdevtools/pull/30#issuecomment-111571191>.
— Reply to this email directly or view it on GitHub https://github.com/bitc/hdevtools/pull/30#issuecomment-111577105.
Ranjit.
What command are you running? On which project (if you can tell me)? And what is the output of hdevtools —version?
On Jun 12, 2015, at 11:11 AM, Ranjit Jhala [email protected] wrote:
hmm. I get this odd error:
hdevtools: <socket: 4>: hGetLine: end of file
Any idea? (I thought it might be some difficulty with parsing a new cabal format)
On Fri, Jun 12, 2015 at 11:06 AM, Schell Carl Scivally < [email protected]> wrote:
Yes - cabal should install the newest version just fine on GHC 7.8.3 and even GHC 7.10.1.
On Jun 12, 2015, at 10:43 AM, Ranjit Jhala [email protected] wrote:
Super! So the version I have after cabal installing (1.0.9) should have it right?
On Jun 12, 2015, at 10:38 AM, Schell Carl Scivally < [email protected]> wrote:
This is merged in my fork. I don't have collaboration rights to this repo but I do have access to the hdevtools hackage, so my fork ( https://github.com/schell/hdevtools) is what is currently on hackage. @bitc can you make me a collaborator with admin privileges so we can sync hdevtools work? I can also manage the tickets here.
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub < https://github.com/bitc/hdevtools/pull/30#issuecomment-111571191>.
— Reply to this email directly or view it on GitHub https://github.com/bitc/hdevtools/pull/30#issuecomment-111577105.
Ranjit. — Reply to this email directly or view it on GitHub https://github.com/bitc/hdevtools/pull/30#issuecomment-111578183.
Here's the info:
rjhala@borscht ~/r/l/p/liquid-fixpoint (cutsolver)> hdevtools
--numeric-version 0.1.0.9 rjhala@borscht ~/r/l/p/liquid-fixpoint (cutsolver)> hdevtools --version hdevtools: version 0.1.0.9 (ghc-7.8.3-x86_64-darwin, cabal-1.18.1.3)
I am running it from the command line like this:
rjhala@borscht ~/r/l/p/liquid-fixpoint (cutsolver)> hdevtools check
Fixpoint.hs hdevtools: <socket: 4>: hGetLine: end of file
I am also using flycheck-hdevtools which underlines various missing imports (which are to be obtained from the cabal file, hence I thought .cabal and cabal-sandbox support was missing?)
The source for the above (Fixpoint.hs) is:
https://github.com/ucsd-progsys/liquid-fixpoint/blob/master/Fixpoint.hs
and the corresponding .cabal file is:
https://github.com/ucsd-progsys/liquid-fixpoint/blob/master/liquid-fixpoint.cabal
(my hunch is its hitting some parse error on the cabal file?)
On Fri, Jun 12, 2015 at 11:13 AM, Schell Carl Scivally < [email protected]> wrote:
What command are you running? On which project (if you can tell me)? And what is the output of
hdevtools —version?On Jun 12, 2015, at 11:11 AM, Ranjit Jhala [email protected] wrote:
hmm. I get this odd error:
hdevtools: <socket: 4>: hGetLine: end of file
Any idea? (I thought it might be some difficulty with parsing a new cabal format)
On Fri, Jun 12, 2015 at 11:06 AM, Schell Carl Scivally < [email protected]> wrote:
Yes - cabal should install the newest version just fine on GHC 7.8.3 and even GHC 7.10.1.
On Jun 12, 2015, at 10:43 AM, Ranjit Jhala <[email protected]
wrote:
Super! So the version I have after cabal installing (1.0.9) should have it right?
On Jun 12, 2015, at 10:38 AM, Schell Carl Scivally < [email protected]> wrote:
This is merged in my fork. I don't have collaboration rights to this repo but I do have access to the hdevtools hackage, so my fork ( https://github.com/schell/hdevtools) is what is currently on hackage. @bitc can you make me a collaborator with admin privileges so we can sync hdevtools work? I can also manage the tickets here.
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub < https://github.com/bitc/hdevtools/pull/30#issuecomment-111571191>.
— Reply to this email directly or view it on GitHub https://github.com/bitc/hdevtools/pull/30#issuecomment-111577105.
Ranjit. — Reply to this email directly or view it on GitHub < https://github.com/bitc/hdevtools/pull/30#issuecomment-111578183>.
— Reply to this email directly or view it on GitHub https://github.com/bitc/hdevtools/pull/30#issuecomment-111578546.
Ranjit.
Sorry @ranjitjhala - I actually wanted the output of hdevtools --version so I can see (also) what compiler version and cabal version you're using ;)
Ah, I pasted that too above, did you get it? Else:
rjhala@borscht ~/r/l/p/liquid-fixpoint (cutsolver)> hdevtools --version
hdevtools: version 0.1.0.9 (ghc-7.8.3-x86_64-darwin, cabal-1.18.1.3)
Shoot! No! I read right past it :/ Sorry! Thanks :+1:
Yeah, it very well could be hitting a parse error - and it could also be related to https://github.com/bitc/hdevtools/issues/40. I'll have to debug this further after I get off work. Thanks!
In the meantime if you feel like updating to the latest cabal you can test to see if that's the weak link.
thanks! I will update to ghc-7.10 and cabal 1.22 and see if that sorts it out!
May the force be with you ;)