From 20076766fc0e72ddd250c2cb853f5eb1d8b234f5 Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Fri, 13 Feb 2026 12:25:55 -0800 Subject: [PATCH] Unwrap pkg_deb rule Signed-off-by: Maksym Pavlenko --- pkg/private/deb/deb.bzl | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pkg/private/deb/deb.bzl b/pkg/private/deb/deb.bzl index d385ed5e..9c3cc0f1 100644 --- a/pkg/private/deb/deb.bzl +++ b/pkg/private/deb/deb.bzl @@ -29,9 +29,12 @@ def _pkg_deb_impl(ctx): ctx.attr.architecture, ) + out_file = ctx.outputs.out or ctx.actions.declare_file(ctx.attr.name + ".deb") + outputs, output_file, output_name = setup_output_files( ctx, package_file_name = package_file_name, + default_output_file = out_file, ) out_file_name_base = output_name.rsplit(".", 1)[0] @@ -181,7 +184,7 @@ def _pkg_deb_impl(ctx): }, ) output_groups = { - "out": [ctx.outputs.out], + "out": [out_file], "deb": [output_file], "changes": [changes_file], } @@ -194,7 +197,7 @@ def _pkg_deb_impl(ctx): ] # A rule for creating a deb file, see README.md -pkg_deb_impl = rule( +pkg_deb = rule( implementation = _pkg_deb_impl, doc = """ Create a Debian package. @@ -374,7 +377,6 @@ See https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files.""", # Common attributes "out": attr.output( doc = """See [Common Attributes](#out)""", - mandatory = True, ), "package_file_name": attr.string( doc = """See [Common Attributes](#package_file_name). @@ -395,12 +397,3 @@ See https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files.""", }, ) -def pkg_deb(name, out = None, **kwargs): - """@wraps(pkg_deb_impl).""" - if not out: - out = name + ".deb" - pkg_deb_impl( - name = name, - out = out, - **kwargs - )