src/Pure/Tools/build.scala
changeset 71667 4d2de35214c5
parent 71652 721f143a679b
child 71668 25ef5c7287a7
equal deleted inserted replaced
71666:e15ca98ffbfe 71667:4d2de35214c5
   164           for (err <- XML.Decode.list(x => x)(Symbol.decode_yxml(msg.text))) yield
   164           for (err <- XML.Decode.list(x => x)(Symbol.decode_yxml(msg.text))) yield
   165             Pretty.string_of(Protocol_Message.expose_no_reports(err), metric = Symbol.Metric)
   165             Pretty.string_of(Protocol_Message.expose_no_reports(err), metric = Symbol.Metric)
   166         }
   166         }
   167         catch { case ERROR(err) => List(err) }
   167         catch { case ERROR(err) => List(err) }
   168       build_session_errors.fulfill(errors)
   168       build_session_errors.fulfill(errors)
   169       session.send_stop()
       
   170       true
   169       true
   171     }
   170     }
   172 
   171 
   173     private def loading_theory(msg: Prover.Protocol_Output): Boolean =
   172     private def loading_theory(msg: Prover.Protocol_Output): Boolean =
   174       msg.properties match {
   173       msg.properties match {
   295               logic = parent, raw_ml_system = is_pure,
   294               logic = parent, raw_ml_system = is_pure,
   296               use_prelude = use_prelude, eval_main = eval_main,
   295               use_prelude = use_prelude, eval_main = eval_main,
   297               cwd = info.dir.file, env = env).await_startup
   296               cwd = info.dir.file, env = env).await_startup
   298 
   297 
   299           session.protocol_command("build_session", args_yxml)
   298           session.protocol_command("build_session", args_yxml)
   300 
   299           val errors = handler.build_session_errors.join
   301           val process_result = process.join
   300 
       
   301           val process_result = process.await_shutdown
   302           val process_output =
   302           val process_output =
   303             stdout.toString :: messages.toList :::
   303             stdout.toString :: messages.toList :::
   304             command_timings.toList.map(Protocol.Command_Timing_Marker.apply) :::
   304             command_timings.toList.map(Protocol.Command_Timing_Marker.apply) :::
   305             theory_timings.toList.map(Protocol.Theory_Timing_Marker.apply) :::
   305             theory_timings.toList.map(Protocol.Theory_Timing_Marker.apply) :::
   306             runtime_statistics.toList.map(Protocol.ML_Statistics_Marker.apply) :::
   306             runtime_statistics.toList.map(Protocol.ML_Statistics_Marker.apply) :::
   307             task_statistics.toList.map(Protocol.Task_Statistics_Marker.apply)
   307             task_statistics.toList.map(Protocol.Task_Statistics_Marker.apply)
   308 
   308 
   309           val result = process_result.output(process_output)
   309           val result = process_result.output(process_output)
   310           handler.build_session_errors.join match {
   310           if (errors.isEmpty) result
   311             case Nil => result
   311           else {
   312             case errors =>
   312             result.error_rc.output(
   313               result.error_rc.output(
   313               errors.flatMap(s => split_lines(Output.error_message_text(s))) :::
   314                 errors.flatMap(s => split_lines(Output.error_message_text(s))) :::
   314               errors.map(Protocol.Error_Message_Marker.apply))
   315                 errors.map(Protocol.Error_Message_Marker.apply))
       
   316           }
   315           }
   317         }
   316         }
   318         else {
   317         else {
   319           val args_file = Isabelle_System.tmp_file("build")
   318           val args_file = Isabelle_System.tmp_file("build")
   320           File.write(args_file, args_yxml)
   319           File.write(args_file, args_yxml)