fix: deterministic resolving order

This commit is contained in:
mircearoata 2023-06-12 11:47:04 +02:00
parent 815c8a3c57
commit 7f3e6382c1
2 changed files with 5 additions and 1 deletions

View file

@ -141,6 +141,10 @@ func (r *resolvingInstance) Step() error {
return errors.Wrap(err, "failed resolving mod dependencies")
}
sort.Slice(dependencies.Mods, func(i, j int) bool {
return dependencies.Mods[i].Mod_reference < dependencies.Mods[j].Mod_reference
})
for _, mod := range dependencies.Mods {
modVersions := make([]ModVersion, len(mod.Versions))
for i, version := range mod.Versions {

View file

@ -41,7 +41,7 @@ func TestProfileResolution(t *testing.T) {
},
}).Resolve(resolver, nil, math.MaxInt)
testza.AssertEqual(t, "failed resolving profile dependencies: mod RefinedRDLib version 1.0.6 does not match constraint ^1.0.7", err.Error())
testza.AssertEqual(t, "failed resolving profile dependencies: failed resolving dependencies. requires different versions of RefinedRDLib", err.Error())
_, err = (&Profile{
Name: DefaultProfileName,