kbuild: fixing the select problem

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: James Bottomley
Date: Wednesday, May 5, 2010 - 2:49 pm

[Sam: I know you don't maintain kbuild anymore, but since you have the
most experience, if you could find time to comment, I'd be grateful]

The select problem is that the kbuild select directive will turn a
symbol on without reference to its dependencies.  This, in turn, means
that either selected symbols must select their dependencies, or that
people using select have to be aware of the selected symbol's dependency
and build those dependencies into their symbol (leading to duplication
and the possibility of getting the dependencies out of sync).  We use
select for the scsi transport classes, so we run into this problem in
SCSI quite a lot.

I think the correct fix is to make a symbol that selects another symbol
automatically inherit all of the selected symbol's dependencies.

There seems to be a fairly easy way to do this in kbuild.  Right at the
moment, select is handled as additional symbol values as the last point
in the symbol tree evaluation process.  Instead, what I propose doing is
for every select symbol, we add an extra unconditional default for the
selected symbol of the selecting symbol's current value (this breaks a
possible dependency cycle) and add to the dependencies of the selecting
symbol, the symbol it's currently selecting.

There's one wrinkle to all of this in that the current parser for
default values stops when it finds the first valid (i.e. whose if clause
evaluates to true) default.  To make the above scheme work, I need to
modify the default parser so it takes the highest tristate of all the
valid defaults (and bumps m to y for bool).

Does this look acceptable to people?  I think it should give the desired
result and has the added benefit that we can then strip the extra select
overlay out of the kbuild system (making the parser slightly simpler).

If this looks like a good idea to people, I think I can code up a quick
patch.

James



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kbuild: fixing the select problem, James Bottomley, (Wed May 5, 2:49 pm)
Re: kbuild: fixing the select problem, Geert Uytterhoeven, (Wed May 5, 11:47 pm)
Re: kbuild: fixing the select problem, James Bottomley, (Thu May 6, 6:17 am)
Re: kbuild: fixing the select problem, Geert Uytterhoeven, (Thu May 6, 6:36 am)
Re: kbuild: fixing the select problem, Michal Marek, (Thu May 6, 7:24 am)
Re: kbuild: fixing the select problem, James Bottomley, (Thu May 6, 7:52 am)
Re: kbuild: fixing the select problem, Valdis.Kletnieks, (Thu May 6, 9:47 am)
Re: kbuild: fixing the select problem, Vegard Nossum, (Thu May 6, 9:52 am)
Re: kbuild: fixing the select problem, Geert Uytterhoeven, (Thu May 6, 10:25 am)
Re: kbuild: fixing the select problem, James Bottomley, (Thu May 6, 1:48 pm)
Re: kbuild: fixing the select problem, Randy Dunlap, (Thu May 6, 1:59 pm)
Re: kbuild: fixing the select problem, James Bottomley, (Thu May 6, 2:05 pm)
Re: kbuild: fixing the select problem, Catalin Marinas, (Fri May 7, 4:31 am)