Skip to content
Snippets Groups Projects
Commit 1560a7c1 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Remove a hardcoded "dist"

parent 7768e2cd
No related branches found
No related tags found
No related merge requests found
...@@ -92,7 +92,8 @@ import Distribution.Version ...@@ -92,7 +92,8 @@ import Distribution.Version
import Distribution.Text import Distribution.Text
( simpleParse, display ) ( simpleParse, display )
import Distribution.Verbosity import Distribution.Verbosity
import System.Directory (doesFileExist, removeFile, findExecutable) import System.Directory (doesFileExist, removeFile, findExecutable,
getTemporaryDirectory)
import System.FilePath (dropExtension) import System.FilePath (dropExtension)
import System.IO (hClose) import System.IO (hClose)
import System.IO.Error (try) import System.IO.Error (try)
...@@ -579,8 +580,9 @@ hsc2hsProgram = (simpleProgram "hsc2hs") { ...@@ -579,8 +580,9 @@ hsc2hsProgram = (simpleProgram "hsc2hs") {
-- to see if it was indeed ghc or not. -- to see if it was indeed ghc or not.
case maybeVersion of case maybeVersion of
Nothing -> return Nothing Nothing -> return Nothing
Just version -> Just version -> do
withTempFile "dist" ".hsc" $ \hsc hnd -> do tempDir <- getTemporaryDirectory
withTempFile tempDir ".hsc" $ \hsc hnd -> do
hClose hnd hClose hnd
(str, _) <- rawSystemStdout' verbosity path [hsc, "--cflag=--version"] (str, _) <- rawSystemStdout' verbosity path [hsc, "--cflag=--version"]
try $ removeFile (dropExtension hsc ++ "_hsc_make.c") try $ removeFile (dropExtension hsc ++ "_hsc_make.c")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment