From: Nicolas Schier <nicolas@fjasle.eu>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Sakari Ailus <sakari.ailus@iki.fi>,
Javier Martinez Canillas <javierm@redhat.com>,
Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation: kbuild: explain handling optional dependencies
Date: Wed, 13 Sep 2023 21:48:42 +0200 [thread overview]
Message-ID: <ZQISGujwlH00B8KJ@fjasle.eu> (raw)
In-Reply-To: <20230913113801.1901152-1-arnd@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2216 bytes --]
On Wed, Sep 13, 2023 at 01:37:52PM +0200 Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This problem frequently comes up in randconfig testing, with
> drivers failing to link because of a dependency on an optional
> feature.
>
> The Kconfig language for this is very confusing, so try to
> document it in "Kconfig hints" section.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Hi Arnd,
thanks for documenting this! Three questions below:
> Documentation/kbuild/kconfig-language.rst | 26 +++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
> index 858ed5d80defe..89dea587a469a 100644
> --- a/Documentation/kbuild/kconfig-language.rst
> +++ b/Documentation/kbuild/kconfig-language.rst
> @@ -573,6 +573,32 @@ above, leading to:
> bool "Support for foo hardware"
> depends on ARCH_FOO_VENDOR || COMPILE_TEST
>
> +Optional dependencies
> +~~~~~~~~~~~~~~~~~~~~~
> +
> +Some drivers are able to optionally use a feature from another module
> +or build cleanly with that module disabled, but cause a link failure
> +when trying to use that loadable module from a built-in driver.
> +
> +The most common way to express this optional dependency in Kconfig logic
> +uses the slighly counterintuitive
slighly -> slightly
For better RST compliance: could you explicitly start the code block e.g. by
appending '::' as in "... counterintuitive::"?
> +
> + config FOO
> + bool "Support for foo hardware"
> + depends on BAR || !BAR
are you sure that this is enough? While testing, I needed to explicitly use
=y|=n:
depends on BAR=y || BAR=n
to prevent FOO to be selectable iff BAR=m.
> +
> +This means that there is either a dependency on BAR that disallows
> +the combination of FOO=y with BAR=m, or BAR is completely disabled.
For me, this sentence is hard to parse (but I am not a native speaker); what
about something like this:
This means that FOO can only be enabled, iff BAR is either built-in or
completely disabled. If BAR is built as a module, FOO cannot be enabled.
Kind regards,
Nicolas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-09-13 19:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 11:37 [PATCH] Documentation: kbuild: explain handling optional dependencies Arnd Bergmann
2023-09-13 14:25 ` Javier Martinez Canillas
2023-09-13 16:11 ` Sakari Ailus
2023-09-13 19:48 ` Nicolas Schier [this message]
2023-09-13 19:55 ` Arnd Bergmann
2023-09-13 20:34 ` Nicolas Schier
2023-09-13 21:16 ` Arnd Bergmann
2023-09-14 3:51 ` Nicolas Schier
2023-09-14 5:05 ` Arnd Bergmann
2023-09-14 3:56 ` Javier Martinez Canillas
2023-09-14 17:07 ` Masahiro Yamada
2023-09-14 13:42 ` Jani Nikula
2023-09-14 14:57 ` Arnd Bergmann
2023-09-14 15:56 ` Jani Nikula
2023-09-14 17:23 ` Masahiro Yamada
2023-09-15 5:26 ` Arnd Bergmann
2023-09-15 7:34 ` Jani Nikula
2023-09-15 7:44 ` Arnd Bergmann
2023-09-15 15:48 ` Randy Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZQISGujwlH00B8KJ@fjasle.eu \
--to=nicolas@fjasle.eu \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=corbet@lwn.net \
--cc=javierm@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=sakari.ailus@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.