aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Shared
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-08-26 19:24:03 +0200
committerDaniel Gröber <dxld@darkboxed.org>2018-08-26 19:24:03 +0200
commitfbdc40affeeb41c3aaf357cceab9829a6c00e36b (patch)
treed4aef97b9397129b7bc29294686e1f62ac3a466f /src/CabalHelper/Shared
parent095b631701a5eb85544b1c720d0b575b4106ef4a (diff)
Remove wrapper, integrate functionality into the library
The use of a wrapper executable to compile the real helper was a design mistake originally intended to isolate the calling application from a dependency on the Cabal library completely. This isolation turned out to be rather tedious and thus was ignored soon, the wrapper remained though. Due to the way cabal-install installs components of a package into seperate install trees when using new-install finding the wrapper exe reliably has become pretty much impossible without huge effort. Hence we remove it and integrate the functionality into the library instead.
Diffstat (limited to 'src/CabalHelper/Shared')
-rw-r--r--src/CabalHelper/Shared/Sandbox.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/CabalHelper/Shared/Sandbox.hs b/src/CabalHelper/Shared/Sandbox.hs
index 2f3774f..f7b7470 100644
--- a/src/CabalHelper/Shared/Sandbox.hs
+++ b/src/CabalHelper/Shared/Sandbox.hs
@@ -34,16 +34,17 @@ import Prelude
import qualified Data.Traversable as T
-- | Get the path to the sandbox package-db in a project
-getSandboxPkgDb :: FilePath
- -- ^ Path to the cabal package root directory (containing the
- -- @cabal.sandbox.config@ file)
- -> String
+getSandboxPkgDb :: String
-- ^ Cabal build platform, i.e. @buildPlatform@
-> Version
-- ^ GHC version (@cProjectVersion@ is your friend)
+ -> FilePath
+ -- ^ Path to the cabal package root directory (containing the
+ -- @cabal.sandbox.config@ file)
-> IO (Maybe FilePath)
-getSandboxPkgDb d platform ghcVer = do
- mConf <- T.traverse readFile =<< mightExist (d </> "cabal.sandbox.config")
+getSandboxPkgDb platform ghcVer projdir = do
+ mConf <-
+ T.traverse readFile =<< mightExist (projdir </> "cabal.sandbox.config")
return $ fixPkgDbVer <$> (extractSandboxDbDir =<< mConf)
where