Skip to content

Re-add removed parameter package_template to apt.install - #258

Open
tempoz wants to merge 2 commits into
bazel-contrib:mainfrom
tempoz:readd-removed-parameter-package-template
Open

tempoz wants to merge 2 commits into
bazel-contrib:mainfrom
tempoz:readd-removed-parameter-package-template

Conversation

@tempoz

@tempoz tempoz commented Sep 1, 2026

Copy link
Copy Markdown

Somewhere in the shuffle of the refactoring of apt.install, this attr seems to have been dropped. It is vitally important if you want to use the dpkg_statusd rule provided by //apt:defs.bzl, as can be seen in the distroless repo here: https://github.com/GoogleContainerTools/distroless/blob/2958d510e6e7dcaa1f546042cfca98930a60a2ce/private/repos/deb/deb.MODULE.bazel#L21

This PR just re-adds the package_template parameter and re-pipes it through to translate_dependency_set, following the example of the PR that re-adds mergedusr here: #244

I have tested this change locally in my project that depends on rules_distroless and confirmed that it works as intended.

@loosebazooka

Copy link
Copy Markdown
Contributor

Yeah this is probably blocking some updates from being simple. I'll take a look

@thesayyn

thesayyn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

We probably don't want to keep the old api shape. i am thinking this could be something like

apt.package_template(
     packages = ["nvidia-*"],
     template =  """template here""",
     additional_variables = {}
)

Comment thread apt/extensions.bzl Outdated
@loosebazooka

Copy link
Copy Markdown
Contributor

can you address @thesayyn comment as well. They are much more in tune with the api surface than I am.

@tempoz

tempoz commented Sep 2, 2026

Copy link
Copy Markdown
Author

That feels like it's well outside the scope of this PR? This is meant to be a very light-touch bugfix (it's only ten lines, after all); @thesayyn's comment is referring to a feature request that implements a breaking API change and adds a whole new tag in the module extension and then pipes it through to translate_dependency_set (which currently remains unchanged and has a package_template parameter that expects an allow_single_file Target). There are multiple design decisions between here and there that would need to be made that I would argue should not be made by me. You can correct me if I'm wrong, but I took it as a meta-comment to the project maintainers regarding a path forward as opposed to a request to change my PR.

I would update my code that depends on rules_distroless to fit that framework if that was what you had already done, but as the code stands right now, this parameter was simply removed with no migration path. In the absence of such a migration path, I am humbly requesting that the parameter be reinstated, however temporarily, and have provided code which does that. If you do not wish to reinstate the parameter for whatever reason, then please feel free to close this PR. It does not greatly inconvenience me if this code is not merged, since I can just patch your repo until a migration path is provided.

@thesayyn

thesayyn commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

I did not mean to sign you up for a work that you did not want. I was simply explaining the path forward for this feature which also tries to explain why it was removed in the first place.

@tempoz

tempoz commented Sep 2, 2026

Copy link
Copy Markdown
Author

As long as you also believe that it should not have been removed yet, given that the path forward does not currently exist, we are in agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants