Closed blegat closed 1 month ago
Seems we are infinitely recursing in https://github.com/JuliaLang/Pkg.jl/blob/195e17e3f33d7f12b6b8f1a46f30ad872e1fcc00/src/Resolve/maxsum.jl#L450.
@carlobaldassi, any ideas about this one?
I'll look into this.
I've been investigating this (for quite a while). Unfortunately, it's not a bug, strictly speaking. The solver is not infinitely recursing, it's just taking an inordinate amount of time because the problem is unsatisfiable but the algorithm keeps backtracking the partial heuristic solutions and attempting new ones. It's hitting a combinatorial wall - which is something I knew was possible but was hoping would be rare enough.
In fact, the issue can be triggered even just with a subset of the original requirements, like this: get in pkg mode and activate --temp
, then
add MeshCatMechanisms ModelingToolkit Symbolics@5
It will seemingly get stuck.
Now a bit of analysis shows that under the circumstances ModelingToolkit is restricted to major version 8, so we can bisect its version range. Both of these return an error almost immedately:
add MeshCatMechanisms ModelingToolkit@8.65-8 Symbolics@5
add MeshCatMechanisms ModelingToolkit@8-8.64 Symbolics@5
Which shows that the problem is indeed unsatisfiable. Just to give an idea of how intricate this is here are the error messsages in both cases. (If you notice some log entries about packages having been fixed by the MaxSum heuristic: I checked that those are irrelevant, the problem truly is unsatisfiable.)
I'm not sure how to fix this; one unsatisfactory (at least to me) but straightforward solution would be adding some form of timeout, with an environment variable to control it.
In the following https://github.com/dionysos-dev/Dionysos.jl/pull/352, resolving the environment
Dionysos/BipedRobot/Project.toml
takes hours. You can see in the following log that it took 6 hours to doPkg.instantiate()
with Julia v1.10.2: https://github.com/dionysos-dev/Dionysos.jl/actions/runs/8783197708/job/24099651447?pr=352 Steps to reproduce:then
It should be stuck resolving for hours.