[commit: ghc] wip/nfs-locking: Report an error if an executable is not found, unify paths. (05e7242)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:18:50 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/05e7242655e0b8d5657c487e2ed2f392dd520429/ghc
>---------------------------------------------------------------
commit 05e7242655e0b8d5657c487e2ed2f392dd520429
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Wed Feb 10 11:27:03 2016 +0000
Report an error if an executable is not found, unify paths.
>---------------------------------------------------------------
05e7242655e0b8d5657c487e2ed2f392dd520429
src/Oracles/LookupInPath.hs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Oracles/LookupInPath.hs b/src/Oracles/LookupInPath.hs
index 6bf2bba..2f6e713 100644
--- a/src/Oracles/LookupInPath.hs
+++ b/src/Oracles/LookupInPath.hs
@@ -18,8 +18,10 @@ lookupInPathOracle :: Rules ()
lookupInPathOracle = do
answer <- newCache $ \query -> do
maybePath <- liftIO $ findExecutable query
- let path = fromMaybe query maybePath
- putOracle $ "Lookup executable '" ++ query ++ "': " ++ path
+ path <- case maybePath of
+ Just value -> return $ unifyPath value
+ Nothing -> putError $ "Cannot find executable '" ++ query ++ "'."
+ putOracle $ "Executable found: " ++ query ++ " => " ++ path
return path
_ <- addOracle $ \(LookupInPath query) -> answer query
return ()
More information about the ghc-commits
mailing list