New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular dependencies may cause extraneous packages to get pulled into build #233
Comments
ccollins476ad
added a commit
to ccollins476ad/mynewt-newt
that referenced
this issue
Nov 7, 2018
This fixes apache#233. Detect orphan packages as follows: starting from each seed package, recursively traverse the package's dependency list, keeping track of which packages were visited. After the traversal is complete, any non-visited package in the resolver are orphans and can be removed.
ccollins476ad
added a commit
to ccollins476ad/mynewt-newt
that referenced
this issue
Nov 7, 2018
This fixes apache#233. Detect orphan packages as follows: starting from each seed package, recursively traverse the package's dependency list, keeping track of which packages were visited. After the traversal is complete, any non-visited package in the resolver are orphans and can be removed.
ccollins476ad
added a commit
to ccollins476ad/mynewt-newt
that referenced
this issue
Nov 8, 2018
This fixes apache#233. Detect orphan packages as follows: starting from each seed package, recursively traverse the package's dependency list, keeping track of which packages were visited. After the traversal is complete, any non-visited package in the resolver are orphans and can be removed.
ccollins476ad
added a commit
that referenced
this issue
Nov 14, 2018
This fixes #233. Detect orphan packages as follows: starting from each seed package, recursively traverse the package's dependency list, keeping track of which packages were visited. After the traversal is complete, any non-visited package in the resolver are orphans and can be removed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
During dependency resolution, newt adds packages to the builds as dependencies are discovered. Less commonly, newt also removes packages from the build when a dependency is nullified. When a syscfg setting's value changes, dependencies conditional on the setting may be nullified. For example:
Package A
Target
Initially, the
FOO
setting is unknown, so it defaults to 0. When package A is being processed, the conditional dependency on package B is considered valid, and B is added to the build. When the target is processed, it is discovered thatFOO
is actually 1, so A's dependency on B is nullified, and B must be removed from the build (assuming no other packages depend on B).Newt handles the above case without issue. The issue is illustrated below:
Package B
Package C
B and C depend on each other. When B is initially pulled into the build, this also pulls in C, since B depends on C. When B is later removed from the build, C should also get removed (again, assuming no other packages depend on C).
The bug is: in this example, neither B nor C actually gets removed from the build. Newt uses references counting to determine when a package can be removed. When a package is found to have no dependents (a reference count of 0), newt removes it. Due to the circular dependency between B and C, neither package's reference count ever reaches 0.
The text was updated successfully, but these errors were encountered: