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

Some Cabal constructs are ignored #82

Open
drvink opened this issue Sep 23, 2015 · 0 comments
Open

Some Cabal constructs are ignored #82

drvink opened this issue Sep 23, 2015 · 0 comments
Labels

Comments

@drvink
Copy link

drvink commented Sep 23, 2015

When trying to jump to the location of maBA here, the following error occurs:

[nil] -> {"tag":"RequestGetSourceErrors","contents":[]}
 <- {"tag":"ResponseGetSourceErrors","contents":[{"errorSpan":{"tag":"ProperSpan","contents":{"spanFromLine":42,"spanFilePath":"Data/Text/Lazy/Builder/Int.hs","spanToColumn":3,"spanFromColumn":3,"spanToLine":42}},"errorKind":"KindError","errorMsg":" error: #error \"You need to use either GMP or integer-simple.\"\n # error \"You need to use either GMP or
integer-simple.\"\n   ^"},{"errorSpan":{"tag":"TextSpan","contents":"<from GhcException>"},"errorKind":"KindError","errorMsg":"ide-backend-server: phase `C pre-processor' failed (exitcode = 1)"}]}

The defines that get set in the Cabal file aren't being picked up by stack-ide/ide-backend, it seems. The problem happens even if you explicitly pass them as --ghc-options to stack build and pre-build the package on the command line, because stack-ide/ide-backend apparently insists on unregistering the package before it begins its work:

Set initial command.
Starting: ("stack:text" nil "stack" "ide" "start" "text")
 <- text-1.2.1.3-19da78d3320e4fc2461a3acfd735f379: unregistering (flags changed from ["--ghc-options","-XCPP -DINTEGER_GMP=1 -DHAVE_DEEPSEQ=1"] to [])
 <- {"tag":"ResponseWelcome","contents":[0,1,1]}
 <- {"tag":"ResponseLog","contents":"[Info] Initializing ide-backend session @(ideba_Hr9Nwev8ROnK3IGHXxVXye:IdeSession.Update ./IdeSession/Update.hs:195:3)\n"}

It then tries to invoke a recompile and fails because of the #error directive here.

@chrisdone chrisdone added the bug label Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants