Skip to content

Commit

Permalink
[antlir] Avoid rendering the same shape target twice
Browse files Browse the repository at this point in the history
Summary: See upwards in the stack. This trips up builds where the same shape is rendered twice from a single TARGETS file.

Test Plan: Built in this stack.

Reviewed By: cooperlees

Differential Revision: D47555763

fbshipit-source-id: c35b476825694e229b79eb7927e35244cd76e5ec
  • Loading branch information
Michael van der Westhuizen authored and facebook-github-bot committed Jul 18, 2023
1 parent 6ded2fc commit e34a705
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions antlir/bzl/shape.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ def _render_template(name, instance, template, visibility = None): # pragma: no
Warning: this will fail to serialize any shape type that contains a
reference to a target location, as that cannot be safely cached by buck.
"""
if native.rule_exists(name + "--data.json"):
return normalize_target(":" + name)
_json_file(name + "--data.json", instance)

buck_genrule(
Expand Down

0 comments on commit e34a705

Please sign in to comment.