Skip to contentSkip to conversation

2.6.0-test5: serio config broken?

PATCH Norman Diamond 3 participants 5 messages Sep 13, 2003 – Sep 15, 2003

lore
Share & tools
lore
#0 lore raw

Although I can't keep up with the mailing list, I saw this from Adrian Bunk:

Quoted 13 lines · Tom Rini
Quoted 12 lines

Okay. The following Kconfig illustrates what I claim to be a bug. config A
bool "This is A"
select B
config B
bool "This is B"
# Or, depends C=y
depends C
config C
bool "This is C"

Quoted 7 lines
Quoted 7 lines

Running oldconfig will give:
This is A (A) [N/y] (NEW) y
This is C (C) [N/y] (NEW) n
And in .config:
CONFIG_A=y
CONFIG_B=y
# CONFIG_C is not set

This is a problem. Proposed solution follows later.

Quoted 4 lines
Quoted 4 lines

I claim that this should in fact be:
CONFIG_A=y
CONFIG_B=y
CONFIG_C=y

Even for this simple case, there are other possibilities. When we add human logic to the specified sequence of events then we can say that your interpretation is most likely what the user wanted, but in ordinary logic there are other possibilities such as n, n, n. Proposed solution follows.

Quoted 6 lines

The problem is that select ignores dependencies. Unfortunately, your proposal wouldn't work easily, consider e.g. config A
bool "This is A"
select B
config B

Quoted 8 lines

bool
depends C || D
config C
bool "This is C"
depends D=n
config D
bool "This is D"
Do you want C or D to be selected?

If neither is selected, then the problem is essentially the same as the one which Mr. Rini pointed out. And again there are other possible possibilities such as n, n, n, n.

Solution: Surely plain "make" could start by checking dependencies. Or maybe "make dep" could be reincarnated. If there is any inconsistency, then the Makefile could issue an error and refuse to start compiling.

This has the added benefit that if the human has some reason to edit the .config file by hand instead of using a make [...]config command, plain "make" will have a chance of catching editing errors.

This doesn't automate a solution as thoroughly as either of you were hoping for; it honestly admits that it can't read the human's mind :-)

#1 lore raw
Quoted 57 lines · Norman Diamond

Although I can't keep up with the mailing list, I saw this from Adrian Bunk:

Quoted 13 lines · Tom Rini
Quoted 12 lines

Okay. The following Kconfig illustrates what I claim to be a bug. config A
bool "This is A"
select B
config B
bool "This is B"
# Or, depends C=y
depends C
config C
bool "This is C"

Quoted 7 lines
Quoted 7 lines

Running oldconfig will give:
This is A (A) [N/y] (NEW) y
This is C (C) [N/y] (NEW) n
And in .config:
CONFIG_A=y
CONFIG_B=y
# CONFIG_C is not set

This is a problem. Proposed solution follows later.

Quoted 4 lines
Quoted 4 lines

I claim that this should in fact be:
CONFIG_A=y
CONFIG_B=y
CONFIG_C=y

Even for this simple case, there are other possibilities. When we add human logic to the specified sequence of events then we can say that your interpretation is most likely what the user wanted, but in ordinary logic there are other possibilities such as n, n, n. Proposed solution follows.

Quoted 6 lines

The problem is that select ignores dependencies. Unfortunately, your proposal wouldn't work easily, consider e.g. config A
bool "This is A"
select B
config B

Quoted 8 lines

bool
depends C || D
config C
bool "This is C"
depends D=n
config D
bool "This is D"
Do you want C or D to be selected?

If neither is selected, then the problem is essentially the same as the one which Mr. Rini pointed out. And again there are other possible possibilities such as n, n, n, n.

Solution: Surely plain "make" could start by checking dependencies. Or maybe "make dep" could be reincarnated. If there is any inconsistency, then the Makefile could issue an error and refuse to start compiling.

Quoted 6 lines

This has the added benefit that if the human has some reason to edit the .config file by hand instead of using a make [...]config command, plain "make" will have a chance of catching editing errors.

This doesn't automate a solution as thoroughly as either of you were hoping for; it honestly admits that it can't read the human's mind :-)

Yes, even that would work quite nicely, perhaps while saying what the specific problem is as well. Roman, how hard would this be to do?

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#2 lore raw

Hi,

Quoted 12 lines · Tom Rini
Quoted 12 lines

If neither is selected, then the problem is essentially the same as the one which Mr. Rini pointed out. And again there are other possible possibilities such as n, n, n, n.

Solution: Surely plain "make" could start by checking dependencies. Or maybe "make dep" could be reincarnated. If there is any inconsistency, then the Makefile could issue an error and refuse to start compiling.

This has the added benefit that if the human has some reason to edit the .config file by hand instead of using a make [...]config command, plain "make" will have a chance of catching editing errors.

Quoted 5 lines
Quoted 2 lines

This doesn't automate a solution as thoroughly as either of you were hoping for; it honestly admits that it can't read the human's mind :-)

Yes, even that would work quite nicely, perhaps while saying what the specific problem is as well. Roman, how hard would this be to do?

The check happens already and it will ask for any missing option. You have to define what "inconsistency" means, right now the kconfig design makes ambigous configurations impossible (provided that there are no recursive dependencies, which kconfig warns about). I have no plans to give up this property, as it keeps kconfig reasonably simple, it's already complex enough as is.

bye, Roman

#3 lore raw
Quoted 22 lines · Roman Zippel

Hi,

Quoted 12 lines · Tom Rini
Quoted 12 lines

If neither is selected, then the problem is essentially the same as the one which Mr. Rini pointed out. And again there are other possible possibilities such as n, n, n, n.

Solution: Surely plain "make" could start by checking dependencies. Or maybe "make dep" could be reincarnated. If there is any inconsistency, then the Makefile could issue an error and refuse to start compiling.

This has the added benefit that if the human has some reason to edit the .config file by hand instead of using a make [...]config command, plain "make" will have a chance of catching editing errors.

Quoted 5 lines
Quoted 2 lines

This doesn't automate a solution as thoroughly as either of you were hoping for; it honestly admits that it can't read the human's mind :-)

Yes, even that would work quite nicely, perhaps while saying what the specific problem is as well. Roman, how hard would this be to do?

Quoted 6 lines

The check happens already and it will ask for any missing option. You have to define what "inconsistency" means, right now the kconfig design makes ambigous configurations impossible (provided that there are no recursive dependencies, which kconfig warns about). I have no plans to give up this property, as it keeps kconfig reasonably simple, it's already complex enough as is.

So long as it doesn't involve 'select', it won't let you be inconsistent, yes. How exactly are items that come in from a select evaluated right now?

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#4 lore raw

Hi,

Quoted 8 lines · Tom Rini
Quoted 5 lines

You have to define what "inconsistency" means, right now the kconfig design makes ambigous configurations impossible (provided that there are no recursive dependencies, which kconfig warns about). I have no plans to give up this property, as it keeps kconfig reasonably simple, it's already complex enough as is.

So long as it doesn't involve 'select', it won't let you be inconsistent, yes.

No, this is even true with the current select.

Quoted 2 lines

How exactly are items that come in from a select
evaluated right now?

'select' adds a reverse dependency to the selected option, e.g.

config FOO
select BAR if BAZ

BAR has now a reverse dependency of "FOO && BAZ" and the value of BAR is calculated as "(user value && visibility) || reverse dependency" (visibility is the dependencies of all BAR prompts). The details are in symbol.c:sym_calc_value().
This allows to calculate the configuration in a single pass and as a side effect avoids inconsistencies.

bye, Roman