All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: document recursive dependency limitation / resolution
@ 2015-07-29 20:09 Luis R. Rodriguez
  2015-07-29 20:34 ` Randy Dunlap
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Luis R. Rodriguez @ 2015-07-29 20:09 UTC (permalink / raw)
  To: mmarek
  Cc: josh, jbottomley, geert, pebolle, herbert, tiwai,
	yann.morin.1998, corbet, linux-kbuild, linux-doc, linux-kernel,
	roberto, zack, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@suse.com>

Recursive dependency issues with kconfig are unavoidable due to
some limitations with kconfig, since these issues are recurring
provide a hint to the user how they can resolve these dependency
issues and also document why such limitation exists.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: James Bottomley <jbottomley@odin.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Michal Marek <mmarek@suse.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---

I've cc'd Roberto and Stefano as I think we might be able to in the
long term use some of their work on package dependency and solvers for
this problem [0] [1] [2]. This last part -- just consider it long term
focused.

[0] https://upsilon.cc/~zack/research/publications/splc2010-fd-deps.pdf
[1] https://ocaml.org/meetings/ocaml/2014/preferences-2014-09-05-slides.pdf
[2] https://www.youtube.com/watch?v=GSOcRQvZg8w

 Documentation/kbuild/kconfig-language.txt | 22 ++++++++++++++++++++++
 scripts/kconfig/symbol.c                  |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index 350f733bf2c7..7e0510d1cef7 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -393,3 +393,25 @@ config FOO
 	depends on BAR && m
 
 limits FOO to module (=m) or disabled (=n).
+
+Kconfig recursive dependency limitations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you've hit the Kconfig error: "recursive dependency detected" you've run
+into a recursive dependency issue with Kconfig. Kconfig does not do recursive
+dependency resolution, this has a few implications for Kconfig file writers. In
+practice it means that for instance if a driver A selects a few kconfig symbols
+another driver B which selects any of these symbols cannot negate any of the
+symbols the driver A selected.  Because of this current limitation developers
+who run into this type of recursive dependency issue have two diverging
+options:
+
+  a) Either swap all "select FOO" to "depends on FOO" or,
+  b) Change the offending "depends on FOO" to "select FOO"
+
+Kconfig's limitations can be addressed by implementing a SAT solver for it,
+but until then, Kconfig is limitted to require developers to use one of
+the above two mechanisms to address recursive dependency issues. For more
+details you can refer to this thread and discussion:
+
+http://lkml.kernel.org/r/1432241149-8762-1-git-send-email-mcgrof@do-not-panic.com
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 70c5ee189dce..4d61b7490dad 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -1117,6 +1117,8 @@ static void sym_check_print_recursive(struct symbol *last_sym)
 		if (stack->sym == last_sym)
 			fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
 				prop->file->name, prop->lineno);
+			fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
+			fprintf(stderr, "section \"Kconfig recursive dependency limitations\"\n");
 		if (stack->expr) {
 			fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
 				prop->file->name, prop->lineno,
-- 
2.3.2.209.gd67f9d5.dirty


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-10-08 13:37 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 20:09 [PATCH] kbuild: document recursive dependency limitation / resolution Luis R. Rodriguez
2015-07-29 20:34 ` Randy Dunlap
2015-08-04 11:57   ` Michal Marek
2015-08-04 12:05     ` Paul Bolle
2015-09-23 15:50     ` Luis R. Rodriguez
2015-09-23 15:48   ` Luis R. Rodriguez
2015-07-29 20:54 ` josh
2015-09-23 15:46   ` Luis R. Rodriguez
2015-08-05 11:57 ` Paul Bolle
2015-08-10 18:57   ` Luis R. Rodriguez
2015-09-03 11:56     ` Paul Bolle
2015-09-08 13:12       ` Luis R. Rodriguez
2015-09-23 15:53       ` Luis R. Rodriguez
2015-09-23 16:41 ` [PATCH v3] " Luis R. Rodriguez
2015-10-04 13:42   ` Valentin Rothberg
2015-10-05 23:03     ` Luis R. Rodriguez
2015-10-06  8:19       ` Valentin Rothberg
2015-10-06  8:32         ` Paul Bolle
2015-10-06  9:22           ` Valentin Rothberg
2015-10-07 23:08             ` Luis R. Rodriguez
2015-10-06  9:16       ` Paul Bolle
2015-10-07 23:16 ` [PATCH v4] " Luis R. Rodriguez
2015-10-08 13:37   ` Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.