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

Allow installing recommended/optional dependencies for some packages #2364

Closed
septatrix opened this issue Feb 9, 2024 · 4 comments
Closed

Comments

@septatrix
Copy link
Contributor

Currently the WithRecommends= is a very binary approach. Sadly this does not work for all packages which offer some minimal functionality without the recommended deps but are commonly used with them.
An example would be pre-bookworm python3-coverage which can generate HTML reports but requires jQuery for that. In that case I worked with upstream to completely remove the jQuery dependency but that is not always sensible.

It would be great to be able to enable more dependencies for some of the packages. I hoped there might be some query pattern (e.g. ?suggested-by(python3-coverage)) but alas there is none. I have not looked further into Dependencies= though I think it might be possible to define an image with only the packages which should have dependencies in them and pull them in via ExtraTrees= though that is very convoluted and ugly (if it even works) and has disadvantages for manifest generation etc.

My though would be to either add a new PackagesWithRecommends= option or allow WithRecommends= to receive a list of packages which should be installed with their recommended/optional deps.

@septatrix
Copy link
Contributor Author

PS: Another more common package would be fail2ban which in Debian recommends nftables/iptables, python3-pyinotify and python3-systemd where one might only note too late that some deps are not installed

@DaanDeMeyer
Copy link
Contributor

There's way too many use cases like this for us to support all of them. I'd just use a prepare script for this where you can enable recommend dependencies for a few packages.

@iam-TJ
Copy link

iam-TJ commented Feb 10, 2024

There is another "Debian" way for this: create an equivs "profile" package that Depends: on the Recommends: - still requires some work to generate the list but then installing that package into the image will pull those packages in.

@septatrix
Copy link
Contributor Author

The problem I have with a prepare script is that it makes the packages not show up in the manifest as far as I understand (which is already annoying enough for some packages we have to install via pip).

I come to the realization that to enable recommended/weak deps for some packages one obviously needs to know for which packages they want to do this beforehand. Once at this point I can also simply look up what the relevant deps are and simply list them on my own. Maybe even putting a comment beforehand to signify this and as a reminder to check the list once in a while (e.g. when raising the used distro release). This might also be favorable in general as not all recommended deps are always desired, e.g. for the above example of fail2ban I do not care about whois.
This is likely similar to what would be necessary with those equivs "packages" but can be used for all distros.

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

No branches or pull requests

3 participants