src/Pure/Admin/build_history.scala
changeset 65889 29c9e3742069
parent 65881 b3d6fb291f58
child 65909 4940682a2e1a
equal deleted inserted replaced
65888:29a31cf0b4bc 65889:29c9e3742069
   167         augment_settings(other_isabelle, threads, arch_64, heap, max_heap, more_settings)
   167         augment_settings(other_isabelle, threads, arch_64, heap, max_heap, more_settings)
   168 
   168 
   169       val isabelle_output = Path.explode(other_isabelle("getenv -b ISABELLE_OUTPUT").check.out)
   169       val isabelle_output = Path.explode(other_isabelle("getenv -b ISABELLE_OUTPUT").check.out)
   170       val isabelle_output_log = isabelle_output + Path.explode("log")
   170       val isabelle_output_log = isabelle_output + Path.explode("log")
   171       val isabelle_base_log = isabelle_output + Path.explode("../base_log")
   171       val isabelle_base_log = isabelle_output + Path.explode("../base_log")
       
   172       val build_out = isabelle_output_log + Path.explode("build.out")
   172 
   173 
   173       if (first_build) {
   174       if (first_build) {
   174         other_isabelle.resolve_components(verbose)
   175         other_isabelle.resolve_components(verbose)
   175 
   176 
   176         if (fresh)
   177         if (fresh)
   192         Isabelle_System.copy_dir(isabelle_base_log, isabelle_output_log)
   193         Isabelle_System.copy_dir(isabelle_base_log, isabelle_output_log)
   193 
   194 
   194       val build_start = Date.now()
   195       val build_start = Date.now()
   195       val build_args1 = List("-v", "-j" + processes) ::: build_args
   196       val build_args1 = List("-v", "-j" + processes) ::: build_args
   196       val build_result =
   197       val build_result =
   197         other_isabelle("build " + Bash.strings(build_args1), redirect = true, echo = verbose)
   198       {
       
   199         val progress1 = new Seq_Progress(progress, new File_Progress(build_out))
       
   200         val other_isabelle1 = new Other_Isabelle(progress1, hg.root, isabelle_identifier)
       
   201         other_isabelle1("build " + Bash.strings(build_args1), redirect = true, echo = verbose)
       
   202       }
   198       val build_end = Date.now()
   203       val build_end = Date.now()
   199 
   204 
   200       val log_path =
   205       val log_path =
   201         other_isabelle.isabelle_home_user +
   206         other_isabelle.isabelle_home_user +
   202           Build_Log.log_subdir(build_history_date) +
   207           Build_Log.log_subdir(build_history_date) +
   203           Build_Log.log_filename(Build_History.engine, build_history_date,
   208           Build_Log.log_filename(Build_History.engine, build_history_date,
   204             List(build_host, ml_platform, "M" + threads) ::: build_tags)
   209             List(build_host, ml_platform, "M" + threads) ::: build_tags)
   205 
       
   206       Isabelle_System.mkdirs(isabelle_output_log)
       
   207       File.write(isabelle_output_log + Path.explode("build.log"), build_result.out)
       
   208 
   210 
   209       val build_info: Build_Log.Build_Info =
   211       val build_info: Build_Log.Build_Info =
   210         Build_Log.Log_File(log_path.base.implode, build_result.out_lines).
   212         Build_Log.Log_File(log_path.base.implode, build_result.out_lines).
   211           parse_build_info(ml_statistics = true)
   213           parse_build_info(ml_statistics = true)
   212 
   214 
   261           ml_statistics.map(Build_Log.Log_File.print_props(Build_Log.ML_STATISTICS_MARKER, _)) :::
   263           ml_statistics.map(Build_Log.Log_File.print_props(Build_Log.ML_STATISTICS_MARKER, _)) :::
   262           heap_sizes), XZ.options(6))
   264           heap_sizes), XZ.options(6))
   263 
   265 
   264 
   266 
   265       /* next build */
   267       /* next build */
       
   268 
       
   269       build_out.file.delete
   266 
   270 
   267       if (multicore_base && first_build && isabelle_output_log.is_dir)
   271       if (multicore_base && first_build && isabelle_output_log.is_dir)
   268         Isabelle_System.copy_dir(isabelle_output_log, isabelle_base_log)
   272         Isabelle_System.copy_dir(isabelle_output_log, isabelle_base_log)
   269 
   273 
   270       Isabelle_System.rm_tree(isabelle_output)
   274       Isabelle_System.rm_tree(isabelle_output)