We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When importing in pubgrub the cargo test from https://github.com/rust-lang/cargo/blob/bf79c8b154fa6b3e4d781c26935429948cbd9b2b/crates/resolver-tests/tests/resolve.rs#L529, I get a stack overflow in the test when displaying the derivation tree:
#[test] fn resolving_with_constrained_cousins_backtrack() { const DEPTH: u32 = 100; const BRANCHING_FACTOR: u32 = 50; let mut dependency_provider = OfflineDependencyProvider::<String, Ranges<SemanticVersion>>::new(); let root_deps = [ ("backtrack_trap_v0_0".into(), Ranges::full()), ("cloaking".into(), Ranges::full()), ]; dependency_provider.add_dependencies("root".into(), (0, 0, 0), root_deps); dependency_provider.add_dependencies( "cloaking".into(), (0, 0, 0), [("constrained".into(), Ranges::between((1, 0, 0), (1, 1, 0)))], ); for v in 1..BRANCHING_FACTOR + 10 { dependency_provider.add_dependencies("constrained".into(), (1, 0, v), []); } dependency_provider.add_dependencies("constrained".into(), (1, 1, 0), []); for n in 0..DEPTH { for v in 1..BRANCHING_FACTOR { let v = (1, 0, v); dependency_provider.add_dependencies( format!("backtrack_trap_v0_{n}"), v, [(format!("backtrack_trap_v1_{n}"), Ranges::singleton(v))], ); dependency_provider.add_dependencies( format!("backtrack_trap_v1_{n}"), v, [(format!("backtrack_trap_v2_{n}"), Ranges::singleton(v))], ); dependency_provider.add_dependencies( format!("backtrack_trap_v2_{n}"), v, [(format!("backtrack_trap_v0_{}", n + 1), Ranges::full())], ); } } for v in 1..BRANCHING_FACTOR { let v = (1, 0, v); dependency_provider.add_dependencies( format!("backtrack_trap_v0_{DEPTH}"), v, [("constrained".into(), Ranges::between((1, 1, 0), (2, 0, 0)))], ); } let res = pubgrub::resolve(&dependency_provider, "root".into(), (0, 0, 0)); if let Err(PubGrubError::NoSolution(error)) = res { // Stack overflow here let _out = format!("{error:?}"); let _out = DefaultStringReporter::report(&error).to_string(); }; }
The text was updated successfully, but these errors were encountered:
A variation of the test also causes Pubgrub to consume 20+ GB of RAM when constructing the derivation tree (see https://github.com/x-hgg-x/pubgrub-bench/blob/a8591cd68f77a8396023b7abec2995d8fec1fb98/tests/tests/mod.rs#L411).
Sorry, something went wrong.
No branches or pull requests
When importing in pubgrub the cargo test from https://github.com/rust-lang/cargo/blob/bf79c8b154fa6b3e4d781c26935429948cbd9b2b/crates/resolver-tests/tests/resolve.rs#L529, I get a stack overflow in the test when displaying the derivation tree:
The text was updated successfully, but these errors were encountered: