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 core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fluent-uri = { version = "0.4.1", features = ["serde"] }
indexmap = { version = "2.13.0", default-features = false, features = ["serde"] }
# icu_normalizer = { version = "2.0.0", default-features = false, features = ["compiled_data"] }
log = { version = "0.4.29", default-features = false }
pubgrub = { version = "0.3.0", default-features = false }
pubgrub = { version = "0.4.0", default-features = false }
# partialzip = { version = "5.0.0", default-features = false, optional = true }
pyo3 = { version = "0.28.2", default-features = false, features = ["macros", "chrono", "indexmap"], optional = true }
reqwest-middleware = { version = "0.5.1", features = ["multipart"] }
Expand Down
19 changes: 12 additions & 7 deletions core/src/solve/pubgrub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>

use fluent_uri::Iri;
use pubgrub::{DefaultStringReporter, DependencyProvider, Reporter, VersionSet};
use pubgrub::{
DefaultStringReporter, DependencyConstraints, DependencyProvider, Reporter, VersionSet,
};

use std::{
cell::RefCell,
Expand Down Expand Up @@ -283,7 +285,7 @@ fn compute_deps<R: ResolveRead + fmt::Debug>(
pubgrub::Dependencies<DependencyIdentifier, DiscreteHashSet, String>,
InternalSolverError<R>,
> {
let mut depmap: HashMap<DependencyIdentifier, DiscreteHashSet, _> = pubgrub::Map::default();
let mut deps: Vec<(DependencyIdentifier, DiscreteHashSet)> = Vec::new();

for usage in usages {
if let Some(constraint) = &usage.version_constraint {
Expand Down Expand Up @@ -315,10 +317,10 @@ fn compute_deps<R: ResolveRead + fmt::Debug>(
)));
}

depmap.insert(
deps.push((
DependencyIdentifier::Remote(usage.resource.clone()),
DiscreteHashSet::Finite(valid_candidates),
);
));
} else {
// Check that the project can be found
resolve_candidates(resolver, &usage.resource, cache)?;
Expand All @@ -329,14 +331,17 @@ fn compute_deps<R: ResolveRead + fmt::Debug>(
// Err(err) => return Ok(pubgrub::Dependencies::Unavailable(err.to_string())),
// };

depmap.insert(
deps.push((
DependencyIdentifier::Remote(usage.resource.clone()),
DiscreteHashSet::empty().complement(),
);
));
}
}

Ok(pubgrub::Dependencies::Available(depmap))
// TODO: replace this with `from(deps)` when https://github.com/pubgrub-rs/pubgrub/pull/423
// is merged and released
let constraints = DependencyConstraints::from_iter(deps);
Ok(pubgrub::Dependencies::Available(constraints))
}

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion sysand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spdx = "0.13.4"
fluent-uri = { version = "0.4.1", default-features = false }
typed-path = { version = "0.12.3", default-features = false }
url = { version = "2.5.8", default-features = false }
pubgrub = { version = "0.3.0", default-features = false }
pubgrub = { version = "0.4.0", default-features = false }
indexmap = "2.13.0"
tokio = { version = "1.50.0", default-features = false }
reqwest-middleware = { version = "0.5.1", features = ["multipart"] }
Expand Down
Loading