Improve error in compileGHC

This commit is contained in:
Julian Ospald 2020-04-10 22:44:43 +02:00
parent e7cd952970
commit b5648bdd6b
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
3 changed files with 9 additions and 3 deletions

View File

@ -594,6 +594,7 @@ main = do
, NoCompatibleArch
, NoCompatiblePlatform
, NoDownload
, NotFoundInPATH
, PatchFailed
, UnknownArchive
]

View File

@ -454,6 +454,7 @@ compileGHC :: ( MonadMask m
, NoCompatibleArch
, NoCompatiblePlatform
, NoDownload
, NotFoundInPATH
, PatchFailed
, UnknownArchive
]
@ -512,10 +513,10 @@ GhcWithLlvmCodeGen = YES|]
-> Path Abs
-> Path Abs
-> Excepts
'[ NoDownload
, FileDoesNotExistError
'[ FileDoesNotExistError
, PatchFailed
, ProcessError
, NotFoundInPATH
]
m
()
@ -533,7 +534,7 @@ GhcWithLlvmCodeGen = YES|]
Right ghc' -> pure ghc'
Left bver -> do
spaths <- catMaybes . fmap parseAbs <$> liftIO getSearchPath
(liftIO $ searchPath spaths bver) !? NoDownload
(liftIO $ searchPath spaths bver) !? NotFoundInPATH bver
lEM $ liftIO $ execLogged
"./configure"
False

View File

@ -63,6 +63,10 @@ data AlreadyInstalled = AlreadyInstalled Tool Version
data NotInstalled = NotInstalled Tool Version
deriving Show
-- | An executable was expected to be in PATH, but was not found.
data NotFoundInPATH = NotFoundInPATH (Path Rel)
deriving Show
-- | JSON decoding failed.
data JSONError = JSONDecodeError String
deriving Show