xref: /linux/Documentation/kbuild/Kconfig.select-break (revision 9938b04472d5c59f8bd8152a548533a8599596a2)
1*1c199f28SLuis R. Rodriguez# Select broken dependency issue
2*1c199f28SLuis R. Rodriguez# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3*1c199f28SLuis R. Rodriguez#
4*1c199f28SLuis R. Rodriguez# Test with:
5*1c199f28SLuis R. Rodriguez#
6*1c199f28SLuis R. Rodriguez# make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.select-break menuconfig
7*1c199f28SLuis R. Rodriguez#
8*1c199f28SLuis R. Rodriguez# kconfig will not complain and enable this layout for configuration. This is
9*1c199f28SLuis R. Rodriguez# currently a feature of kconfig, given select was designed to be heavy handed.
10*1c199f28SLuis R. Rodriguez# Kconfig currently does not check the list of symbols listed on a symbol's
11*1c199f28SLuis R. Rodriguez# "select" list, this is done on purpose to help load a set of known required
12*1c199f28SLuis R. Rodriguez# symbols. Because of this use of select should be used with caution. An
13*1c199f28SLuis R. Rodriguez# example of this issue is below.
14*1c199f28SLuis R. Rodriguez#
15*1c199f28SLuis R. Rodriguez# The option B and C are clearly contradicting with respect to A.
16*1c199f28SLuis R. Rodriguez# However, when A is set, C can be set as well because Kconfig does not
17*1c199f28SLuis R. Rodriguez# visit the dependencies of the select target (in this case B).  And since
18*1c199f28SLuis R. Rodriguez# Kconfig does not visit the dependencies, it breaks the dependencies of B
19*1c199f28SLuis R. Rodriguez# (!A).
20*1c199f28SLuis R. Rodriguez
21*1c199f28SLuis R. Rodriguezmainmenu "Simple example to demo kconfig select broken dependency issue"
22*1c199f28SLuis R. Rodriguez
23*1c199f28SLuis R. Rodriguezconfig A
24*1c199f28SLuis R. Rodriguez	bool "CONFIG A"
25*1c199f28SLuis R. Rodriguez
26*1c199f28SLuis R. Rodriguezconfig B
27*1c199f28SLuis R. Rodriguez	bool "CONFIG B"
28*1c199f28SLuis R. Rodriguez	depends on !A
29*1c199f28SLuis R. Rodriguez
30*1c199f28SLuis R. Rodriguezconfig C
31*1c199f28SLuis R. Rodriguez	bool "CONFIG C"
32*1c199f28SLuis R. Rodriguez	depends on A
33*1c199f28SLuis R. Rodriguez	select B
34