Skip to content

Commit

Permalink
Bump version to 1.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
angelonakos committed May 18, 2022
2 parents 93cb710 + 456cc59 commit ee931df
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
CHANGELOG
`````````

Version 1.25.0 -- 2022-05-18
----------------------------
- Fix litani run.json and litani outcome-table.json man pages

- Keep litani.7 at the first index in report


- Accept lists of input/output files embedded in JSON files


Version 1.24.0 -- 2022-04-14
----------------------------
- Do not create HTML docs of Litani man pages if a flag is specified
Expand Down
6 changes: 5 additions & 1 deletion doc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def man_to_html(man_name, man_out, builds):
def convert_man_dir_to_man(
src_dir, dst_dir, rule, html_mans, builds, gen_html, extra_inputs=None):
for man in (src_dir).iterdir():
man_name = str(man.name).split(".", 1)[0]
man_name = man.stem
if man.suffix == ".scdoc":
with open(man) as fp:
line = fp.readline().rstrip()
Expand Down Expand Up @@ -206,6 +206,10 @@ def main():

add_litani_7(builds, html_mans, args.gen_html)

for h in html_mans:
if "litani.7" in h.name:
html_mans.insert(0, html_mans.pop(html_mans.index(h)))

if args.gen_html:
builds.append({
"inputs": html_mans + [
Expand Down
6 changes: 5 additions & 1 deletion doc/src/man/litani-add-job.scdoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ configure times.

*--inputs* _F_ [_F_ ...]
A list of inputs that this job depends on. Litani interprets each _F_ as a file:
- If _F_ starts with @, then treat the remainder of the file name as JSON
file containing a list of files, which in turn are to be handled as
specified in the following items.
- If every _F_ exists and has an older timestamp than all of this job's
outputs, then Litani will not run this job.
- If some of the _F_ are newer than any of this job's outputs, then those
Expand All @@ -81,7 +84,8 @@ configure times.
out-of-date files, then the build will fail.

*--outputs* _F_ [_F_ ...]
A list of outputs that this job emits. Litani interprets each _F_ as a file,
A list of outputs that this job emits. Litani interprets each _F_ as a file
(or a JSON file if prefixed with @, as described for *--inputs* above),
and expects that the command will write a file with that name upon completion.
If a job _J_ has _F_ as an output, but does not actually write a file called
_F_, then _J_ will run unconditionally because _F_ will always be considered
Expand Down
8 changes: 4 additions & 4 deletions lib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ def build(self):
args["command"])
self.nodes.add(cmd_node)

for inputt in args.get("inputs") or []:
for inputt in lib.litani.expand_args(args.get("inputs")):
in_node = lib.graph.DependencyNode(inputt)
self.nodes.add(in_node)
self.edges.add(lib.graph.Edge(src=in_node, dst=cmd_node))

for output in args.get("outputs") or []:
for output in lib.litani.expand_args(args.get("outputs")):
out_node = lib.graph.DependencyNode(output)
self.nodes.add(out_node)
self.edges.add(lib.graph.Edge(src=cmd_node, dst=out_node))
Expand Down Expand Up @@ -265,12 +265,12 @@ def __str__(self):
args["pipeline_name"], args["description"], args["command"])
nodes.add(cmd_node)
if args["outputs"]:
for output in args["outputs"]:
for output in lib.litani.expand_args(args["outputs"]):
out_node = DependencyNode(output)
nodes.add(out_node)
edges.add(Edge(src=cmd_node, dst=out_node))
if args["inputs"]:
for inputt in args["inputs"]:
for inputt in lib.litani.expand_args(args["inputs"]):
in_node = DependencyNode(inputt)
nodes.add(in_node)
edges.add(Edge(src=in_node, dst=cmd_node))
Expand Down
20 changes: 19 additions & 1 deletion lib/litani.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ"
TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ"
VERSION_MAJOR = 1
VERSION_MINOR = 24
VERSION_MINOR = 25
VERSION_PATCH = 0
RC = False

Expand Down Expand Up @@ -269,3 +269,21 @@ def unlink_expired():
# No need to release lock after deletion
else:
lock_dir.release()


def expand_args(files):
"""Produce a list of files by expanding any "@"-prefixed file names to their
JSON-list contents.
"""
if not files:
return []

result = []
for f in files:
if f.startswith("@"):
with open(f[1:]) as json_file:
result.extend(json.load(json_file))
else:
result.append(f)

return result
4 changes: 2 additions & 2 deletions litani
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ def fill_out_ninja(cache, rules, builds, pools):
pools[name] = depth

for entry in cache["jobs"]:
outs = entry["outputs"] or []
ins = entry["inputs"] or []
outs = lib.litani.expand_args(entry["outputs"])
ins = lib.litani.expand_args(entry["inputs"])

if "description" in entry:
description = entry["description"]
Expand Down

0 comments on commit ee931df

Please sign in to comment.