more robust: avoid isabelle_stack invocation in settings script (potentially slow or failing);
authorwenzelm
Mon, 05 Nov 2018 20:53:16 +0100
changeset 69242 c911716d29bb
parent 69241 5426d266dcc5
child 69243 2a17c481d05e
more robust: avoid isabelle_stack invocation in settings script (potentially slow or failing);
lib/Tools/ghc_setup
lib/scripts/getsettings
--- a/lib/Tools/ghc_setup	Mon Nov 05 17:37:55 2018 +0100
+++ b/lib/Tools/ghc_setup	Mon Nov 05 20:53:16 2018 +0100
@@ -4,5 +4,8 @@
 #
 # DESCRIPTION: setup Glasgow Haskell Compiler setup via Stack
 
-isabelle_stack setup --resolver "$ISABELLE_STACK_RESOLVER" "$ISABELLE_GHC_VERSION" &&
-  isabelle_stack ghci --ghci-options --version
+set -e
+
+isabelle_stack setup --resolver "$ISABELLE_STACK_RESOLVER" "$ISABELLE_GHC_VERSION"
+isabelle_stack ghci --ghci-options --version
+echo -n "$(standard_path "$(isabelle_stack path --programs)")" > "$ISABELLE_STACK_ROOT/ISABELLE_GHC_PROGRAMS"
--- a/lib/scripts/getsettings	Mon Nov 05 17:37:55 2018 +0100
+++ b/lib/scripts/getsettings	Mon Nov 05 20:53:16 2018 +0100
@@ -110,8 +110,8 @@
 fi
 
 #enforce ISABELLE_GHC
-if [ -d "$ISABELLE_STACK_ROOT" ]; then
-  if [ -f "$(standard_path "$(isabelle_stack path --programs)")/$ISABELLE_GHC_VERSION/bin/ghc" ]; then
+if [ -d "$ISABELLE_STACK_ROOT" -a -f "$ISABELLE_STACK_ROOT/ISABELLE_GHC_PROGRAMS" ]; then
+  if [ -f "$(cat "$ISABELLE_STACK_ROOT/ISABELLE_GHC_PROGRAMS")/$ISABELLE_GHC_VERSION/bin/ghc" ]; then
     ISABELLE_GHC="$ISABELLE_HOME/lib/Tools/ghc"
   fi
 fi