256 Isabelle_System.settings() + |
256 Isabelle_System.settings() + |
257 ("ISABELLE_ML_DEBUGGER" -> info.options.bool("ML_debugger").toString) |
257 ("ISABELLE_ML_DEBUGGER" -> info.options.bool("ML_debugger").toString) |
258 |
258 |
259 private val future_result: Future[Process_Result] = |
259 private val future_result: Future[Process_Result] = |
260 Future.thread("build") { |
260 Future.thread("build") { |
|
261 val args_file = Isabelle_System.tmp_file("build") |
|
262 File.write(args_file, YXML.string_of_body( |
|
263 { |
|
264 val theories = info.theories.map(x => (x._2, x._3)) |
|
265 import XML.Encode._ |
|
266 pair(list(pair(string, int)), pair(list(properties), pair(bool, pair(bool, |
|
267 pair(Path.encode, pair(list(pair(Path.encode, Path.encode)), pair(string, |
|
268 pair(string, pair(string, pair(string, |
|
269 list(pair(Options.encode, list(Path.encode)))))))))))))( |
|
270 (Symbol.codes, (command_timings, (do_output, (verbose, |
|
271 (store.browser_info, (info.document_files, (File.standard_path(graph_file), |
|
272 (parent, (info.chapter, (name, |
|
273 theories))))))))))) |
|
274 })) |
|
275 |
|
276 val eval = |
|
277 "Command_Line.tool0 (fn () => (" + |
|
278 "Build.build " + ML_Syntax.print_string0(File.standard_path(args_file)) + |
|
279 (if (do_output) "; ML_Heap.share_common_data (); " + output_save_state |
|
280 else "") + "));" |
261 val process = |
281 val process = |
262 if (Sessions.pure_name(name)) { |
282 if (Sessions.pure_name(name)) { |
263 val roots = Sessions.pure_roots.flatMap(root => List("--use", root)) |
283 ML_Process(info.options, raw_ml_system = true, cwd = info.dir.file, |
264 val eval = |
284 args = List("--use", "ROOT0.ML", "--use", "ROOT.ML", "--eval", eval), |
265 "Command_Line.tool0 (fn () => (Session.finish (); Options.reset_default ();" + |
285 env = env, tree = Some(tree), store = store, cleanup = () => args_file.delete) |
266 " Session.shutdown (); ML_Heap.share_common_data (); " + output_save_state + "));" |
|
267 ML_Process(info.options, |
|
268 raw_ml_system = true, args = roots ::: List("--eval", eval), |
|
269 cwd = info.dir.file, env = env, tree = Some(tree), store = store) |
|
270 } |
286 } |
271 else { |
287 else { |
272 val args_file = Isabelle_System.tmp_file("build") |
|
273 File.write(args_file, YXML.string_of_body( |
|
274 { |
|
275 val theories = info.theories.map(x => (x._2, x._3)) |
|
276 import XML.Encode._ |
|
277 pair(list(pair(string, int)), pair(list(properties), pair(bool, pair(bool, |
|
278 pair(Path.encode, pair(list(pair(Path.encode, Path.encode)), pair(string, |
|
279 pair(string, pair(string, pair(string, |
|
280 list(pair(Options.encode, list(Path.encode)))))))))))))( |
|
281 (Symbol.codes, (command_timings, (do_output, (verbose, |
|
282 (store.browser_info, (info.document_files, (File.standard_path(graph_file), |
|
283 (parent, (info.chapter, (name, |
|
284 theories))))))))))) |
|
285 })) |
|
286 val eval = |
|
287 "Command_Line.tool0 (fn () => (" + |
|
288 "Build.build " + ML_Syntax.print_string0(File.standard_path(args_file)) + |
|
289 (if (do_output) "; ML_Heap.share_common_data (); " + output_save_state |
|
290 else "") + "));" |
|
291 ML_Process(info.options, parent, List("--eval", eval), cwd = info.dir.file, |
288 ML_Process(info.options, parent, List("--eval", eval), cwd = info.dir.file, |
292 env = env, tree = Some(tree), store = store, cleanup = () => args_file.delete) |
289 env = env, tree = Some(tree), store = store, cleanup = () => args_file.delete) |
293 } |
290 } |
294 process.result( |
291 process.result( |
295 progress_stdout = (line: String) => |
292 progress_stdout = (line: String) => |