Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 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-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ indicatif = { workspace = true }
once_cell = { workspace = true }
rattler = { workspace = true, features = ["indicatif"] }
rattler_conda_types = { workspace = true, default-features = false }
rattler_networking = { workspace = true, default-features = false, features = ["gcs", "s3", "system-integration"] }
rattler_networking = { workspace = true, default-features = false, features = ["gcs", "s3", "system-integration", "netrc-rs"] }
rattler_repodata_gateway = { workspace = true, default-features = false, features = ["gateway"] }
rattler_solve = { workspace = true, default-features = false, features = ["resolvo", "libsolv_c"] }
rattler_virtual_packages = { workspace = true, default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions crates/rattler-bin/src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
if transaction.operations.is_empty() {
println!("No operations necessary");
} else {
print_transaction(&transaction, solver_result.features);
print_transaction(&transaction, solver_result.extras);
}

return Ok(());
Expand Down Expand Up @@ -326,7 +326,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
console::style(console::Emoji("✔", "")).green(),
install_start.elapsed()
);
print_transaction(&result.transaction, solver_result.features);
print_transaction(&result.transaction, solver_result.extras);
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_conda_types/src/repo_data_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ pub struct SolverResult {
/// The records that are part of the solution to the solver task.
pub records: Vec<RepoDataRecord>,
/// The features of the records that are part of the solution to the solver task.
pub features: HashMap<PackageName, Vec<String>>,
pub extras: HashMap<PackageName, Vec<String>>,
}
2 changes: 1 addition & 1 deletion crates/rattler_solve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ default = ["resolvo"]
libsolv_c = ["dep:rattler_libsolv_c", "dep:libc"]
resolvo_diagnostics = ["resolvo?/diagnostics"]
resolvo = ["dep:resolvo", "dep:futures"]
experimental_extras = []
experimental_extras = ["rattler_conda_types/experimental_extras"]

[[bench]]
name = "bench"
Expand Down
4 changes: 1 addition & 3 deletions crates/rattler_solve/benches/sorting_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ fn bench_sort(c: &mut Criterion, sparse_repo_data: &SparseRepoData, spec: &str)
)
.expect("failed to create dependency provider");

let name = dependency_provider
.pool
.intern_package_name(package_name.as_normalized());
let name = dependency_provider.pool.intern_package_name(&package_name);
let version_set = dependency_provider
.pool
.intern_version_set(name, match_spec.into_nameless().1.into());
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_solve/src/libsolv_c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl super::SolverImpl for Solver {

Ok(SolverResult {
records: required_records,
features: HashMap::new(),
extras: HashMap::new(),
})
}
}
Expand Down
47 changes: 25 additions & 22 deletions crates/rattler_solve/src/resolvo/conda_sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl<'a, 'repo> SolvableSorter<'a, 'repo> {
};

// Otherwise, select the variant with the highest version
match (self.strategy, a_record.version().cmp(b_record.version())) {
match (self.strategy, a_record.version().cmp(&b_record.version())) {
(CompareStrategy::Default, Ordering::Greater)
| (CompareStrategy::LowestVersion, Ordering::Less) => return Ordering::Less,
(CompareStrategy::Default, Ordering::Less)
Expand Down Expand Up @@ -359,29 +359,32 @@ pub(super) fn find_highest_version(

let pool = &solver.provider().pool;

candidates
let mut highest_version = None;
for record in candidates
.iter()
.map(|id| &pool.resolve_solvable(*id).record)
.fold(None, |init, record| {
Some(init.map_or_else(
|| {
(
record.version().clone(),
!record.track_features().is_empty(),
)
},
|(version, has_tracked_features)| {
if &version < record.version() {
(
record.version().clone(),
!record.track_features().is_empty(),
)
} else {
(version, has_tracked_features)
}
},
))
})
{
let (version, has_tracked_features) = match record {
SolverPackageRecord::Record(record) => (
record.package_record.version.version(),
!record.package_record.track_features.is_empty(),
),
SolverPackageRecord::VirtualPackage(record) => (&record.version, false),
SolverPackageRecord::Extra { .. } => continue,
};
highest_version = highest_version.map_or_else(
|| Some((version.clone(), has_tracked_features)),
|(highest_version, current_has_tracked_features)| {
if version > &highest_version {
Some((version.clone(), has_tracked_features))
} else {
Some((highest_version, current_has_tracked_features))
}
},
);
}

highest_version
})
.clone()
}
Loading
Loading