Fix worklist files with skslc.
Previously, the worklists were being deleted as soon as they were
closed; by the time skslc executed, they were already gone.
Change-Id: I0d0be87525093a3ff37421cbff553fa481c8e1f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335864
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/gn/compile_processors.py b/gn/compile_processors.py
index 3e6cd45..88504aa 100755
--- a/gn/compile_processors.py
+++ b/gn/compile_processors.py
@@ -17,7 +17,7 @@
exeSuffix = '.exe' if sys.platform.startswith('win') else '';
targets = []
-worklist = tempfile.NamedTemporaryFile(suffix='.worklist')
+worklist = tempfile.NamedTemporaryFile(suffix='.worklist', delete=False)
# Fetch clang-format if it's not present already.
if not os.path.isfile(clangFormat + exeSuffix):
@@ -47,6 +47,8 @@
print("### skslc error:\n")
print("\n".join(err.output.splitlines()))
+os.remove(worklist.name)
+
# Invoke clang-format on every generated target.
try:
output = subprocess.check_output([clangFormat, "--sort-includes=false", "-i"] + targets,