-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Stack overflow on circular dependency #9073
Labels
C-bug
Category: bug
Comments
Thanks for the report! This is a bug in the implementation we have that checks for cycles from the resolver -- cargo/src/cargo/core/resolver/mod.rs Lines 1003 to 1064 in a73e5b7
I'll take a look at how we can fix our cycle detection. |
bors
added a commit
that referenced
this issue
Jan 18, 2021
Fix a bug in Cargo's cyclic dep graph detection Cargo's cyclic dependency graph detection turns out to have had a bug for quite a long time as surfaced by #9073. The bug in Cargo has to do with how dev-dependencies are handled. Cycles are "allowed" through dev-dependencies because the dev-dependency can depend on the original crate. Our cyclic graph detection, however, was too eagerly flagging a package as known to not have a cycle before we had processed everything about it. The fix here was basically to just simplify the graph traversal. Instead of traversing the raw `Resolve` this instead creates an alternate in-memory graph which has the actual edges we care about for cycle detection (e.g. every edge that wasn't induced via a dev-dependency). With this simplified graph we then apply the exact same algorithm, but this time it should be less buggy because we're not trying to do funky things about switching sets about what's visited halfway through a traversal. Closes #9073
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
cargo check --release
crashes with stack overflow.Steps
git clone https://github.com/thibault-martinez/bee.git
cd bee/
git checkout cargo-stack-overflow
cargo check --release
Notes
cargo 1.49.0 (d00d64df9 2020-12-05)
There is a circular dependency
bee-tangle
->bee-snapshot
->bee-ledger
->bee-tangle
.The text was updated successfully, but these errors were encountered: