Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't fail if xxx_hsc_make.c is gone

The non-GHC hsc2hs deletes it even if the compilation fails.
  • Loading branch information...
commit 50e8ff95fb7c0b375959b4236267e981666930a5 1 parent 53e5638
@RossPaterson RossPaterson authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  Distribution/Simple/Program.hs
View
3  Distribution/Simple/Program.hs
@@ -93,6 +93,7 @@ import Distribution.Version (Version(..), readVersion, showVersion,
import Distribution.Verbosity
import System.Directory (doesFileExist, removeFile)
import System.FilePath (dropExtension)
+import System.IO.Error (try)
import Control.Monad (join, foldM)
import Control.Exception as Exception (catch)
@@ -564,7 +565,7 @@ hsc2hsProgram = (simpleProgram "hsc2hs") {
withTempFile "." "hsc" $ \hsc -> do
writeFile hsc ""
(str, _) <- rawSystemStdout' verbosity path [hsc, "--cflag=--version"]
- removeFile (dropExtension hsc ++ "_hsc_make.c")
+ try $ removeFile (dropExtension hsc ++ "_hsc_make.c")
case words str of
(_:"Glorious":"Glasgow":"Haskell":_)
-> return $ Just version { versionTags = ["ghc"] }
Please sign in to comment.
Something went wrong with that request. Please try again.