Admin/mira.py
changeset 50594 3f794789df0e
parent 50593 8372c8b59cea
child 50595 8bf60e7a6b6c
equal deleted inserted replaced
50593:8372c8b59cea 50594:3f794789df0e
    15 from mira.environment import scheduler
    15 from mira.environment import scheduler
    16 from mira import repositories
    16 from mira import repositories
    17 
    17 
    18 # build and evaluation tools
    18 # build and evaluation tools
    19 
    19 
    20 def prepare_isabelle_repository(loc_isabelle, loc_contrib, loc_dependency_heaps,
    20 def prepare_isabelle_repository(loc_isabelle, loc_dependency_heaps,
    21   usedir_options='', more_settings=''):
    21   usedir_options='', more_settings=''):
    22 
    22 
    23     # prepare components
    23     # prepare components
    24     loc_contrib = path.expanduser(loc_contrib)
    24     loc_contrib = "/home/isabelle/contrib"
    25     if not path.exists(loc_contrib):
    25     if not path.exists(loc_contrib):
    26         raise IOError('Bad file: %s' % loc_contrib)
    26         raise IOError('Bad file: %s' % loc_contrib)
    27     subprocess.check_call(['ln', '-s', loc_contrib, '%s/contrib' % loc_isabelle])
    27     subprocess.check_call(['ln', '-s', loc_contrib, '%s/contrib' % loc_isabelle])
    28 
    28 
    29     # patch settings
    29     # patch settings
   120     if 'lxbroy10' in misc.hostnames():  # special settings for lxbroy10
   120     if 'lxbroy10' in misc.hostnames():  # special settings for lxbroy10
   121         more_settings += '''
   121         more_settings += '''
   122 ISABELLE_GHC="/usr/bin/ghc"
   122 ISABELLE_GHC="/usr/bin/ghc"
   123 '''
   123 '''
   124 
   124 
   125     prepare_isabelle_repository(isabelle_home, env.settings.contrib, None,
   125     prepare_isabelle_repository(isabelle_home, None,
   126       usedir_options="", more_settings=more_settings)
   126       usedir_options="", more_settings=more_settings)
   127     os.chdir(isabelle_home)
   127     os.chdir(isabelle_home)
   128 
   128 
   129     # invoke build tool
   129     # invoke build tool
   130     (return_code, log) = env.run_process('%s/bin/isabelle' % isabelle_home, 'build', '-s', '-v', *cmdargs)
   130     (return_code, log) = env.run_process('%s/bin/isabelle' % isabelle_home, 'build', '-s', '-v', *cmdargs)
   184     (loc_isabelle,) = paths
   184     (loc_isabelle,) = paths
   185     (dep_isabelle,) = dep_paths
   185     (dep_isabelle,) = dep_paths
   186     more_settings = '''
   186     more_settings = '''
   187 ISABELLE_GHC="/usr/bin/ghc"
   187 ISABELLE_GHC="/usr/bin/ghc"
   188 '''
   188 '''
   189     prepare_isabelle_repository(loc_isabelle, env.settings.contrib, dep_isabelle,
   189     prepare_isabelle_repository(loc_isabelle, dep_isabelle,
   190       more_settings = more_settings)
   190       more_settings = more_settings)
   191     os.chdir(loc_isabelle)
   191     os.chdir(loc_isabelle)
   192     
   192     
   193     (return_code, log) = env.run_process('bin/isabelle',
   193     (return_code, log) = env.run_process('bin/isabelle',
   194       'mutabelle', '-O', playground, theory)
   194       'mutabelle', '-O', playground, theory)
   258 
   258 
   259     isa = paths[0]
   259     isa = paths[0]
   260     dep_path = dep_paths[0]
   260     dep_path = dep_paths[0]
   261 
   261 
   262     os.chdir(path.join(playground, '..', base_path)) # Mirabelle requires specific cwd
   262     os.chdir(path.join(playground, '..', base_path)) # Mirabelle requires specific cwd
   263     prepare_isabelle_repository(isa, env.settings.contrib, dep_path)
   263     prepare_isabelle_repository(isa, dep_path)
   264 
   264 
   265     output = {}
   265     output = {}
   266     success_rates = {}
   266     success_rates = {}
   267     some_success = False
   267     some_success = False
   268 
   268