Unwrap pkg_deb rule to enable inherit_attrs#1026
Unwrap pkg_deb rule to enable inherit_attrs#1026mxpv wants to merge 1 commit intobazelbuild:mainfrom
Conversation
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
|
What if we just exposed the attribute list as something you can use yourself, and wrap the implementaion so you can reuse it. Or, update this to a symbolic macro. Although that may break bazel 7 compatibilty. I'ld have to check. |
@tonyaiuto Symbolic macros were introduced in Bazel 8, so that won't work on 7.
Exposing the attribute list is another option. Any particular reason not to expose the rule directly? That seems more natural and can be used directly with |
|
Because declare_file is bound a little later than having the label at load time. The semantics will change slightly, so I worry about existing uses. ISTR that pointing directly at the .deb as a label mattered inside Google, but I can't test that any more.
What are you trying to do that requires wrapping the rule? Could this be something that turns into a base level feature?
…On Thu, Feb 19, 2026, at 5:26 PM, Maksym Pavlenko wrote:
*mxpv* left a comment (bazelbuild/rules_pkg#1026) <#1026 (comment)>
> Or, update this to a symbolic macro. Although that may break bazel 7 compatibilty. I'ld have to check.
>
@tonyaiuto <https://github.com/tonyaiuto> Symbolic macros were introduced in Bazel 8 <https://bazel.build/rules/macro-tutorial>, so that won't work on 7.
> What if we just exposed the attribute list as something you can use yourself, and wrap the implementaion so you can reuse it.
>
Exposing the attribute list is another option. Any particular reason not to expose the rule directly? That seems more natural and can be used directly with `inherit_attrs`.
—
Reply to this email directly, view it on GitHub <#1026 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAXHHHB3E5XJBFKBSD2LHYT4MYS7FAVCNFSM6AAAAACVCMJ632VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSMZQGE3TENBTGQ>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
@aiuto I'm maintaining a bunch of custom debian packages and rely on custom macros and rules to wrap common tasks (like managing systemd units similarly to |
I was trying to wrap
pkg_debinto a macro to express some common functionality. One convenient thing that Bazel has isinherit_attrs = pkg_deb, which lets you redefine certain attributes and reuse everything else. However, in the current implementation it's not possible to use, becausepkg_debis being wrapped in a legacy macro.This PR exposes the rule directly and moves the logic to default out into the rule implementation.