{"id":29188637,"url":"https://github.com/mikedilger/solvent","last_synced_at":"2025-10-14T18:04:52.834Z","repository":{"id":20577291,"uuid":"23857791","full_name":"mikedilger/solvent","owner":"mikedilger","description":"Dependency Resolver written in rust","archived":false,"fork":false,"pushed_at":"2021-12-23T01:16:39.000Z","size":1197,"stargazers_count":38,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-01T22:45:44.543Z","etag":null,"topics":["dependency-resolver","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikedilger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-10T02:24:53.000Z","updated_at":"2025-05-26T12:40:19.000Z","dependencies_parsed_at":"2022-09-10T22:31:38.678Z","dependency_job_id":null,"html_url":"https://github.com/mikedilger/solvent","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/mikedilger/solvent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedilger%2Fsolvent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedilger%2Fsolvent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedilger%2Fsolvent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedilger%2Fsolvent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikedilger","download_url":"https://codeload.github.com/mikedilger/solvent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedilger%2Fsolvent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934262,"owners_count":23852092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-resolver","rust"],"created_at":"2025-07-01T22:36:27.545Z","updated_at":"2025-10-14T18:04:47.788Z","avatar_url":"https://github.com/mikedilger.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solvent\nSolvent is a dependency resolver library written in rust.\n\n[![Build Status](https://travis-ci.org/mikedilger/solvent.svg?branch=master)](https://travis-ci.org/mikedilger/solvent)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\nDocumentation is available at https://docs.rs/solvent\n\nSolvent helps you to resolve dependency orderings by building up a dependency graph and then\nresolving the dependences of some target node in an order such that each output depends only upon\nthe previous outputs.\n\nIt is currently quite simple, but is still useful.\n\nThe type of the nodes should be small (as you will pass them) and should implement Eq. References\nare good choices.\n\n## Example\n\n```rust\nextern crate solvent;\n\nuse solvent::DepGraph;\n\nfn main() {\n    // Create a new empty DepGraph.\n    let mut depgraph: DepGraph\u003c\u0026str\u003e = DepGraph::new();\n\n    // You can register a dependency like this.  Solvent will automatically create nodes for any\n    // term it has not seen before.  This means 'b' depends on 'd'\n    depgraph.register_dependency(\"b\",\"d\");\n\n    // You can also register multiple dependencies at once\n    depgraph.register_dependencies(\"a\",vec![\"b\",\"c\",\"d\"]);\n    depgraph.register_dependencies(\"c\",vec![\"e\"]);\n\n    // Iterate through each dependency of \"a\".  The dependencies will be returned in an order such\n    // that each output only depends on the previous outputs (or nothing).  The target itself will\n    // be output last.\n    for node in depgraph.dependencies_of(\u0026\"a\").unwrap() {\n        print!(\"{} \", node.unwrap());\n    }\n}\n```\n\nThe above will output:  `d b e c a` or `e c d b a` or some other valid dependency order.\n\nThe algorithm is not deterministic, and may give a different answer each time it is run.\n\nThe iterator dependencies_of() returns an `Option\u003cResult\u003cT, SolventError\u003e\u003e`.  The for loop\nhandles the `Option` part for you, but you may want to check the result for `SolventError`.  Once\nan error is returned, all subsequent calls to the iterator `next()` will yield `None`.\n\nYou can also mark some elements as already satisfied, and the iterator will take that into account:\n\n```ignore\ndepgraph.mark_as_satisfied([\"e\",\"c\"]).unwrap();\n```\n\nDependency cycles are detected and will return `SolventError::CycleDetected`.\n\n## Use Cases\nThese kinds of calculations are useful in the following example situations:\n* System package management: packages depending on other packages\n* Build systems such as 'make' or 'cargo' to handle dependencies (note: neither cargo nor rustc use\n  solvent)\n* Complex software configurations such as Linux kernel configurations\n* Database schema upgrades which don't need to be strictly sequential (e.g. multiple developers\n  working on separate git branches being able to commit database schema upgrades independently,\n  without merge conflicts) -- the author wrote solvent for this purpose.\n\nThis crate is NOT a SAT solver, it is much simpler.\n\n## Other Details\nSolvent does not yet handle boolean logic.  See issue [#1]\n(https://github.com/mikedilger/solvent/issues/1).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikedilger%2Fsolvent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikedilger%2Fsolvent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikedilger%2Fsolvent/lists"}