Skip to content

Commit

Permalink
[ fix ] Report chez failures
Browse files Browse the repository at this point in the history
  • Loading branch information
dunhamsteve authored and gallais committed Aug 2, 2024
1 parent b1fff6f commit 4d46c18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Compiler/Scheme/Chez.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions tests/chez/chez037/Hello.idr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main : IO ()
main = putStrLn "Hello"
1 change: 1 addition & 0 deletions tests/chez/chez037/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Error: INTERNAL ERROR: Chez exited with return code 1
2 changes: 2 additions & 0 deletions tests/chez/chez037/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
. ../../testutils.sh
CHEZ=false idris2 -c Hello.idr -o hello

0 comments on commit 4d46c18

Please sign in to comment.