Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpkg_status does not add transitive dependencies #54

Open
glindstedt opened this issue May 29, 2024 · 5 comments
Open

dpkg_status does not add transitive dependencies #54

glindstedt opened this issue May 29, 2024 · 5 comments
Labels
feature request New feature or request help wanted Extra attention is needed

Comments

@glindstedt
Copy link

Currently there is no transitive dependency resolution of the packages that you provide to the dpkg_status rule. This causes apt to complain about missing dependencies and thinking that the install is broken. It might be possible to work around with a custom rule to resolve transitive deps of the top level packages you want to have installed before passing to dpkg_status, but it feels like this should be default behavior.

@thesayyn thesayyn added the help wanted Extra attention is needed label May 29, 2024
@thesayyn
Copy link
Collaborator

These are still pre-1.0 rules, I am not surprised it is not doing the right thing. This is not a priority for us, but we are happy to accept PRs.

I'd imagine an aspect walking up the tree would do the trick.

@thesayyn thesayyn added the feature request New feature or request label May 29, 2024
@glindstedt
Copy link
Author

I might be wrong as I haven't used aspects much, but I think an aspect won't quite cut it currently since the :control targets only point to the control files of the current package and are separate from the normal dependency tree, so there's no graph to traverse:
https://github.com/GoogleContainerTools/rules_distroless/blob/main/apt/private/index.bzl#L38

How about making a new rule with a control attribute and e.g. ControlInfo provider instead of using filegroup for the main target?

deb_package(
    name = "{target_name}",
    control = ":control",
    srcs = [
        {deps}
    ] + [":data"]
)

@alexeagle
Copy link
Collaborator

It seems to me that https://github.com/GoogleContainerTools/rules_distroless/blob/main/examples/debian_snapshot/BUILD.bazel#L74 is just wishing for a load("@bullseye//:defs.bzl", "ALL_PACKAGES") symbol to be generated, that would include transitives as well.

@alexnovak
Copy link

alexnovak commented Aug 5, 2024

Could we add an additional rule in the template that contains the control for a given package, and its dependencies in a filegroup? I'm not sure if this would have any disadvantages compared to a ControlInfo provider.

@thesayyn
Copy link
Collaborator

thesayyn commented Dec 9, 2024

As of #115 we automatically create a dpkg_status target for every apt.install at the repository root (@bullseye//:dpkg_status) which contains all the packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants