author | wenzelm |
Sat, 06 Nov 2021 10:11:25 +0100 | |
changeset 74712 | bcca7e3bcd0d |
parent 74685 | 0ab5e35ac964 |
child 74731 | 161e84e6b40a |
permissions | -rw-r--r-- |
72662 | 1 |
/* Title: Pure/Tools/build_job.scala |
2 |
Author: Makarius |
|
3 |
||
4 |
Build job running prover process, with rudimentary PIDE session. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
73897 | 10 |
import java.util.HashMap |
11 |
||
72662 | 12 |
import scala.collection.mutable |
13 |
||
14 |
||
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
15 |
object Build_Job |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
16 |
{ |
72854 | 17 |
/* theory markup/messages from database */ |
18 |
||
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
19 |
def read_theory( |
72857 | 20 |
db_context: Sessions.Database_Context, |
21 |
resources: Resources, |
|
74712 | 22 |
session_hierarchy: List[String], |
72867 | 23 |
theory: String, |
24 |
unicode_symbols: Boolean = false): Option[Command] = |
|
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
25 |
{ |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
26 |
def read(name: String): Export.Entry = |
74712 | 27 |
db_context.get_export(session_hierarchy, theory, name) |
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
28 |
|
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
29 |
def read_xml(name: String): XML.Body = |
73033 | 30 |
YXML.parse_body( |
31 |
Symbol.output(unicode_symbols, UTF8.decode_permissive(read(name).uncompressed)), |
|
32 |
cache = db_context.cache) |
|
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
33 |
|
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
34 |
(read(Export.DOCUMENT_ID).text, split_lines(read(Export.FILES).text)) match { |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
35 |
case (Value.Long(id), thy_file :: blobs_files) => |
72964 | 36 |
val node_name = resources.file_node(Path.explode(thy_file), theory = theory) |
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
37 |
|
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
38 |
val results = |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
39 |
Command.Results.make( |
72871 | 40 |
for (elem @ XML.Elem(Markup(_, Markup.Serial(i)), _) <- read_xml(Export.MESSAGES)) |
41 |
yield i -> elem) |
|
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
42 |
|
72865
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
43 |
val blobs = |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
44 |
blobs_files.map(file => |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
45 |
{ |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
46 |
val path = Path.explode(file) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
47 |
val name = resources.file_node(path) |
72964 | 48 |
val src_path = File.relative_path(node_name.master_dir_path, path).getOrElse(path) |
72865
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
49 |
Command.Blob(name, src_path, None) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
50 |
}) |
72864 | 51 |
val blobs_xml = |
52 |
for (i <- (1 to blobs.length).toList) |
|
72865
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
53 |
yield read_xml(Export.MARKUP + i) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
54 |
|
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
55 |
val blobs_info = |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
56 |
Command.Blobs_Info( |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
57 |
for { (Command.Blob(name, src_path, _), xml) <- blobs zip blobs_xml } |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
58 |
yield { |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
59 |
val text = XML.content(xml) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
60 |
val chunk = Symbol.Text_Chunk(text) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
61 |
val digest = SHA1.digest(Symbol.encode(text)) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
62 |
Exn.Res(Command.Blob(name, src_path, Some((digest, chunk)))) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
63 |
}) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
64 |
|
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
65 |
val thy_xml = read_xml(Export.MARKUP) |
ebf72a3b8daa
clarified file sources: take from build database instead of file-system;
wenzelm
parents:
72864
diff
changeset
|
66 |
val thy_source = XML.content(thy_xml) |
72864 | 67 |
|
68 |
val markups_index = |
|
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
69 |
Command.Markup_Index.markup :: blobs.map(Command.Markup_Index.blob) |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
70 |
val markups = |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
71 |
Command.Markups.make( |
72864 | 72 |
for ((index, xml) <- markups_index.zip(thy_xml :: blobs_xml)) |
73 |
yield index -> Markup_Tree.from_XML(xml)) |
|
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
74 |
|
72853
d0038b553e0e
clarified signature: name according to db model without Sessions.Structure/Deps;
wenzelm
parents:
72849
diff
changeset
|
75 |
val command = |
d0038b553e0e
clarified signature: name according to db model without Sessions.Structure/Deps;
wenzelm
parents:
72849
diff
changeset
|
76 |
Command.unparsed(thy_source, theory = true, id = id, node_name = node_name, |
d0038b553e0e
clarified signature: name according to db model without Sessions.Structure/Deps;
wenzelm
parents:
72849
diff
changeset
|
77 |
blobs_info = blobs_info, results = results, markups = markups) |
d0038b553e0e
clarified signature: name according to db model without Sessions.Structure/Deps;
wenzelm
parents:
72849
diff
changeset
|
78 |
Some(command) |
d0038b553e0e
clarified signature: name according to db model without Sessions.Structure/Deps;
wenzelm
parents:
72849
diff
changeset
|
79 |
case _ => None |
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
80 |
} |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
81 |
} |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
82 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
83 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
84 |
/* print messages */ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
85 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
86 |
def print_log( |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
87 |
options: Options, |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
88 |
session_name: String, |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
89 |
theories: List[String] = Nil, |
72878 | 90 |
verbose: Boolean = false, |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
91 |
progress: Progress = new Progress, |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
92 |
margin: Double = Pretty.default_margin, |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
93 |
breakgain: Double = Pretty.default_breakgain, |
72873 | 94 |
metric: Pretty.Metric = Symbol.Metric, |
73340 | 95 |
unicode_symbols: Boolean = false): Unit = |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
96 |
{ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
97 |
val store = Sessions.store(options) |
72962 | 98 |
val resources = Resources.empty |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
99 |
val session = new Session(options, resources) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
100 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
101 |
using(store.open_database_context())(db_context => |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
102 |
{ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
103 |
val result = |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
104 |
db_context.input_database(session_name)((db, _) => |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
105 |
{ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
106 |
val theories = store.read_theories(db, session_name) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
107 |
val errors = store.read_errors(db, session_name) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
108 |
store.read_build(db, session_name).map(info => (theories, errors, info.return_code)) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
109 |
}) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
110 |
result match { |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
111 |
case None => error("Missing build database for session " + quote(session_name)) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
112 |
case Some((used_theories, errors, rc)) => |
73835 | 113 |
theories.filterNot(used_theories.toSet) match { |
114 |
case Nil => |
|
115 |
case bad => error("Unknown theories " + commas_quote(bad)) |
|
116 |
} |
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
117 |
val print_theories = |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
118 |
if (theories.isEmpty) used_theories else used_theories.filter(theories.toSet) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
119 |
for (thy <- print_theories) { |
72868 | 120 |
val thy_heading = "\nTheory " + quote(thy) + ":" |
74712 | 121 |
read_theory(db_context, resources, List(session_name), thy, |
122 |
unicode_symbols = unicode_symbols) |
|
72867 | 123 |
match { |
72863 | 124 |
case None => progress.echo(thy_heading + " MISSING") |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
125 |
case Some(command) => |
72958 | 126 |
val snapshot = Document.State.init.snippet(command) |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
127 |
val rendering = new Rendering(snapshot, options, session) |
72878 | 128 |
val messages = |
129 |
rendering.text_messages(Text.Range.full) |
|
130 |
.filter(message => verbose || Protocol.is_exported(message.info)) |
|
72863 | 131 |
if (messages.nonEmpty) { |
72875 | 132 |
val line_document = Line.Document(command.source) |
72863 | 133 |
progress.echo(thy_heading) |
72875 | 134 |
for (Text.Info(range, elem) <- messages) { |
135 |
val line = line_document.position(range.start).line1 |
|
136 |
val pos = Position.Line_File(line, command.node_name.node) |
|
72863 | 137 |
progress.echo( |
72875 | 138 |
Protocol.message_text(elem, heading = true, pos = pos, |
139 |
margin = margin, breakgain = breakgain, metric = metric)) |
|
72863 | 140 |
} |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
141 |
} |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
142 |
} |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
143 |
} |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
144 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
145 |
if (errors.nonEmpty) { |
72867 | 146 |
val msg = Symbol.output(unicode_symbols, cat_lines(errors)) |
72868 | 147 |
progress.echo("\nBuild errors:\n" + Output.error_message_text(msg)) |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
148 |
} |
74306 | 149 |
if (rc != Process_Result.RC.ok) { |
150 |
progress.echo("\n" + Process_Result.RC.print_long(rc)) |
|
151 |
} |
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
152 |
} |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
153 |
}) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
154 |
} |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
155 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
156 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
157 |
/* Isabelle tool wrapper */ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
158 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
159 |
val isabelle_tool = Isabelle_Tool("log", "print messages from build database", |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
160 |
Scala_Project.here, args => |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
161 |
{ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
162 |
/* arguments */ |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
163 |
|
72867 | 164 |
var unicode_symbols = false |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
165 |
var theories: List[String] = Nil |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
166 |
var margin = Pretty.default_margin |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
167 |
var options = Options.init() |
72878 | 168 |
var verbose = false |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
169 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
170 |
val getopts = Getopts(""" |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
171 |
Usage: isabelle log [OPTIONS] SESSION |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
172 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
173 |
Options are: |
72876 | 174 |
-T NAME restrict to given theories (multiple options possible) |
72867 | 175 |
-U output Unicode symbols |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
176 |
-m MARGIN margin for pretty printing (default: """ + margin + """) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
177 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
73837
f72335f6a9ed
clarified documentation: tracing messages are not shown here;
wenzelm
parents:
73835
diff
changeset
|
178 |
-v print all messages, including information etc. |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
179 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
180 |
Print messages from the build database of the given session, without any |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
181 |
checks against current sources: results from a failed build can be |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
182 |
printed as well. |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
183 |
""", |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
184 |
"T:" -> (arg => theories = theories ::: List(arg)), |
72867 | 185 |
"U" -> (_ => unicode_symbols = true), |
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
186 |
"m:" -> (arg => margin = Value.Double.parse(arg)), |
72878 | 187 |
"o:" -> (arg => options = options + arg), |
188 |
"v" -> (_ => verbose = true)) |
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
189 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
190 |
val more_args = getopts(args) |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
191 |
val session_name = |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
192 |
more_args match { |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
193 |
case List(session_name) => session_name |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
194 |
case _ => getopts.usage() |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
195 |
} |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
196 |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
197 |
val progress = new Console_Progress() |
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
198 |
|
72878 | 199 |
print_log(options, session_name, theories = theories, verbose = verbose, margin = margin, |
200 |
progress = progress, unicode_symbols = unicode_symbols) |
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72857
diff
changeset
|
201 |
}) |
72848
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
202 |
} |
d5d0e36eda16
read theory with PIDE markup from session database;
wenzelm
parents:
72844
diff
changeset
|
203 |
|
72662 | 204 |
class Build_Job(progress: Progress, |
205 |
session_name: String, |
|
206 |
val info: Sessions.Info, |
|
207 |
deps: Sessions.Deps, |
|
208 |
store: Sessions.Store, |
|
209 |
do_store: Boolean, |
|
73777
52e43a93d51f
clarified system_log: make this work independently of the particular "isabelle build" command-line (e.g. "isabelle mirabelle");
wenzelm
parents:
73774
diff
changeset
|
210 |
log: Logger, |
73805
b73777a0c076
allow build session setup, e.g. for protocol handlers;
wenzelm
parents:
73804
diff
changeset
|
211 |
session_setup: (String, Session) => Unit, |
72662 | 212 |
val numa_node: Option[Int], |
213 |
command_timings0: List[Properties.T]) |
|
214 |
{ |
|
215 |
val options: Options = NUMA.policy_options(info.options, numa_node) |
|
216 |
||
217 |
private val sessions_structure = deps.sessions_structure |
|
218 |
||
219 |
private val future_result: Future[Process_Result] = |
|
220 |
Future.thread("build", uninterruptible = true) { |
|
221 |
val parent = info.parent.getOrElse("") |
|
222 |
val base = deps(parent) |
|
72816
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
223 |
val result_base = deps(session_name) |
72662 | 224 |
|
73897 | 225 |
val env = new HashMap(Isabelle_System.settings()) |
226 |
env.put("ISABELLE_ML_DEBUGGER", options.bool("ML_debugger").toString) |
|
72662 | 227 |
|
228 |
val is_pure = Sessions.is_pure(session_name) |
|
229 |
||
230 |
val use_prelude = if (is_pure) Thy_Header.ml_roots.map(_._1) else Nil |
|
231 |
||
232 |
val eval_store = |
|
233 |
if (do_store) { |
|
234 |
(if (info.theories.nonEmpty) List("ML_Heap.share_common_data ()") else Nil) ::: |
|
235 |
List("ML_Heap.save_child " + |
|
236 |
ML_Syntax.print_string_bytes(File.platform_path(store.output_heap(session_name)))) |
|
237 |
} |
|
238 |
else Nil |
|
239 |
||
73774 | 240 |
val resources = |
241 |
new Resources(sessions_structure, base, log = log, command_timings = command_timings0) |
|
72662 | 242 |
val session = |
243 |
new Session(options, resources) { |
|
73031
f93f0597f4fb
clarified signature: absorb XZ.Cache into XML.Cache;
wenzelm
parents:
72964
diff
changeset
|
244 |
override val cache: XML.Cache = store.cache |
72816
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
245 |
|
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
246 |
override def build_blobs_info(name: Document.Node.Name): Command.Blobs_Info = |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
247 |
{ |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
248 |
result_base.load_commands.get(name.expand) match { |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
249 |
case Some(spans) => |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
250 |
val syntax = result_base.theory_syntax(name) |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
251 |
Command.build_blobs_info(syntax, name, spans) |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
252 |
case None => Command.Blobs_Info.none |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
253 |
} |
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
254 |
} |
72662 | 255 |
} |
256 |
||
257 |
object Build_Session_Errors |
|
258 |
{ |
|
259 |
private val promise: Promise[List[String]] = Future.promise |
|
260 |
||
261 |
def result: Exn.Result[List[String]] = promise.join_result |
|
73367 | 262 |
def cancel(): Unit = promise.cancel() |
73340 | 263 |
def apply(errs: List[String]): Unit = |
72662 | 264 |
{ |
265 |
try { promise.fulfill(errs) } |
|
266 |
catch { case _: IllegalStateException => } |
|
267 |
} |
|
268 |
} |
|
269 |
||
270 |
val export_consumer = |
|
74255 | 271 |
Export.consumer(store.open_database(session_name, output = true), store.cache, |
272 |
progress = progress) |
|
72662 | 273 |
|
274 |
val stdout = new StringBuilder(1000) |
|
275 |
val stderr = new StringBuilder(1000) |
|
276 |
val command_timings = new mutable.ListBuffer[Properties.T] |
|
277 |
val theory_timings = new mutable.ListBuffer[Properties.T] |
|
278 |
val session_timings = new mutable.ListBuffer[Properties.T] |
|
279 |
val runtime_statistics = new mutable.ListBuffer[Properties.T] |
|
280 |
val task_statistics = new mutable.ListBuffer[Properties.T] |
|
281 |
||
282 |
def fun( |
|
283 |
name: String, |
|
284 |
acc: mutable.ListBuffer[Properties.T], |
|
285 |
unapply: Properties.T => Option[Properties.T]): (String, Session.Protocol_Function) = |
|
286 |
{ |
|
287 |
name -> ((msg: Prover.Protocol_Output) => |
|
288 |
unapply(msg.properties) match { |
|
289 |
case Some(props) => acc += props; true |
|
290 |
case _ => false |
|
291 |
}) |
|
292 |
} |
|
293 |
||
294 |
session.init_protocol_handler(new Session.Protocol_Handler |
|
295 |
{ |
|
73367 | 296 |
override def exit(): Unit = Build_Session_Errors.cancel() |
72662 | 297 |
|
298 |
private def build_session_finished(msg: Prover.Protocol_Output): Boolean = |
|
299 |
{ |
|
300 |
val (rc, errors) = |
|
301 |
try { |
|
302 |
val (rc, errs) = |
|
303 |
{ |
|
304 |
import XML.Decode._ |
|
305 |
pair(int, list(x => x))(Symbol.decode_yxml(msg.text)) |
|
306 |
} |
|
307 |
val errors = |
|
308 |
for (err <- errs) yield { |
|
309 |
val prt = Protocol_Message.expose_no_reports(err) |
|
310 |
Pretty.string_of(prt, metric = Symbol.Metric) |
|
311 |
} |
|
312 |
(rc, errors) |
|
313 |
} |
|
74306 | 314 |
catch { case ERROR(err) => (Process_Result.RC.failure, List(err)) } |
72662 | 315 |
|
316 |
session.protocol_command("Prover.stop", rc.toString) |
|
317 |
Build_Session_Errors(errors) |
|
318 |
true |
|
319 |
} |
|
320 |
||
321 |
private def loading_theory(msg: Prover.Protocol_Output): Boolean = |
|
322 |
msg.properties match { |
|
72692
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
72683
diff
changeset
|
323 |
case Markup.Loading_Theory(Markup.Name(name)) => |
72662 | 324 |
progress.theory(Progress.Theory(name, session = session_name)) |
72692
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
72683
diff
changeset
|
325 |
false |
72662 | 326 |
case _ => false |
327 |
} |
|
328 |
||
74685 | 329 |
private def export_(msg: Prover.Protocol_Output): Boolean = |
72662 | 330 |
msg.properties match { |
331 |
case Protocol.Export(args) => |
|
73559 | 332 |
export_consumer(session_name, args, msg.chunk) |
72662 | 333 |
true |
334 |
case _ => false |
|
335 |
} |
|
336 |
||
337 |
override val functions = |
|
338 |
List( |
|
339 |
Markup.Build_Session_Finished.name -> build_session_finished, |
|
340 |
Markup.Loading_Theory.name -> loading_theory, |
|
74685 | 341 |
Markup.EXPORT -> export_, |
72662 | 342 |
fun(Markup.Theory_Timing.name, theory_timings, Markup.Theory_Timing.unapply), |
343 |
fun(Markup.Session_Timing.name, session_timings, Markup.Session_Timing.unapply), |
|
344 |
fun(Markup.Task_Statistics.name, task_statistics, Markup.Task_Statistics.unapply)) |
|
345 |
}) |
|
346 |
||
72711 | 347 |
session.command_timings += Session.Consumer("command_timings") |
348 |
{ |
|
349 |
case Session.Command_Timing(props) => |
|
350 |
for { |
|
351 |
elapsed <- Markup.Elapsed.unapply(props) |
|
352 |
elapsed_time = Time.seconds(elapsed) |
|
353 |
if elapsed_time.is_relevant && elapsed_time >= options.seconds("command_timing_threshold") |
|
354 |
} command_timings += props.filter(Markup.command_timing_property) |
|
355 |
} |
|
356 |
||
72662 | 357 |
session.runtime_statistics += Session.Consumer("ML_statistics") |
358 |
{ |
|
359 |
case Session.Runtime_Statistics(props) => runtime_statistics += props |
|
360 |
} |
|
361 |
||
72721
79f5e843e5ec
clarified signature: prefer high-level Snapshot over low-level Command.State;
wenzelm
parents:
72717
diff
changeset
|
362 |
session.finished_theories += Session.Consumer[Document.Snapshot]("finished_theories") |
72692
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
72683
diff
changeset
|
363 |
{ |
72721
79f5e843e5ec
clarified signature: prefer high-level Snapshot over low-level Command.State;
wenzelm
parents:
72717
diff
changeset
|
364 |
case snapshot => |
74258 | 365 |
if (!progress.stopped) { |
366 |
val rendering = new Rendering(snapshot, options, session) |
|
72730 | 367 |
|
74685 | 368 |
def export_(name: String, xml: XML.Body, compress: Boolean = true): Unit = |
74258 | 369 |
{ |
370 |
if (!progress.stopped) { |
|
371 |
val theory_name = snapshot.node_name.theory |
|
372 |
val args = |
|
373 |
Protocol.Export.Args(theory_name = theory_name, name = name, compress = compress) |
|
374 |
val bytes = Bytes(Symbol.encode(YXML.string_of_body(xml))) |
|
375 |
if (!bytes.is_empty) export_consumer(session_name, args, bytes) |
|
376 |
} |
|
377 |
} |
|
378 |
def export_text(name: String, text: String, compress: Boolean = true): Unit = |
|
74685 | 379 |
export_(name, List(XML.Text(text)), compress = compress) |
72730 | 380 |
|
74258 | 381 |
for (command <- snapshot.snippet_command) { |
382 |
export_text(Export.DOCUMENT_ID, command.id.toString, compress = false) |
|
383 |
} |
|
72844 | 384 |
|
74258 | 385 |
export_text(Export.FILES, |
386 |
cat_lines(snapshot.node_files.map(_.symbolic.node)), compress = false) |
|
72816
ea4f86914cb2
support for PIDE markup for auxiliary files ("blobs");
wenzelm
parents:
72783
diff
changeset
|
387 |
|
74258 | 388 |
for (((_, xml), i) <- snapshot.xml_markup_blobs().zipWithIndex) { |
74685 | 389 |
export_(Export.MARKUP + (i + 1), xml) |
74258 | 390 |
} |
74685 | 391 |
export_(Export.MARKUP, snapshot.xml_markup()) |
392 |
export_(Export.MESSAGES, snapshot.messages.map(_._1)) |
|
74258 | 393 |
|
394 |
val citations = Library.distinct(rendering.citations(Text.Range.full).map(_.info)) |
|
395 |
export_text(Export.DOCUMENT_CITATIONS, cat_lines(citations)) |
|
72817
1c378ab75d48
clarified signature, notably access to blob files;
wenzelm
parents:
72816
diff
changeset
|
396 |
} |
72692
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
72683
diff
changeset
|
397 |
} |
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
72683
diff
changeset
|
398 |
|
72662 | 399 |
session.all_messages += Session.Consumer[Any]("build_session_output") |
400 |
{ |
|
401 |
case msg: Prover.Output => |
|
402 |
val message = msg.message |
|
73777
52e43a93d51f
clarified system_log: make this work independently of the particular "isabelle build" command-line (e.g. "isabelle mirabelle");
wenzelm
parents:
73774
diff
changeset
|
403 |
if (msg.is_system) resources.log(Protocol.message_text(message)) |
73774 | 404 |
|
72662 | 405 |
if (msg.is_stdout) { |
406 |
stdout ++= Symbol.encode(XML.content(message)) |
|
407 |
} |
|
408 |
else if (msg.is_stderr) { |
|
409 |
stderr ++= Symbol.encode(XML.content(message)) |
|
410 |
} |
|
411 |
else if (msg.is_exit) { |
|
412 |
val err = |
|
413 |
"Prover terminated" + |
|
414 |
(msg.properties match { |
|
415 |
case Markup.Process_Result(result) => ": " + result.print_rc |
|
416 |
case _ => "" |
|
417 |
}) |
|
418 |
Build_Session_Errors(List(err)) |
|
419 |
} |
|
420 |
case _ => |
|
421 |
} |
|
422 |
||
73805
b73777a0c076
allow build session setup, e.g. for protocol handlers;
wenzelm
parents:
73804
diff
changeset
|
423 |
session_setup(session_name, session) |
b73777a0c076
allow build session setup, e.g. for protocol handlers;
wenzelm
parents:
73804
diff
changeset
|
424 |
|
72662 | 425 |
val eval_main = Command_Line.ML_tool("Isabelle_Process.init_build ()" :: eval_store) |
426 |
||
427 |
val process = |
|
73802 | 428 |
Isabelle_Process.start(session, options, sessions_structure, store, |
72662 | 429 |
logic = parent, raw_ml_system = is_pure, |
430 |
use_prelude = use_prelude, eval_main = eval_main, |
|
431 |
cwd = info.dir.file, env = env) |
|
432 |
||
433 |
val build_errors = |
|
73367 | 434 |
Isabelle_Thread.interrupt_handler(_ => process.terminate()) { |
435 |
Exn.capture { process.await_startup() } match { |
|
72662 | 436 |
case Exn.Res(_) => |
437 |
val resources_yxml = resources.init_session_yxml |
|
74144 | 438 |
val encode_options: XML.Encode.T[Options] = |
439 |
options => session.prover_options(options).encode |
|
72662 | 440 |
val args_yxml = |
441 |
YXML.string_of_body( |
|
442 |
{ |
|
443 |
import XML.Encode._ |
|
74144 | 444 |
pair(string, list(pair(encode_options, list(pair(string, properties)))))( |
72662 | 445 |
(session_name, info.theories)) |
446 |
}) |
|
447 |
session.protocol_command("build_session", resources_yxml, args_yxml) |
|
448 |
Build_Session_Errors.result |
|
449 |
case Exn.Exn(exn) => Exn.Res(List(Exn.message(exn))) |
|
450 |
} |
|
451 |
} |
|
452 |
||
453 |
val process_result = |
|
73367 | 454 |
Isabelle_Thread.interrupt_handler(_ => process.terminate()) { process.await_shutdown() } |
72662 | 455 |
|
72697 | 456 |
session.stop() |
457 |
||
72662 | 458 |
val export_errors = |
459 |
export_consumer.shutdown(close = true).map(Output.error_message_text) |
|
460 |
||
72699 | 461 |
val (document_output, document_errors) = |
72662 | 462 |
try { |
72881 | 463 |
if (build_errors.isInstanceOf[Exn.Res[_]] && process_result.ok && info.documents.nonEmpty) { |
72854 | 464 |
using(store.open_database_context())(db_context => |
72715
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
465 |
{ |
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
466 |
val documents = |
73719 | 467 |
Document_Build.build_documents( |
468 |
Document_Build.context(session_name, deps, db_context, progress = progress), |
|
72715
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
469 |
output_sources = info.document_output, |
73781
0909fd14f8a4
avoid former verbose_latex, which has been renamed to verbose in 52030acb19ac;
wenzelm
parents:
73777
diff
changeset
|
470 |
output_pdf = info.document_output) |
72715
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
471 |
db_context.output_database(session_name)(db => |
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
472 |
documents.foreach(_.write(db, session_name))) |
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
473 |
(documents.flatMap(_.log_lines), Nil) |
2615b8c05337
clarified signature --- avoid repeated open_database on server;
wenzelm
parents:
72711
diff
changeset
|
474 |
}) |
72662 | 475 |
} |
72881 | 476 |
else (Nil, Nil) |
72662 | 477 |
} |
72882 | 478 |
catch { |
73718 | 479 |
case exn: Document_Build.Build_Error => (exn.log_lines, List(exn.message)) |
72882 | 480 |
case Exn.Interrupt.ERROR(msg) => (Nil, List(msg)) |
481 |
} |
|
72662 | 482 |
|
483 |
val result = |
|
484 |
{ |
|
72738
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
485 |
val theory_timing = |
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
486 |
theory_timings.iterator.map( |
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
487 |
{ case props @ Markup.Name(name) => name -> props }).toMap |
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
488 |
val used_theory_timings = |
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
489 |
for { (name, _) <- deps(session_name).used_theories } |
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
490 |
yield theory_timing.getOrElse(name.theory, Markup.Name(name.theory)) |
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
491 |
|
72662 | 492 |
val more_output = |
493 |
Library.trim_line(stdout.toString) :: |
|
494 |
command_timings.toList.map(Protocol.Command_Timing_Marker.apply) ::: |
|
72738
a4d7da18ac5c
store timings for used_theories in canonical order, with reconstructed store.read_theories;
wenzelm
parents:
72730
diff
changeset
|
495 |
used_theory_timings.map(Protocol.Theory_Timing_Marker.apply) ::: |
72662 | 496 |
session_timings.toList.map(Protocol.Session_Timing_Marker.apply) ::: |
497 |
runtime_statistics.toList.map(Protocol.ML_Statistics_Marker.apply) ::: |
|
498 |
task_statistics.toList.map(Protocol.Task_Statistics_Marker.apply) ::: |
|
72699 | 499 |
document_output |
72662 | 500 |
|
72726
ec6a27bbdab8
proper return code for more errors (amending d892f6d66402);
wenzelm
parents:
72725
diff
changeset
|
501 |
process_result.output(more_output) |
ec6a27bbdab8
proper return code for more errors (amending d892f6d66402);
wenzelm
parents:
72725
diff
changeset
|
502 |
.error(Library.trim_line(stderr.toString)) |
ec6a27bbdab8
proper return code for more errors (amending d892f6d66402);
wenzelm
parents:
72725
diff
changeset
|
503 |
.errors_rc(export_errors ::: document_errors) |
72662 | 504 |
} |
505 |
||
506 |
build_errors match { |
|
507 |
case Exn.Res(build_errs) => |
|
508 |
val errs = build_errs ::: document_errors |
|
74259
6d48d6ba58df
more robust: progress.stopped means that build has failed;
wenzelm
parents:
74258
diff
changeset
|
509 |
if (errs.nonEmpty) { |
72662 | 510 |
result.error_rc.output( |
511 |
errs.flatMap(s => split_lines(Output.error_message_text(s))) ::: |
|
512 |
errs.map(Protocol.Error_Message_Marker.apply)) |
|
513 |
} |
|
74306 | 514 |
else if (progress.stopped && result.ok) result.copy(rc = Process_Result.RC.interrupt) |
74259
6d48d6ba58df
more robust: progress.stopped means that build has failed;
wenzelm
parents:
74258
diff
changeset
|
515 |
else result |
72662 | 516 |
case Exn.Exn(Exn.Interrupt()) => |
74306 | 517 |
if (result.ok) result.copy(rc = Process_Result.RC.interrupt) |
74259
6d48d6ba58df
more robust: progress.stopped means that build has failed;
wenzelm
parents:
74258
diff
changeset
|
518 |
else result |
72662 | 519 |
case Exn.Exn(exn) => throw exn |
520 |
} |
|
521 |
} |
|
522 |
||
73367 | 523 |
def terminate(): Unit = future_result.cancel() |
72662 | 524 |
def is_finished: Boolean = future_result.is_finished |
525 |
||
526 |
private val timeout_request: Option[Event_Timer.Request] = |
|
527 |
{ |
|
73700
908351c8c0b1
check timeout_ignored as in ML, before applying timeout_scale;
wenzelm
parents:
73559
diff
changeset
|
528 |
if (info.timeout_ignored) None |
908351c8c0b1
check timeout_ignored as in ML, before applying timeout_scale;
wenzelm
parents:
73559
diff
changeset
|
529 |
else Some(Event_Timer.request(Time.now() + info.timeout) { terminate() }) |
72662 | 530 |
} |
531 |
||
532 |
def join: (Process_Result, Option[String]) = |
|
533 |
{ |
|
534 |
val result1 = future_result.join |
|
535 |
||
536 |
val was_timeout = |
|
537 |
timeout_request match { |
|
538 |
case None => false |
|
73367 | 539 |
case Some(request) => !request.cancel() |
72662 | 540 |
} |
541 |
||
542 |
val result2 = |
|
73134
8a8ffe78eee7
clarified return code: re-use SIGALRM for soft timeout;
wenzelm
parents:
73033
diff
changeset
|
543 |
if (result1.ok) result1 |
8a8ffe78eee7
clarified return code: re-use SIGALRM for soft timeout;
wenzelm
parents:
73033
diff
changeset
|
544 |
else if (was_timeout) result1.error(Output.error_message_text("Timeout")).timeout_rc |
8a8ffe78eee7
clarified return code: re-use SIGALRM for soft timeout;
wenzelm
parents:
73033
diff
changeset
|
545 |
else if (result1.interrupted) result1.error(Output.error_message_text("Interrupt")) |
72662 | 546 |
else result1 |
547 |
||
548 |
val heap_digest = |
|
549 |
if (result2.ok && do_store && store.output_heap(session_name).is_file) |
|
550 |
Some(Sessions.write_heap_digest(store.output_heap(session_name))) |
|
551 |
else None |
|
552 |
||
553 |
(result2, heap_digest) |
|
554 |
} |
|
555 |
} |