src/Pure/Tools/build_process.scala
changeset 77444 0c704aba71e3
parent 77443 3f13c6d47625
child 77446 1d447e4fc549
equal deleted inserted replaced
77443:3f13c6d47625 77444:0c704aba71e3
    35 
    35 
    36       val sessions =
    36       val sessions =
    37         Map.from(
    37         Map.from(
    38           for (name <- build_graph.keys_iterator)
    38           for (name <- build_graph.keys_iterator)
    39           yield {
    39           yield {
    40             val timeout = sessions_structure(name).timeout
    40             val info = sessions_structure(name)
    41             name -> Build_Job.Session_Context.load(name, timeout, store, progress = progress)
    41             val ancestors =
       
    42               sessions_structure.build_requirements(List(name)).filterNot(_ == name)
       
    43             val session_context =
       
    44               Build_Job.Session_Context.load(
       
    45                 name, info.deps, ancestors, info.timeout, store, progress = progress)
       
    46             name -> session_context
    42           })
    47           })
    43 
    48 
    44       val sessions_time = {
    49       val sessions_time = {
    45         val maximals = build_graph.maximals.toSet
    50         val maximals = build_graph.maximals.toSet
    46         def descendants_time(name: String): Double = {
    51         def descendants_time(name: String): Double = {
    96     val verbose: Boolean,
   101     val verbose: Boolean,
    97     val session_setup: (String, Session) => Unit,
   102     val session_setup: (String, Session) => Unit,
    98   ) {
   103   ) {
    99     def sessions_structure: Sessions.Structure = deps.sessions_structure
   104     def sessions_structure: Sessions.Structure = deps.sessions_structure
   100 
   105 
   101     def session_context(session: String): Build_Job.Session_Context =
       
   102       sessions.getOrElse(session, Build_Job.Session_Context.init(session))
       
   103 
       
   104     def old_command_timings(session: String): List[Properties.T] =
   106     def old_command_timings(session: String): List[Properties.T] =
   105       Properties.uncompress(session_context(session).old_command_timings_blob, cache = store.cache)
   107       sessions.get(session) match {
       
   108         case Some(session_context) =>
       
   109           Properties.uncompress(session_context.old_command_timings_blob, cache = store.cache)
       
   110         case None => Nil
       
   111       }
   106 
   112 
   107     def do_store(session: String): Boolean =
   113     def do_store(session: String): Boolean =
   108       build_heap || Sessions.is_pure(session) || !sessions_structure.build_graph.is_maximal(session)
   114       build_heap || Sessions.is_pure(session) || !sessions_structure.build_graph.is_maximal(session)
   109   }
   115   }
   110 
   116