Re: [RFC v1] tree-wide: remove "select FW_LOADER" uses

Josh Triplett
2015-05-25T19:07:10Z

On Mon, May 25, 2015 at 08:25:35PM +0200, Paul Bolle wrote:
> On Mon, 2015-05-25 at 10:54 -0700, Josh Triplett wrote:
> > I don't mean cyclic dependencies (for which Kconfig should just report
> > an error, ideally including the full list of symbols forming the cycle).
> >
> > I mean that Kconfig should do recursive dependency resolution.
>
> (My English might be letting me down here. Or my grasp of elementary
> logic, for that matter. Recursive and cyclic are not really
> interchangeable? Should Kconfig perhaps report a "Cyclic dependency
> error"? )

I do think that'd be a clearer message, yes.

For clarity: "recursive dependency resolution" as in "recursive
resolution of dependencies", not "resolution of recursive dependencies".

> > If B
> > depends on A, and C depends on B, I should be able to turn on C
> > directly and have B and A enabled.
>
> And how should kconfig handle, say:
> - B depends on (A || D)
> - C depends on B
>
> Should (B && D) be enabled or (B && A)? This is not meant as a
> rhetorical question. But I do fear the complications for the choices
> this idea might encounter are, at best, not worth the effort.

That's exactly the kind of problem that makes this difficult to do, and
has thus stopped anyone from working on it. A fully general solution
requires a system that can also solve arbitrary logic problems, which is
not necessarily a feature.

The typical choice made by package management systems is to enable B and
A, preferring the leftmost dependency of B. That's what Debian's apt
does, in the absence of conflicts.

For an initial solution, I'd suggest just recursing through "select"
dependencies; if C has "select B", and B has "select A", enabling C
should enable B and A. Since you can't "select A || D", that seems
straightforward enough. You can "select A if X", but for that, just
bail out if the value of the expression X is changed by any of the
select statements.

> > As an intermediate measure, it'd be *really* handy to be able to browse
> > in the curses UI directly from a symbol to the symbols it depends on to
> > quickly enable/disable them, rather than having to look at the list of
> > dependencies of a symbol, search for that symbol, remember the path the
> > search showed, and browse there manually.
>
> Probably. I'd rather not think about the UI involved when the symbol(s)
> that should be enabled is (are) two or more levels down the chain. And
> the odd "stacked" UI for searches in the curses tool adds to the fun.
> But then again, I'm a the-glass-is-half-empty person.

I'm more thinking that if you're looking at an option, you should be
able to hit a key to see all the symbols that option depends on in a
list, then navigate to one of those symbols, and be taken to the menu
containing that symbol with the cursor on that symbol. (You could then
hit a key to go "back" to where you were.) It's not perfect, but it's
an improvement.

I'd also suggest that the search mechanism should produce a list that
can be browsed with the arrow keys, with enter taking you to the symbol.

- Josh Triplett