Skip to content

Commit

Permalink
Move build stamping to final step
Browse files Browse the repository at this point in the history
Summary: This moves the build stamping that will guarantee invalidation of all steps that use the resulting artifact to be the final action in the dist_lto action

Reviewed By: christycylee

Differential Revision: D68034482

fbshipit-source-id: 225ddcb3a479653075708e681a903094acb6ddd7
  • Loading branch information
Keshav Varma authored and facebook-github-bot committed Jan 13, 2025
1 parent a8851c1 commit d7098df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cxx/dist_lto/dist_lto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,6 @@ def cxx_gnu_dist_link(
)

final_output = output if not (executable_link and cxx_use_bolt(ctx)) else bolt(ctx, output, external_debug_info, identifier)
final_output = stamp_build_info(ctx, final_output) if executable_link else final_output

dwp_output = ctx.actions.declare_output(output.short_path.removesuffix("-wrapper") + ".dwp") if generate_dwp else None

if generate_dwp:
Expand All @@ -652,6 +650,8 @@ def cxx_gnu_dist_link(
strip_args = opts.strip_args_factory(ctx) if opts.strip_args_factory else cmd_args()
final_output = strip_object(ctx, cxx_toolchain, final_output, strip_args, category_suffix)

final_output = stamp_build_info(ctx, final_output) if executable_link else final_output

return LinkedObject(
output = final_output,
unstripped_output = unstripped_output,
Expand Down
3 changes: 2 additions & 1 deletion cxx/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ def cxx_link_into(
output = strip_object(ctx, cxx_toolchain_info, output, strip_args, opts.category_suffix)

final_output = output if not (is_result_executable and cxx_use_bolt(ctx)) else bolt(ctx, output, external_debug_info, opts.identifier)
final_output = stamp_build_info(ctx, final_output) if is_result_executable else final_output

dwp_artifact = None
if should_generate_dwp:
Expand All @@ -359,6 +358,8 @@ def cxx_link_into(
from_exe = not dwp_from_dwo,
)

final_output = stamp_build_info(ctx, final_output) if is_result_executable else final_output

linked_object = LinkedObject(
output = final_output,
link_args = opts.links,
Expand Down

0 comments on commit d7098df

Please sign in to comment.