targets = self.context.target_roots
input_snapshots = tuple(
target.sources_snapshot(scheduler=self.context._scheduler) for target in targets
)
input_files = set(f.path for snapshot in input_snapshots for f in snapshot.files)
// TODO: Work out a nice library-like utility for writing an argfile, as this will be common.
with temporary_dir() as tmpdir:
list_file = os.path.join(tmpdir, "input_files_list")
with open(list_file, "w") as list_file_out:
for input_file in sorted(input_files):
list_file_out.write(input_file)
list_file_out.write(b"\n")
list_file_snapshot = self.context._scheduler.capture_snapshots((
PathGlobsAndRoot(
PathGlobs(("input_files_list",)),
str(tmpdir),
),
))[0]
cloc_path, cloc_snapshot = ClocBinary.global_instance().hackily_snapshot(self.context)
directory_digest = self.context._scheduler.merge_directories(tuple(s.directory_digest for s in
input_snapshots + (
cloc_snapshot,
list_file_snapshot,