Skip to content

Commit

Permalink
bump: use latest resolvo
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Feb 8, 2024
1 parent b649089 commit 24e60fd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
40 changes: 29 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/rattler_installs_packages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tokio-util = { version = "0.7.9", features = ["compat"] }
tracing = { version = "0.1.37", default-features = false, features = ["attributes"] }
url = { version = "2.4.1", features = ["serde"] }
zip = "0.6.6"
resolvo = { version = "0.3.0", default-features = false }
resolvo = { version = "0.3.0", default-features = false, features = ["tokio"] }
pathdiff = "0.2.1"
async_zip = { version = "0.0.15", features = ["tokio", "deflate"] }
tar = "0.4.40"
Expand Down
28 changes: 11 additions & 17 deletions crates/rattler_installs_packages/src/resolve/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub struct ResolveOptions {
#[allow(clippy::too_many_arguments)]
pub async fn resolve(
package_db: Arc<PackageDb>,
requirements: impl IntoIterator<Item = &Requirement>,
requirements: impl IntoIterator<Item=&Requirement>,
env_markers: Arc<MarkerEnvironment>,
compatible_tags: Option<Arc<WheelTags>>,
locked_packages: HashMap<NormalizedPackageName, PinnedPackage>,
Expand All @@ -279,20 +279,20 @@ pub async fn resolve(
env_variables,
)
})
.await
.map_or_else(
|e| match e.try_into_panic() {
Ok(panic) => std::panic::resume_unwind(panic),
Err(_) => Err(miette::miette!("the operation was cancelled")),
},
identity,
)
.await
.map_or_else(
|e| match e.try_into_panic() {
Ok(panic) => std::panic::resume_unwind(panic),
Err(_) => Err(miette::miette!("the operation was cancelled")),
},
identity,
)
}

#[allow(clippy::too_many_arguments)]
fn resolve_inner<'r>(
package_db: Arc<PackageDb>,
requirements: impl IntoIterator<Item = &'r Requirement>,
requirements: impl IntoIterator<Item=&'r Requirement>,
env_markers: Arc<MarkerEnvironment>,
compatible_tags: Option<Arc<WheelTags>>,
locked_packages: HashMap<NormalizedPackageName, PinnedPackage>,
Expand Down Expand Up @@ -358,13 +358,7 @@ fn resolve_inner<'r>(
)?;

// Invoke the solver to get a solution to the requirements
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_time()
.enable_io()
.build()
.unwrap();

let mut solver = Solver::new(&provider, runtime);
let mut solver = Solver::new(&provider).with_runtime(tokio::runtime::Handle::current());
let solvables = match solver.solve(root_requirements) {
Ok(solvables) => solvables,
Err(e) => {
Expand Down

0 comments on commit 24e60fd

Please sign in to comment.