cabal-helper 0.6.3.0 → 0.6.3.1
raw patch · 7 files changed
+37/−8 lines, 7 filessetup-changedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CabalHelper/Compile.hs +2/−1
- CabalHelper/GuessGhc.hs +7/−4
- CabalHelper/Log.hs +7/−0
- Distribution/Helper.hs +4/−1
- Setup.hs +3/−1
- cabal-helper.cabal +10/−1
- tests/Spec.hs +4/−0
CabalHelper/Compile.hs view
@@ -97,7 +97,8 @@ compileSandbox :: FilePath -> MaybeT IO (Either ExitCode FilePath) compileSandbox chdir = do sandbox <- MaybeT $ getSandboxPkgDb projdir (display buildPlatform) =<< ghcVersion opts- ver <- MaybeT $ find (== cabalVer) <$> listCabalVersions' opts (Just sandbox)+ ver <- MaybeT $ logSomeError opts "compileSandbox" $+ find (== cabalVer) <$> listCabalVersions' opts (Just sandbox) vLog opts $ logMsg ++ "sandbox package-db" liftIO $ compileWithPkg chdir (Just sandbox) ver
CabalHelper/GuessGhc.hs view
@@ -49,11 +49,11 @@ path = ghcPath dir = takeDirectory path versionSuffix = takeVersionSuffix (dropExeExtension path)- guessNormal = dir </> toolname <.> exeExtension+ guessNormal = dir </> toolname <.> exeExtension' guessGhcVersioned = dir </> (toolname ++ "-ghc" ++ versionSuffix)- <.> exeExtension+ <.> exeExtension' guessVersioned = dir </> (toolname ++ versionSuffix)- <.> exeExtension+ <.> exeExtension' guesses | null versionSuffix = [guessNormal] | otherwise = [guessGhcVersioned, guessVersioned,@@ -70,7 +70,7 @@ dropExeExtension :: FilePath -> FilePath dropExeExtension filepath = case splitExtension filepath of- (filepath', extension) | extension == exeExtension -> filepath'+ (filepath', extension) | extension == exeExtension' -> filepath' | otherwise -> filepath -- | @takeWhileEndLE p@ is equivalent to @reverse . takeWhile p . reverse@, but@@ -81,3 +81,6 @@ go x (rest, done) | not done && p x = (x:rest, False) | otherwise = (rest, True)++exeExtension' :: FilePath+exeExtension' = Distribution.Simple.BuildPaths.exeExtension
CabalHelper/Log.hs view
@@ -2,6 +2,7 @@ import Control.Monad import Control.Monad.IO.Class+import Control.Exception as E import Data.String import System.IO import Prelude@@ -12,3 +13,9 @@ vLog Options { verbose = True } msg = liftIO $ hPutStrLn stderr msg vLog _ _ = return ()++logSomeError :: Options -> String -> IO (Maybe a) -> IO (Maybe a)+logSomeError opts label a = do+ a `E.catch` \se@(SomeException _) -> do+ vLog opts $ label ++ ": " ++ show se+ return Nothing
Distribution/Helper.hs view
@@ -416,7 +416,7 @@ findLibexecExe "cabal-helper-wrapper" = do libexecdir <- getLibexecDir let exeName = "cabal-helper-wrapper"- exe = libexecdir </> exeName <.> exeExtension+ exe = libexecdir </> exeName <.> exeExtension' exists <- doesFileExist exe @@ -476,3 +476,6 @@ lookupEnv' :: String -> IO (Maybe String) lookupEnv' k = lookup k <$> getEnvironment++exeExtension' :: FilePath+exeExtension' = Distribution.Simple.BuildPaths.exeExtension
Setup.hs view
@@ -6,6 +6,7 @@ import Distribution.Simple.Register import Distribution.Simple.InstallDirs as ID import Distribution.Simple.LocalBuildInfo+import Distribution.Simple.Program import Distribution.PackageDescription import Control.Applicative@@ -17,7 +18,8 @@ main :: IO () main = defaultMainWithHooks $ simpleUserHooks { instHook = inst,- copyHook = copy+ copyHook = copy,+ hookedPrograms = [ simpleProgram "cabal" ] } -- mostly copypasta from 'defaultInstallHook'
cabal-helper.cabal view
@@ -1,5 +1,5 @@ name: cabal-helper-version: 0.6.3.0+version: 0.6.3.1 synopsis: Simple interface to some of Cabal's configuration state used by ghc-mod description: @cabal-helper@ provides a library which wraps the internal use of@@ -87,8 +87,17 @@ Default-Language: Haskell2010 Type: exitcode-stdio-1.0 Main-Is: Spec.hs+ Other-Modules: CabalHelper.Common+ CabalHelper.Compile+ CabalHelper.Data+ CabalHelper.Log+ CabalHelper.Sandbox+ CabalHelper.Types+ Distribution.Helper+ Paths_cabal_helper Hs-Source-Dirs: tests, . GHC-Options: -Wall+ Build-Tools: cabal Build-Depends: base >= 4.5 && < 5 , cabal-helper , extra
tests/Spec.hs view
@@ -55,6 +55,10 @@ "1.22.2.0" , "1.22.3.0" , "1.22.4.0"+ , "1.22.5.0"+ , "1.22.6.0"+ ]),+ ("8.0", [ ]) ]