Skip to content

isc-dhcp/libgpiod: Make dependencies conditional#29165

Open
ernestask wants to merge 2 commits intoopenwrt:masterfrom
ernestask:conditional-deps
Open

isc-dhcp/libgpiod: Make dependencies conditional#29165
ernestask wants to merge 2 commits intoopenwrt:masterfrom
ernestask:conditional-deps

Conversation

@ernestask
Copy link
Copy Markdown

📦 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-rndc and bind-client that is not needed in other packages, so it can be made conditional on PACKAGE_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

  • OpenWrt Version: 9247eb400241cd2b6f3ec141744b560dcf59c8db
  • OpenWrt Target/Subtarget: mediatek/filogic
  • OpenWrt Device: openwrt-one

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

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>
Copy link
Copy Markdown
Member

@pprindeville pprindeville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nix on the isc-dhcp changes.

Comment thread net/isc-dhcp/Makefile
+bind-server \
+bind-rndc \
+bind-client
+PACKAGE_isc-dhcp-dyndns:bind-server \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An existing example: 0c245fd

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants