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

Pass hs-source-dirs to ghci #180

Closed
qrilka opened this issue Jul 11, 2013 · 7 comments
Closed

Pass hs-source-dirs to ghci #180

qrilka opened this issue Jul 11, 2013 · 7 comments

Comments

@qrilka
Copy link

qrilka commented Jul 11, 2013

Actually this issue comes from https://groups.google.com/d/topic/haskell-cafe/Pe2d2VXIN9A/discussion - because of it I switched to ghci (from cabal-dev) but my sources are in src so when I load test module I get errors with imports. I've added -isrc to haskell-process-args-ghci but it looks like it would be nicer if haskell-mode could get that setting from cabal file.

@hvr
Copy link
Member

hvr commented Jul 11, 2013

a few notes:

  • cabal-dev ghci should do that already now (but this might require you to use the haskell-interactive-mode instead of inf-haskell)
  • cabal-install has more general built-in cabal repl feature in the works (maybe @dcoutts can provide some information about the current progress), I'd rather not have to reinvent the wheel.
  • cabal-ghci might work too
  • implementing this in haskell-mode requires some way to properly parse the .cabal file, which I'm not sure is worth the effort, given the first two points above would render that redundant.

@qrilka
Copy link
Author

qrilka commented Jul 11, 2013

cabal-dev ghci works fine with it but it fails to work with multible build-depends in 1 cabal file (as I say in the linked cafe posting) so loading modules with fails in haskell-mode. Is cabal-dev recommended for haskell-mode so this problem should be addressed within that project?
With ghci (and manually set options) I have everything working but that seems to be hackish way to get project with tests working OK with haskell-mode.

@hvr
Copy link
Member

hvr commented Jul 11, 2013

btw, by "multiple build-deps" you actually mean multiple build-targets?

@qrilka
Copy link
Author

qrilka commented Jul 11, 2013

As I describe in cafe I have library section (with its build-depends) and test-suite setion with it's own build-depends (as it's quite meaningful to include HUnit, QuickCheck and other such dependencies into library dependencies)
Or I'm doing it wrong and there is some better way to use tests than cabal's test-suite?

@hvr
Copy link
Member

hvr commented Jul 12, 2013

Fwiw, cabal repl is supposed (once it's finished/merged) to let you select for which build-target you want GHCi to be set-up for, effectively addressing the issue you're describing.

PS: Here's the relevant cabal ticket for cabal repl: haskell/cabal#375

@qrilka
Copy link
Author

qrilka commented Jul 12, 2013

It looks iteresting.
So am I right that cabal repl should be the way to go and haskell-mode should not parse cabal files and so this ticket could be dismissed?

@hvr
Copy link
Member

hvr commented Jul 12, 2013

On 2013-07-12 at 09:56:35 +0200, Kirill Zaborsky wrote:

So am I right that cabal repl should be the way to go and
haskell-mode should not parse cabal files and so this ticket could be
dismissed?

basically, yes

either via the future cabal repl command, or alternatively by a
cabal-repl package providing an emulated/backported cabal repl interface for
older cabals

in both cases, it'd be an external tool taking care of interpreting the
.cabal file and more importantly, the current state resulting from a
cabal configure (which is why you'd never be able to do this properly
in pure Elisp w/o reimplementing a significant portion of the Cabal
library)

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

2 participants