You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1220,7 +1226,9 @@ function validate_versions!(graph::Graph, sources::Set{Int} = Set{Int}(); skim::
1220
1226
1221
1227
gconstr0 = gconstr[p0]
1222
1228
old_gconstr0 =copy(gconstr0)
1223
-
for v0 inreverse!(findall(gconstr0))
1229
+
version_indices =findall(gconstr0)
1230
+
downgrade ||reverse!(version_indices) # prefer higher versions when upgrading
1231
+
for v0 in version_indices
1224
1232
push_snapshot!(graph)
1225
1233
fill!(graph.gconstr[p0], false)
1226
1234
graph.gconstr[p0][v0] =true
@@ -1244,13 +1252,15 @@ function validate_versions!(graph::Graph, sources::Set{Int} = Set{Int}(); skim::
1244
1252
changed =true
1245
1253
unsat =!any(gconstr0)
1246
1254
if unsat
1247
-
# we'll trigger a failure by pinning the highest version
1248
-
v0 =findlast(old_gconstr0[1:(end-1)])
1255
+
# we'll trigger a failure by pinning the highest (or lowest) version
1256
+
selector = downgrade ? findfirst : findlast
1257
+
v0 =selector(old_gconstr0[1:(end-1)])
1249
1258
@assert v0 ≢nothing# this should be ensured by a previous pruning
1250
1259
# @info "pinning $(logstr(id(p0))) to version $(pvers[p0][v0])"
1251
1260
log_event_pin!(graph, pkgs[p0], pvers[p0][v0])
1252
1261
graph.gconstr[p0][v0] =true
1253
-
err_msg_preamble ="Package $(logstr(id(p0))) has no possible versions; here is the log when trying to validate the highest version left until this point, $(logstr(id(p0), pvers[p0][v0]))):\n"
1262
+
direction = downgrade ?"lowest":"highest"
1263
+
err_msg_preamble ="Package $(logstr(id(p0))) has no possible versions; here is the log when trying to validate the $direction version left until this point, $(logstr(id(p0), pvers[p0][v0]))):\n"
0 commit comments