Git Product home page Git Product logo

Comments (4)

ulfalizer avatar ulfalizer commented on August 17, 2024

Hello,

referenced isn't transitive. It only includes "direct" references.

The reason dependencies from surrounding ifs and menus count as direct references has to do with dependency propagation. Basically, if FOO is just a shorthand for adding depends on FOO to each item within the if, and a depends on on a menu also gets propagated to all the items in it.

These two ways of defining two symbols A and B are equivalent:

With if:

if B

config A
	bool

endif

if C

config B
	bool

endif

With depends on:

config A
	bool
	depends on B

config B
	bool
	depends on C

In both cases, A ends with just B in referenced, and B ends up with just C.

To get transitive references, you'll have to calculate the transitive closure (I think that's the term...), recursively expanding the .referenced until no new symbols appear.

If you're only interested in the direct dependencies of a symbol (its depends on, possibly inherited), have a look at Symbol.direct_dep btw. You can extract all the symbols in it with the global expr_items() function.

from kconfiglib.

xairy avatar xairy commented on August 17, 2024

Ah, OK, I see. Maybe it makes sense to mention this in the documentation? The word inherited seems confusing to me here. Thanks!

from kconfiglib.

ulfalizer avatar ulfalizer commented on August 17, 2024

Clarified the docstring and added some more details in 814e2de. Does it look okay?

from kconfiglib.

xairy avatar xairy commented on August 17, 2024

Looks good, thanks you!

from kconfiglib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.