Skip to content

Commit

Permalink
Back out "[antlir sendstream][anon targets] Migrate to new API"
Browse files Browse the repository at this point in the history
Summary:
Original commit changeset: 3bdde696f4b2

This is breaking image builds. No CI jobs were even attempted on the original
diff so failures were not surfaced until users started hitting it.
For example: https://fb.workplace.com/groups/antlirusers/posts/1779634125801705

Original Phabricator Diff: D49195679

Test Plan: testhard

Reviewed By: pallotron

Differential Revision: D49913284

fbshipit-source-id: a8a2a17f12db458755d329eb1d1d33f3843aac21
  • Loading branch information
vmagro authored and facebook-github-bot committed Oct 4, 2023
1 parent b1a4186 commit aa02ce2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions antlir/antlir2/bzl/package/sendstream.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ def _impl(ctx: AnalysisContext) -> list[Provider]:
)
return [DefaultInfo(sendstream), SendstreamInfo(sendstream = sendstream)]

_sendstream = anon_rule(
_sendstream = rule(
impl = _impl,
attrs = {
"antlir2_packager": attrs.default_only(attrs.exec_dep(default = "//antlir/antlir2/antlir2_packager:antlir2-packager")),
"build_appliance": attrs.option(attrs.dep(providers = [LayerInfo]), default = None),
"layer": attrs.dep(providers = [LayerInfo]),
"volume_name": attrs.string(default = "volume"),
},
artifact_promise_mappings = {
"anon_v1_sendstream": lambda x: x[SendstreamInfo].sendstream,
},
)

sendstream = rule_with_default_target_platform(_sendstream)
Expand All @@ -56,13 +53,16 @@ def anon_v1_sendstream(
volume_name: str = "volume",
build_appliance: Dependency | None = None,
antlir2_packager: Dependency | None = None) -> Artifact:
return ctx.actions.anon_target(_sendstream, {
v1_anon_target = ctx.actions.anon_target(_sendstream, {
"antlir2_packager": antlir2_packager or ctx.attrs.antlir2_packager,
"build_appliance": build_appliance or ctx.attrs.build_appliance,
"layer": layer,
"name": str(layer.label.raw_target()) + ".sendstream",
"volume_name": volume_name,
}).artifact("anon_v1_sendstream")
})
return ctx.actions.artifact_promise(
v1_anon_target.map(lambda x: x[SendstreamInfo].sendstream),
)

def _zst_impl(ctx: AnalysisContext) -> list[Provider]:
sendstream_zst = ctx.actions.declare_output("image.sendstream.zst")
Expand Down

0 comments on commit aa02ce2

Please sign in to comment.