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

haskell-process-load-file: cabal test-suite wants to inject deps into library #979

Closed
fosskers opened this issue Nov 4, 2015 · 2 comments

Comments

@fosskers
Copy link

fosskers commented Nov 4, 2015

Hi, I have these two sections in my .cabal:

library
  exposed-modules:     Data.Versions   
  other-extensions:    OverloadedStrings
  build-depends:       base >=4.8 && <4.9
                     , parsec >=3.1 && <3.2
                     , semigroups >= 0.16.2.2
                     , text >=1.2 && <1.3
                     , text-show >= 2 
  default-language:    Haskell2010

test-suite versions-test
  type:                exitcode-stdio-1.0
  other-extensions:    OverloadedStrings

  build-depends:       base >=4.8 && <4.9
                     , either >= 4.4.1
                     , extra >= 1.4.1
                     , semigroups >= 0.16.2.2
                     , tasty >= 0.10.1.2
                     , tasty-hunit >= 0.9.2
                     , text >=1.2 && <1.3
                     , text-show >= 2
                     , versions

  hs-source-dirs:      test
  main-is:             Test.hs
  default-language:    Haskell2010

And I have C-c C-l bound to haskell-process-load-or-reload.

When I use C-c C-l on my library source code, it compiles fine. However, when I attempt the same in my test-suite code (which has different deps than the library. tasty for instance), haskell-mode wants to inject tasty etc into the deps of the library section. If I don't, the test suite won't compile, and I can't run my tests in the haskell-mode REPL.

Am I doing something wrong?

@ivan-m
Copy link
Contributor

ivan-m commented Nov 5, 2015

Use haskell-session-change-target. This is because cabal repl loads up a specific target in the .cabal file.

@fosskers
Copy link
Author

fosskers commented Nov 5, 2015

That did it, thanks.

@fosskers fosskers closed this as completed Nov 5, 2015
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