diff --git a/core/Language/Haskell/GhcMod/CabalHelper.hs b/core/Language/Haskell/GhcMod/CabalHelper.hs index 1d00a5b9a..cb09569f0 100644 --- a/core/Language/Haskell/GhcMod/CabalHelper.hs +++ b/core/Language/Haskell/GhcMod/CabalHelper.hs @@ -16,15 +16,13 @@ {-# LANGUAGE CPP #-} module Language.Haskell.GhcMod.CabalHelper -#ifndef SPEC ( getComponents , getGhcMergedPkgOptions , getCabalPackageDbStack , prepareCabalHelper , withAutogen - ) -#endif - where + , withCabal + ) where import Control.Applicative import Control.Monad diff --git a/core/Language/Haskell/GhcMod/Cradle.hs b/core/Language/Haskell/GhcMod/Cradle.hs index 87efe81c4..b4e499b9d 100644 --- a/core/Language/Haskell/GhcMod/Cradle.hs +++ b/core/Language/Haskell/GhcMod/Cradle.hs @@ -1,15 +1,14 @@ {-# LANGUAGE CPP #-} module Language.Haskell.GhcMod.Cradle -#ifndef SPEC - ( - findCradle + ( findCradle , findCradle' , findCradleNoLog , findSpecCradle , cleanupCradle - ) -#endif - where + + -- * for @spec@ + , plainCradle + ) where import Language.Haskell.GhcMod.PathsAndFiles import Language.Haskell.GhcMod.Monad.Types diff --git a/src/GHCModWrapper.hs b/src/GHCModWrapper.hs new file mode 100644 index 000000000..d01ff2eb9 --- /dev/null +++ b/src/GHCModWrapper.hs @@ -0,0 +1,30 @@ +-- | Dispatcher program to support co-installation of multiple ghc-mod +-- instances (compiled against different GHC versions) without breaking the +-- commandline API +module Main where + +import System.IO +import System.Exit +import System.Process +import System.FilePath +import System.Environment +import Utils + +import Paths_ghc_mod + +main :: IO () +main = do + args <- getArgs + libexecdir <- getLibexecDir + let installedExe = libexecdir "ghc-mod-real" + mexe <- mightExist installedExe + case mexe of + Nothing -> do + hPutStrLn stderr $ + "ghc-mod: Could not find '"++installedExe++"', check your installation!" + exitWith $ ExitFailure 1 + + Just exe -> do + (_, _, _, h) <- + createProcess $ proc exe args + exitWith =<< waitForProcess h