Commit a526ccbf authored by Luke Zielinski's avatar Luke Zielinski Committed by Commit Bot

Update WPT Metadata Builder to output a stamp file.

The stamp will be the only output declared by this script, since the
output directory is large and variable. But the modification time of the
stamp file should match the modification time of the metadata directory,
which is what the build system needs to determine whether the action
needs to be re-run.

I tested by running `$ autoninja -C out/Default third_party/blink/tools:build_wpt_metadata`
twice in a row. The first time ran the script, second time said "no work to do".

Bug: 995112
Change-Id: Id74e6e623807be604e85dd69ab95883a6ce275fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762590Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Luke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688644}
parent 22a1e477
...@@ -13,7 +13,7 @@ action("build_wpt_metadata") { ...@@ -13,7 +13,7 @@ action("build_wpt_metadata") {
"../../third_party/blink/web_tests/WPTOverrideExpectations", "../../third_party/blink/web_tests/WPTOverrideExpectations",
] ]
outputs = [ outputs = [
"$root_out_dir/wpt_expectations_metadata/", "$root_out_dir/wpt_expectations_metadata.stamp",
] ]
data = [ data = [
# Include the blinkpy tools to access expectations data # Include the blinkpy tools to access expectations data
......
...@@ -63,6 +63,12 @@ class WPTMetadataBuilder(object): ...@@ -63,6 +63,12 @@ class WPTMetadataBuilder(object):
with open(filename, "w") as metadata_file: with open(filename, "w") as metadata_file:
metadata_file.write(file_contents) metadata_file.write(file_contents)
# Finally, output a stamp file with the same name as the output
# directory. The stamp file is empty, it's only used for its mtime.
# This makes the GN build system happy (see crbug.com/995112).
with open(self.metadata_output_dir + ".stamp", "w"):
pass
def get_test_names_for_metadata(self): def get_test_names_for_metadata(self):
"""Determines which tests in the expectation file need metadata. """Determines which tests in the expectation file need metadata.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment