From c7709e41b36bc50fc9abbb50f7cb0c8790fe6f8e Mon Sep 17 00:00:00 2001 From: "Fan Zhang(DevX)" Date: Thu, 13 Oct 2022 10:17:31 -0700 Subject: [PATCH] remove redundant copying from ditributed thinlto due the buck2 issue fixed. Summary: Like the removed comments said, this copying is to work around a buck2 issue and that issues has been fixed. (previous test: D40049836) This change removed the redundant 'copy', reduced 13.5%(29k) number of actions in the case of unicorn. total 215.5K -> 186.5k {F780551039} Reviewed By: krallin Differential Revision: D40319824 fbshipit-source-id: 4c2279e1296b612d06d9ad02ecf6c6f2069a2ffb --- prelude/cxx/dist_lto/dist_lto.bzl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/prelude/cxx/dist_lto/dist_lto.bzl b/prelude/cxx/dist_lto/dist_lto.bzl index 3fad6cbf21ad..b8bc0a1e2346 100644 --- a/prelude/cxx/dist_lto/dist_lto.bzl +++ b/prelude/cxx/dist_lto/dist_lto.bzl @@ -575,19 +575,11 @@ def cxx_dist_link( for artifact in index_link_data: link_data = artifact.link_data if artifact.data_type == DataType("bitcode"): - # TODO(cjhopman): This copy works around a buck bug where we don't - # get early cutoff if a non-consumed output of an action dependency - # changes. - copied_bc_file = ctx.actions.declare_output(link_data.bc_file.short_path + ".copied") - copied_plan = ctx.actions.declare_output(link_data.plan.short_path + ".copied") - ctx.actions.copy_file(copied_bc_file, link_data.bc_file) - ctx.actions.copy_file(copied_plan, link_data.plan) - dynamic_optimize( name = link_data.name, initial_object = link_data.initial_object, - bc_file = copied_bc_file, - plan = copied_plan, + bc_file = link_data.bc_file, + plan = link_data.plan, opt_object = link_data.opt_object, ) elif artifact.data_type == DataType("archive"):