public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Graham Roff <grahamr@qti.qualcomm.com>,
	Nicolas Schier <nsc@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Nicolas Pitre <nico@fluxnic.net>
Subject: Re: [PATCH v2] Support conditional deps using "depends on X if Y"
Date: Fri, 5 Dec 2025 11:23:34 -0700	[thread overview]
Message-ID: <20251205182334.GB3974306@ax162> (raw)
In-Reply-To: <b4be7637-9446-47d0-9a8c-3fd0f55a27b9@app.fastmail.com>

On Fri, Dec 05, 2025 at 09:01:51AM +0100, Arnd Bergmann wrote:
> Agreed, the question is whether a small improvement in
> readability is worth the complexity of having multiple
> ways of expressing the same thing.

I think the biggest thing that this patch has going for this is that
there is minimal additional complexity within scripts/kconfig and that
it basically internally converts the 'depends on ... if ...' into the
simple 'depends on' so there is no behavioral difference. The diff stat
of the core of the change speaks to that I think.

 scripts/kconfig/lkc.h    |  2 +-
 scripts/kconfig/menu.c   | 12 +++++++++++-
 scripts/kconfig/parser.y |  6 +++---
 3 files changed, 15 insertions(+), 5 deletions(-)

> I don't see anything that the new syntax would allow
> that we were currently missing.

I see this as syntactic sugar. It is just giving users a different (and
possibly more intuitive) way of expressing the same thing but I
understand being concerned about people misusing it (even though I think
it is already hard enough to get dependencies right sometimes).

> This is the bit that frequently confuses developers with the
> current syntax, and I agree it would be nice to have a better
> way,  but I'm not sure the proposal actually helps enough to
> warrant a mass-conversion of existing Kconfig files.

I do agree that the 'depends on A || !A' syntax is confusing and that
this does not really address that but I think that is besides the point
here. I also agree that it is probably not worth converting existing
users to this syntax (unless there is solid reasoning), I would not want
to see cleanup patches of that nature, just use in new code.

> With the existing syntax, this could be expressed as
> 
>       depends on FOO = BAR
> 
> or
> 
>       depends on (FOO && BAR) || (!FOO && !BAR)
> 
> and I don't see how the new syntax is an improvement
> over these.

Maybe the "if" syntax could be easier to understand with actual real
world values? I cannot think of anything off the top of my head but
real world dependencies might read a bit more naturally with this
syntax.

> Overall, I'm not convinced by this patch. I have no strong
> objection to anything in here, but I'm worried that extending
> the syntax adds more problems than this one solves.

Thanks a lot for the input!

Cheers,
Nathan

  parent reply	other threads:[~2025-12-05 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18 18:46 [PATCH v2] Support conditional deps using "depends on X if Y" Graham Roff
2025-12-05  1:53 ` Nathan Chancellor
2025-12-05  8:01   ` Arnd Bergmann
2025-12-05 16:14     ` Nicolas Pitre
2025-12-05 18:23     ` Nathan Chancellor [this message]
2025-12-09 22:45       ` Graham Roff
2025-12-10 15:07       ` Jani Nikula
2025-12-13  1:40         ` Nathan Chancellor
2025-12-05  9:06 ` Jani Nikula

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=20251205182334.GB3974306@ax162 \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=grahamr@qti.qualcomm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=nsc@kernel.org \
    /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