Need help with Kconfig recursive dependencies

David Härdeman david at hardeman.nu
Mon Sep 29 02:43:44 PDT 2025


Hi,

I posted this to the forum 2 weeks ago [1], but so far I didn't get any
feedback, so I'll try the devel list.

I'm trying to change bind so that it provides packages compiled with GSSAPI
support as a VARIANT instead of making GSSAPI a compile-time option.

My current branch is here[2], with the Makefile[3] being the most interesting
part.

I've defined separate bind-libs and bind-libs-gssapi packages:

  define Package/bind-libs
    ...
    URL:=https://www.isc.org/software/bind
    VARIANT:=without-gssapi
    CONFLICTS:=bind-libs-gssapi
  endef

  define Package/bind-libs-gssapi
    $(Package/bind-libs)
    DEPENDS+=+krb5-libs +libcomerr
    TITLE+= with GSSAPI
    VARIANT:=with-gssapi
    CONFLICTS:=
  endef

And then split all the packages which depend on bind-libs in two versions:

  define Package/bind/Default
    ...
    VARIANT:=without-gssapi
    DEPENDS:=+bind-libs + at OPENSSL_WITH_EC
  endef

  define Package/bind-gssapi/Default
    $(Package/bind/Default)
    VARIANT:=with-gssapi
    DEPENDS:=+bind-libs-gssapi + at OPENSSL_WITH_EC
  endef

For example, bind-delv:

  define Package/bind-delv
    $(Package/bind/Default)
    TITLE+= tools (delv)
    CONFLICTS:=bind-delv-gssapi
  endef

  define Package/bind-delv-gssapi
    $(Package/bind-gssapi/Default)
    TITLE+= tools (delv) with GSSAPI
    PROVIDES:=bind-delv
  endef

So far, so good, and "make menuconfig" doesn't complain, even though
tmp/.packageauxvars looks a bit weird (note the last line):

  Package/bind-delv/subdir = packages
  Package/bind-delv/depends = bind-libs libc
  Package/bind-delv-gssapi/subdir = packages
  Package/bind-delv-gssapi/depends = bind-libs-gssapi libc
  Package/bind-delv/depends = bind-libs-gssapi libc

Now, if I change e.g. bind-check, which is defined just like bind-delv:

  define Package/bind-check
    $(Package/bind/Default)
    TITLE+= tools (named-checkconf, named-checkzone)
    CONFLICTS:=bind-check-gssapi
  endef

  define Package/bind-check-gssapi
    $(Package/bind-gssapi/Default)
    TITLE+= tools (named-checkconf, named-checkzone) with GSSAPI
    #PROVIDES:=bind-check
  endef

And uncomment the "PROVIDES" line, "make menuconfig" suddenly complains
about recursive dependencies in bind-tools which depends on bind-check.
The funny thing is that bind-tools also depends on bind-delv, which
didn't cause any problems, using the exact same kind of CONFLICTS and
PROVIDES combo. (I get similar errors if I change any other package which
is depended upon by other tools, e.g. atlas-sw-probe-rpc depends on
bind-dig).

Before making the change to bind-check, tmp/.config-package.in looks like
this for bind-tools:

  ...
  default y if DEFAULT_bind-tools
  default m if ALL
  depends on !(BIND_JEMALLOC) || ((mips||mipsel||...
  depends on !arc
  select PACKAGE_bind-check
  select PACKAGE_bind-ddns-confgen if PACKAGE_bind-ddns-confgen-gssapi<PACKAGE_bind-tool
  select PACKAGE_bind-delv if PACKAGE_bind-delv-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-dig
  select PACKAGE_bind-dnssec if PACKAGE_bind-dnssec-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-host if PACKAGE_bind-host-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-nslookup if PACKAGE_bind-nslookup-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-rndc if PACKAGE_bind-rndc-gssapi<PACKAGE_bind-tools
  select PACKAGE_libc

Which seems ok. After changing the PROVIDES for bind-check, it suddenly turns
into this (I've found one case where someone encountered something similar [4]):

  ...
  default y if DEFAULT_bind-tools
  default m if ALL
  depends on !(BIND_JEMALLOC) || ((mips||mipsel||...
  depends on !(PACKAGE_bind-check-gssapi<PACKAGE_bind-tools && BIND_JEMALLOC) || ((mips||...
  depends on !(PACKAGE_bind-check-gssapi<PACKAGE_bind-tools) || !arc
  depends on !(PACKAGE_bind-delv-gssapi<PACKAGE_bind-tools && BIND_JEMALLOC) || ((mips||...
  depends on !(PACKAGE_bind-delv-gssapi<PACKAGE_bind-tools) || !arc
  depends on !arc
  select PACKAGE_bind-check if PACKAGE_bind-check-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-ddns-confgen if PACKAGE_bind-ddns-confgen-gssapi<PACKAGE_bind-tool
  select PACKAGE_bind-delv if PACKAGE_bind-delv-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-dig
  select PACKAGE_bind-dnssec if PACKAGE_bind-dnssec-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-host if PACKAGE_bind-host-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-nslookup if PACKAGE_bind-nslookup-gssapi<PACKAGE_bind-tools
  select PACKAGE_bind-rndc if PACKAGE_bind-rndc-gssapi<PACKAGE_bind-tools
  select PACKAGE_libc

Which upsets Kconfig:

  tmp/.config-package.in:98740:error: recursive dependency detected!
  tmp/.config-package.in:98740:	symbol PACKAGE_bind-tools depends on PACKAGE_bind-tools

I could, in theory, remove bind-tools (it's just a metapackage), but the same
thing happens with other packages which depend on one of the various bind packages.

I know that both tmp/.config-package.in and tmp/.packageauxvars are created by
scripts/package-metadata.pl, but my perl-skills are not sufficient to try to figure
out exactly what is going on.

Ideas?

//David


[1] https://forum.openwrt.org/t/need-help-debugging-kconfig-recursive-dependencies/240617
[2] https://github.com/Alphix/packages/commits/bind-gssapi-variant/
[3] https://github.com/Alphix/packages/blob/bind-gssapi-variant/net/bind/Makefile
[4] https://github.com/openwrt/openwrt/pull/9648#issuecomment-1089272097



More information about the openwrt-devel mailing list