Re: [PATCH v3] kconfig: Support conditional deps using "depends on X if Y"

Julian Braha <[email protected]> Sat, 4 Jul 2026 14:23:48 +0100
Newsgroups org.kernel.vger.linux-kbuild,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi all,

On 12/15/25 23:06, Graham Roff wrote:
> Previously such optional dependencies had to be expressed as
> the counterintuitive "depends on X || !X", now this can be
> represented as "depends on X if X".

I have always found both of these:
'depends on X || !X'
and:
'depends on X if X'

to be unintuitive and confusing to read.

Yes, I understand from the docs that the purpose is to disallow
FOO=Y with BAR=M, like in this example from the official kconfig docs:
```
config FOO
      tristate "Support for foo hardware"
      depends on BAR if BAR
```

However, in my testing, neither of these constructs are necessary to
achieve that.

A very standard 'depends on BAR' also disallows FOO=Y with BAR=M.

As I'm working on my SMT solver for Kconfig, I need help understanding
what else I'm missing about these two constructs.

Unless it's just more readable to you all than 'depends on X'?

- Julian Braha