aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CabalHelper/GuessGhc.hs11
-rw-r--r--Distribution/Helper.hs5
2 files changed, 11 insertions, 5 deletions
diff --git a/CabalHelper/GuessGhc.hs b/CabalHelper/GuessGhc.hs
index 0827456..8b0ebce 100644
--- a/CabalHelper/GuessGhc.hs
+++ b/CabalHelper/GuessGhc.hs
@@ -49,11 +49,11 @@ guessToolFromGhcPath toolname ghcPath
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 @@ guessToolFromGhcPath toolname ghcPath
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 @@ takeWhileEndLE p = fst . foldr go ([], False)
go x (rest, done)
| not done && p x = (x:rest, False)
| otherwise = (rest, True)
+
+exeExtension' :: FilePath
+exeExtension' = Distribution.Simple.BuildPaths.exeExtension
diff --git a/Distribution/Helper.hs b/Distribution/Helper.hs
index 729586b..a847567 100644
--- a/Distribution/Helper.hs
+++ b/Distribution/Helper.hs
@@ -416,7 +416,7 @@ findLibexecExe :: String -> IO FilePath
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 @@ getExecutablePath' =
lookupEnv' :: String -> IO (Maybe String)
lookupEnv' k = lookup k <$> getEnvironment
+
+exeExtension' :: FilePath
+exeExtension' = Distribution.Simple.BuildPaths.exeExtension