actually fail on prolog errors -- such as swipl startup failure due to missing shared libraries -- assuming it normally produces clean return code 0;
authorwenzelm
Fri, 12 Apr 2013 17:56:51 +0200
changeset 51704 0b0fc7dc4ce4
parent 51703 f2e92fc0c8aa
child 51705 3d213f39d83c
actually fail on prolog errors -- such as swipl startup failure due to missing shared libraries -- assuming it normally produces clean return code 0;
src/HOL/Tools/Predicate_Compile/code_prolog.ML
--- a/src/HOL/Tools/Predicate_Compile/code_prolog.ML	Fri Apr 12 17:21:51 2013 +0200
+++ b/src/HOL/Tools/Predicate_Compile/code_prolog.ML	Fri Apr 12 17:56:51 2013 +0200
@@ -791,7 +791,12 @@
   in
     if getenv env_var = "" then
       (warning (env_var ^ " not set; could not execute code for " ^ string_of_system system); "")
-    else fst (Isabelle_System.bash_output (cmd ^ File.shell_path file))
+    else
+      (case Isabelle_System.bash_output (cmd ^ File.shell_path file) of
+        (out, 0) => out
+      | (_, rc) =>
+          error ("Error caused by prolog system " ^ env_var ^
+            ": return code " ^ string_of_int rc))
   end