diff --git a/antlir/antlir2/bzl/image/prebuilt.bzl b/antlir/antlir2/bzl/image/prebuilt.bzl index 59d1041fbf9..aaedbae1c3e 100644 --- a/antlir/antlir2/bzl/image/prebuilt.bzl +++ b/antlir/antlir2/bzl/image/prebuilt.bzl @@ -123,6 +123,7 @@ def _impl(ctx: AnalysisContext) -> list[Provider]: label = ctx.label, facts_db = facts_db, contents = contents, + subvol_symlink = contents.subvol_symlink, mounts = [], flavor = ctx.attrs.flavor, ), diff --git a/antlir/antlir2/bzl/package/sendstream.bzl b/antlir/antlir2/bzl/package/sendstream.bzl index e149fc16f30..bbab8079a98 100644 --- a/antlir/antlir2/bzl/package/sendstream.bzl +++ b/antlir/antlir2/bzl/package/sendstream.bzl @@ -36,7 +36,7 @@ def _impl(ctx: AnalysisContext) -> list[Provider]: if not userspace: subvol_symlink = ctx.actions.declare_output("subvol_symlink") else: - subvol_symlink = None + subvol_symlink = ctx.attrs.layer[LayerInfo].subvol_symlink if ctx.attrs.incremental_parent: incremental_parent_layer = _find_incremental_parent( @@ -64,6 +64,10 @@ def _impl(ctx: AnalysisContext) -> list[Provider]: incremental_parent = ctx.attrs.incremental_parent[SendstreamInfo].layer[LayerInfo].subvol_symlink else: incremental_parent = ctx.attrs.incremental_parent[SendstreamInfo].subvol_symlink + if incremental_parent == None: + fail("failed to get subvol_symlink from incremental_parent, cannot proceed: {}".format( + ctx.attrs.incremental_parent[SendstreamInfo], + )) else: incremental_parent = None @@ -72,7 +76,7 @@ def _impl(ctx: AnalysisContext) -> list[Provider]: {"sendstream": { "compression_level": ctx.attrs.compression_level, "incremental_parent": incremental_parent, - "subvol_symlink": subvol_symlink.as_output() if subvol_symlink else None, + "subvol_symlink": subvol_symlink.as_output() if not userspace else None, "userspace": userspace, "volume_name": ctx.attrs.volume_name, }},