isc-dhcp/libgpiod: Make dependencies conditional#29165
isc-dhcp/libgpiod: Make dependencies conditional#29165ernestask wants to merge 2 commits intoopenwrt:masterfrom
Conversation
The python3-light dependency gets lugged even with the package disabled, so this commit explicitly enables or disables building bindings just as with C++ and makes python3-light a conditional dependency. Signed-off-by: Ernestas Kulik <ernestas.k@iconn-networks.com>
Selecting any other subpackage will bring these in needlessly. Signed-off-by: Ernestas Kulik <ernestas.k@iconn-networks.com>
pprindeville
left a comment
There was a problem hiding this comment.
Nix on the isc-dhcp changes.
| +bind-server \ | ||
| +bind-rndc \ | ||
| +bind-client | ||
| +PACKAGE_isc-dhcp-dyndns:bind-server \ |
There was a problem hiding this comment.
I don't get this. Look at the install directions for this package. It doesn't do anything but make sure dependencies are satisfied. It's a meta-package. Making the dependencies conditional would defeat the purpose of having it.
There was a problem hiding this comment.
The install section is irrelevant here, but perhaps I haven’t expressed myself properly, so let me try to explain my problem again
scripts/package-metadata.pl will parse the package and spit out a line like this to tmp/.packagedeps (which is then used for ordering builds):
$(curdir)/feeds/packages/isc-dhcp/compile += $(curdir)/feeds/packages/bind/compile $(curdir)/libs/toolchain/compile $(curdir)/libs/zlib/compile
That means that if I select, say PACKAGE_isc-dhcp-relay-ipv6, in my config and leave PACKAGE_isc-dhcp-dyndns unselected, bind will still be built as a build dependency.
With the change, it would look more like this:
$(curdir)/feeds/packages/isc-dhcp/compile += $(curdir)/libs/toolchain/compile $(curdir)/libs/zlib/compile $(if $(CONFIG_PACKAGE_isc-dhcp-dyndns),$(curdir)/feeds/packages/bind/compile)
…and my build times would become ever-so-slightly shorter (the worse offender in my case is libgpiod with Python).
There was a problem hiding this comment.
Still not getting it. All of this is inside the definition of the subpackage isc-dhcp-dyndns so why would any of it take effect if that package isn't already selected? Isn't what you're doing redundant?
There was a problem hiding this comment.
Due to how the package scripts work overall, it’s not redundant, unfortunately. All of the (sub-)package dependencies within a Makefile are collected and become implicit build dependencies, whether a particular subpackage is enabled or not (just picking any one is enough, because they are per-directory).
It could be “fixed” (it’s not a bug per se, more a build time optimization) by doing the same for all packages by default, but quite a few packages unknowingly rely on implicit behavior and would need fixing to get dependencies right, so I’m cherry-picking individual package changes I made.
It’s pretty much only noticable when building n+1 times a day and looking at the make output.
📦 Package Details
Maintainer: @pprindeville @mhei
Description:
Some packages (in this case, libgpiod and isc-dhcp) have dependencies in subpackages that get built even if said subpackages are not selected (and nothing else depends on them).
isc-dhcp: isc-dhcp-dyndns has a dependency on
bind-server,bind-rndcandbind-clientthat is not needed in other packages, so it can be made conditional onPACKAGE_isc-dhcp-dyndns.libgpiod: python3-gpio causes python3-light to be built, which can be avoided by making the dependency conditional and disabling Python bindings explicitly in
CONFIGURE_ARGS.🧪 Run Testing Details
✅ Formalities