From 9fa2a84c35456c8d23cdb77c59cb8f1e09fa10d6 Mon Sep 17 00:00:00 2001 From: jianglai Date: Tue, 13 Nov 2018 07:56:29 -0800 Subject: [PATCH] Replace iteration over depsets with an explicit .to_list() call The old pattern did an implicit iteration over a depset which will be forbidden in the future since it is potentially expensive. The new to_list() call is still expensive but it will be more visible. LSC: [] Tested: TAP --sample for global presubmit queue [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=221266626 --- java/google/registry/builddefs/zip_file.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/google/registry/builddefs/zip_file.bzl b/java/google/registry/builddefs/zip_file.bzl index a37456bc5..07c42691e 100644 --- a/java/google/registry/builddefs/zip_file.bzl +++ b/java/google/registry/builddefs/zip_file.bzl @@ -161,7 +161,7 @@ def _zip_file(ctx): for _, zip_path in mapped if "/" in zip_path ], - ) + ).to_list() ] cmd += [ 'ln -sf "${repo}/%s" "${tmp}/%s"' % (path, zip_path) @@ -181,7 +181,7 @@ def _zip_file(ctx): ctx.file_action(output = script, content = "\n".join(cmd), executable = True) inputs = [ctx.file._zipper] inputs += [dep.zip_file for dep in ctx.attr.deps] - inputs += list(srcs) + inputs += srcs.to_list() ctx.action( inputs = inputs, outputs = [ctx.outputs.out],