-
Before opening an issue I wanted to make sure it is not intended. The Kconifg scripts per default checks for circular dependencies and throws errors both for "depends on"-circles and "selects"-circles. However, it does not throw errors in a "depends on"-"select"-circle. I think an example illustrates this a bit better: Given the following kconfig:
When we try to parse this object using the Kconfig class from kconfiglib.py, we get a Dependency Loop error. The same would happen if we replace both "depends on" with "selects". However, when we only replace one depends on with selects, as such:
we can create a Kconfig object without any parsing errors, despite having a circular dependency. As a fun exercise I checked the base Kconfig from zephyr for such loops and there exist a bunch of them. Now I'm wondering if this is intended or not? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The answer lies in the difference between depends on and select I think?
There's no cycle, as you can see. For your specific case, this would be the same as:
Note that mixing depends on and select can lead to subtle Kconfig bug. This is explained in the Zephyr's doc on Kconfig here, and has to do with the regardless the dependencies part when using select. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your explanations, I see your point. AFAICS, the behavior is a consequence of the design decision for select (selected symbol is enabled regardless to the dependency). If
Then you get your dependency loop detection. I agree that this answer may not be satisfactory 😆 Coming back at your original example. Another way to look at it:
Could you give a concrete example that we could investigate in more details perhaps? |
Beta Was this translation helpful? Give feedback.
From what I can see, the loop detection is needed as part of the recursive descent through the dependency tree. Quoting @ulfalizer from this thread:
This keeps the solver simple, at the expense of a more complex Kconfig trees maintenance.