Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e358dbf

Browse files
committedOct 2, 2024··
wip
1 parent 4056ef8 commit e358dbf

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
 

‎compiler-core/src/dependency.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ mod tests {
488488

489489
#[test]
490490
fn resolution_error_message() {
491-
let result = resolve_versions(
491+
let _ = resolve_versions(
492492
interesting_remote(),
493493
HashMap::new(),
494494
"app".into(),

‎compiler-core/src/error.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use heck::{ToSnakeCase, ToTitleCase, ToUpperCamelCase};
1212
use hexpm::version::ResolutionError;
1313
use itertools::Itertools;
1414
use pubgrub::package::Package;
15+
use pubgrub::range::Range;
1516
use pubgrub::report::{DerivationTree, Derived, External};
1617
use pubgrub::version::Version;
1718
use std::collections::HashSet;
@@ -409,6 +410,10 @@ fn derivation_tree_to_pretty_error_message(
409410
) -> String {
410411
derivation_tree.collapse_no_versions();
411412
let derivation_tree = simplify_error(derivation_tree);
413+
414+
// TODO))
415+
// This order is not deterministic, so sometimes it will default to the
416+
// original version even though it's almost the same!!
412417
match &derivation_tree {
413418
DerivationTree::Derived(Derived { cause1, cause2, .. }) => {
414419
match (cause1.as_ref(), cause2.as_ref()) {
@@ -440,14 +445,20 @@ fn derivation_tree_to_pretty_error_message(
440445
&& maybe_root_range == root_range
441446
&& maybe_dep == dep =>
442447
{
448+
// TODO))
449+
// The default look of ranges is confusing and we want to switch
450+
// to one more similar to Gleam's constraints.
451+
// However, at the moment there's no way of doing this:
452+
// https://github.com/pubgrub-rs/pubgrub/issues/258
453+
//
443454
wrap_format!(
444455
"Unable to find compatible versions for the version \
445-
constraints in your gleam.toml.
456+
constraints in your gleam.toml:
446457
447458
- `{root}` requires `{common}` to be `{common_range}`
448459
- and all versions of `{common}` in that range require `{dep}` to be `{dep_range_from_common}`
449460
- but `{root}` also requires `{dep}` to be `{dep_range_from_root}`
450-
- and there is no version of `{dep}` that satiesfies both constraints
461+
- and there is no version of `{dep}` that satisfies both constraints
451462
"
452463
)
453464
}

0 commit comments

Comments
 (0)
Please sign in to comment.