From c3c62c4d453a66eb5ab133c93cef969e5a63be18 Mon Sep 17 00:00:00 2001 From: Dan Doel Date: Tue, 6 Feb 2024 16:28:24 -0500 Subject: [PATCH] Give a nicer looking error for ucr/raco problems --- parser-typechecker/src/Unison/Runtime/Interface.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/parser-typechecker/src/Unison/Runtime/Interface.hs b/parser-typechecker/src/Unison/Runtime/Interface.hs index 97c6e967a0..584bbff3e4 100644 --- a/parser-typechecker/src/Unison/Runtime/Interface.hs +++ b/parser-typechecker/src/Unison/Runtime/Interface.hs @@ -723,8 +723,19 @@ nativeCompileCodes codes base path = do waitForProcess ph pure () callout _ _ _ _ = fail "withCreateProcess didn't provide handles" + ucrError (_ :: IOException) = + die + "I had trouble calling the unison runtime exectuable.\n\n\ + \Please check that the `ucr` executable is properly\ + \ installed." + racoError (_ :: IOException) = + die + "I had trouble calling the `raco` executable.\n\n\ + \Please verify that you have racket installed." withCreateProcess (ucrProc ["-G", srcPath]) callout + `UnliftIO.catch` ucrError callProcess "raco" ["exe", "-o", path, srcPath] + `UnliftIO.catch` racoError evalInContext :: PrettyPrintEnv ->