Skip to content

"mafia ghci" doesn't understand flags in cabal file #172

Description

@erikd-ambiata

Messing with the tls package using mafia ghci Network/TLS/Backend.hs I get:

> mafia ghci Network/TLS/Backend.hs 
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/erikd/.ghci
[1 of 1] Compiling Network.TLS.Backend ( Network/TLS/Backend.hs, interpreted )

Network/TLS/Backend.hs:62:13: error:
    Not in scope: type constructor or class ‘Network.Socket’
    No module named ‘Network’ is imported.

Network/TLS/Backend.hs:64:12: error:
    Not in scope: ‘Network.recv’
    No module named ‘Network’ is imported.
Failed, modules loaded: none.

Problem is that the include of Network.Socket is guarded:

#ifdef INCLUDE_NETWORK
import Control.Monad
import qualified Network.Socket as Network (Socket, close)
import qualified Network.Socket.ByteString as Network
#endif

with a flag set in the cabal file:

Flag network
  Description:       Use the base network library
  Default:           True

Mafia can build this just fine, but its a pity I can't just load it into GHCi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions