From: Jani Nikula <jani.nikula@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>, Masahiro Yamada <masahiroy@kernel.org>
Cc: Arnd Bergmann <arnd@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Sakari Ailus <sakari.ailus@iki.fi>,
Javier Martinez Canillas <javierm@redhat.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>,
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: Fri, 15 Sep 2023 10:34:12 +0300 [thread overview]
Message-ID: <87sf7fvqiz.fsf@intel.com> (raw)
In-Reply-To: <763b1599-06b7-490e-9cbf-eb07f1deedb3@app.fastmail.com>
On Fri, 15 Sep 2023, "Arnd Bergmann" <arnd@arndb.de> wrote:
> On Thu, Sep 14, 2023, at 19:23, Masahiro Yamada wrote:
>> On Thu, Sep 14, 2023 at 11:57 PM Arnd Bergmann <arnd@arndb.de> wrote:
>>> On Thu, Sep 14, 2023, at 15:42, Jani Nikula wrote:
>>
>> It is unclear why WIREGUARD must be entirely disabled
>> just because of the optional feature being modular.
>
> I don't think anyone is asking for that, and the current
> "depends on IPV6 || !IPV6" seems fine here, and is consistent
> with dozens of other symbols.
>
>> My preference is to use IS_REACHABLE(CONFIG_IPV6)
>> instead of IS_ENABLED(CONFIG_IPV6)
>> under drivers/net/wireguard, then
>> get rid of "depends on IPV6 || !IPV6)
>
> My feeling is that this would be significantly worse from a
> usability point of view even if it made it a little easier
> for maintainers:
>
> When a user selects both IPV6 and WIREGUARD, they expect
> to be able to use them together, and a normal user setting
> WIREGUARD=y would have a hard time figuring out why that
> leads it becoming IPv4-only.
I think IS_REACHABLE() is in most cases just plain wrong, and should
only be used as the last resort.
I think the kconfig should express what the dependencies are, and you
should get kconfig or build errors if you get it wrong, and not paper
over them with IS_REACHABLE().
Configuring the kernel is hard enough, and IS_REACHABLE() silences the
issues with no messages to the user at any point. If the user gets it
wrong, it just doesn't work like they expect, they have no clues why,
and they have to peruse the kernel source to figure it out. (Or, more
likely, file a bug and waste the kernel developer/maintainer time to get
the configuration right.)
IS_REACHABLE() considered harmful.
BR,
Jani.
>
>> If you want to make it clearer on the Kconfig level,
>> perhaps the following is also possible.
>>
>>
>> config WIREGUARD
>> tristate "WireGuard"
>>
>> config WIREGUARD_IPV6
>> def_bool y
>> depends on WIREGUARD
>> depends on IPV6 >= WIREGUARD
>>
>> config IPV6
>> tristate "IPV6"
>
> That has the same downside, with the added problem
> of also confusing kernel developers with the '>='
> Kconfig syntax, which IMHO makes no sense unless one
> knows way too much about Kconfig internals.
>
> Arnd
--
Jani Nikula, Intel
next prev parent reply other threads:[~2023-09-15 7:35 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
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 [this message]
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=87sf7fvqiz.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--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=nicolas@fjasle.eu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox