@@ -12,6 +12,7 @@ use heck::{ToSnakeCase, ToTitleCase, ToUpperCamelCase};
12
12
use hexpm:: version:: ResolutionError ;
13
13
use itertools:: Itertools ;
14
14
use pubgrub:: package:: Package ;
15
+ use pubgrub:: range:: Range ;
15
16
use pubgrub:: report:: { DerivationTree , Derived , External } ;
16
17
use pubgrub:: version:: Version ;
17
18
use std:: collections:: HashSet ;
@@ -409,6 +410,10 @@ fn derivation_tree_to_pretty_error_message(
409
410
) -> String {
410
411
derivation_tree. collapse_no_versions ( ) ;
411
412
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!!
412
417
match & derivation_tree {
413
418
DerivationTree :: Derived ( Derived { cause1, cause2, .. } ) => {
414
419
match ( cause1. as_ref ( ) , cause2. as_ref ( ) ) {
@@ -440,14 +445,20 @@ fn derivation_tree_to_pretty_error_message(
440
445
&& maybe_root_range == root_range
441
446
&& maybe_dep == dep =>
442
447
{
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
+ //
443
454
wrap_format ! (
444
455
"Unable to find compatible versions for the version \
445
- constraints in your gleam.toml.
456
+ constraints in your gleam.toml:
446
457
447
458
- `{root}` requires `{common}` to be `{common_range}`
448
459
- and all versions of `{common}` in that range require `{dep}` to be `{dep_range_from_common}`
449
460
- 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
451
462
"
452
463
)
453
464
}
0 commit comments