From 4d46c18b5f6f020127d1d63809b713ba4d44937f Mon Sep 17 00:00:00 2001 From: Steve Dunham Date: Wed, 31 Jul 2024 21:37:10 -0700 Subject: [PATCH] [ fix ] Report chez failures --- src/Compiler/Scheme/Chez.idr | 6 ++++-- tests/chez/chez037/Hello.idr | 2 ++ tests/chez/chez037/expected | 1 + tests/chez/chez037/run | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tests/chez/chez037/Hello.idr create mode 100644 tests/chez/chez037/expected create mode 100644 tests/chez/chez037/run diff --git a/src/Compiler/Scheme/Chez.idr b/src/Compiler/Scheme/Chez.idr index c0ca430995..fafb7ad67d 100644 --- a/src/Compiler/Scheme/Chez.idr +++ b/src/Compiler/Scheme/Chez.idr @@ -535,7 +535,8 @@ compileToSO prof chez appDirRel outSsAbs Right () <- coreLift $ writeFile tmpFileAbs build | Left err => throw (FileErr tmpFileAbs err) coreLift_ $ chmodRaw tmpFileAbs 0o755 - coreLift_ $ system [chez, "--script", tmpFileAbs] + 0 <- coreLift $ system [chez, "--script", tmpFileAbs] + | status => throw (InternalError "Chez exited with return code \{show status}") pure () ||| Compile a TT expression to Chez Scheme using incremental module builds @@ -703,7 +704,8 @@ incCompile c s sourceFile show ssFile ++ "))" Right () <- coreLift $ writeFile tmpFileAbs build | Left err => throw (FileErr tmpFileAbs err) - coreLift_ $ system [chez, "--script", tmpFileAbs] + 0 <- coreLift $ system [chez, "--script", tmpFileAbs] + | status => throw (InternalError "Chez exited with return code \{show status}") pure (Just (soFilename, mapMaybe fst fgndefs)) ||| Codegen wrapper for Chez scheme implementation. diff --git a/tests/chez/chez037/Hello.idr b/tests/chez/chez037/Hello.idr new file mode 100644 index 0000000000..01665a79c4 --- /dev/null +++ b/tests/chez/chez037/Hello.idr @@ -0,0 +1,2 @@ +main : IO () +main = putStrLn "Hello" diff --git a/tests/chez/chez037/expected b/tests/chez/chez037/expected new file mode 100644 index 0000000000..eecae810fc --- /dev/null +++ b/tests/chez/chez037/expected @@ -0,0 +1 @@ +Error: INTERNAL ERROR: Chez exited with return code 1 diff --git a/tests/chez/chez037/run b/tests/chez/chez037/run new file mode 100644 index 0000000000..c335594948 --- /dev/null +++ b/tests/chez/chez037/run @@ -0,0 +1,2 @@ +. ../../testutils.sh +CHEZ=false idris2 -c Hello.idr -o hello