Skip to content

Commit

Permalink
remove redundant copying from ditributed thinlto due the buck2 issue …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Fan Zhang(DevX) authored and facebook-github-bot committed Oct 13, 2022
1 parent 45cfb87 commit c7709e4
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions prelude/cxx/dist_lto/dist_lto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit c7709e4

Please sign in to comment.