Skip to content

Some Cabal constructs are ignored #82

Description

@drvink

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions