[ fix ] Report chez failures

This commit is contained in:
Steve Dunham 2024-07-31 21:37:10 -07:00 committed by G. Allais
parent b1fff6f919
commit 4d46c18b5f
4 changed files with 9 additions and 2 deletions

View File

@ -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.

View File

@ -0,0 +1,2 @@
main : IO ()
main = putStrLn "Hello"

View File

@ -0,0 +1 @@
Error: INTERNAL ERROR: Chez exited with return code 1

2
tests/chez/chez037/run Normal file
View File

@ -0,0 +1,2 @@
. ../../testutils.sh
CHEZ=false idris2 -c Hello.idr -o hello