Open jaccokrijnen opened 9 years ago
Run stack test
first, that'll install tasty.
Thanks, ghci starts but it seems that my ghc is not supported? (the changelog mentions support for 7.10)
jacco@tm-86:~/projects/ide-backend$ stack ghci
Configuring GHCi with the following packages: ide-backend-common, ide-backend-server, ide-backend
on the commandline: Warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Warning: ignoring unrecognised input `/home/jacco/projects/ide-backend/ide-backend-server/Posix.hsc'
In file included from <command-line>:10:0:
/home/jacco/projects/ide-backend/ide-backend-server/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h:248:0:
warning: "CURRENT_PACKAGE_KEY" redefined [enabled by default]
#define CURRENT_PACKAGE_KEY "ideba_EjTmSymrltzHlvseI61e07"
^
... many more CURRENT_PACKAGE_KEY warnings ...
/home/jacco/projects/ide-backend/ide-backend-server/GhcShim.hs:53:2:
error: #error "Unsupported GHC version"
#error "Unsupported GHC version"
^
phase `C pre-processor' failed (exitcode = 1)
> import IdeSession
<interactive>:1:1:
attempting to use module ‘IdeSession’ (/home/jacco/projects/ide-backend/ide-backend/IdeSession.hs) which is not loaded
It's not that your GHC is unsupported, this is a confusing error message. I've changed it to #error "No GHC_* CPP flag specified, possibly using an unsupported GHC version"
, particularly since this isn't the first time I've seen this error cause confusion. https://github.com/fpco/ide-backend/commit/9da1fb05368a9b3d153c51c72d07f1967c3ad601
I'm thinking the issue is that stack ghci
is not passing the CPP flags to GHCI. Here's where those CPP flags are defined: https://github.com/fpco/ide-backend/blob/master/ide-backend-server/ide-backend-server.cabal#L70
Is there a way to manually pass them (using ghc-options perhaps)?
Good point! I've made a couple of changes to ide-backend-server, and now this works for me:
(running from within the ide-backend-server
directory)
stack build # necessary to generate `ide-backend-server/embedded-rts.tgz`
stack ghci --ghc-options "-DGHC_710 -DGHC_AFTER_710_1" ide-backend-server
Unfortunately, stack ghci ide-backend
doesn't yet work, because stack ghci
combines the dependencies and flags from both the library and test-suite. This causes a module ambiguity between mtl and monads-tf. Why is monads-tf
in the list? It's not a real dependency of the test-suite, it just expects it at runtime. Probably the test-suite should be modified to install these extra packages when they're missing.
I hoped to play around a bit in ghci, but
stack ghci
gives me the following:using
-v
gives