Strange behavior of Pkg's version resolver

I have the following Project.toml in https://github.com/s-broda/ARCHModels.jl

name = "ARCHModels"
uuid = "6d3278bc-c23a-5105-85e5-0d57d2bf684f"
authors = ["Simon Broda <simon.broda@uzh.ch>"]
version = "0.4.0"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
HypothesisTests = "09f84164-cd44-5f33-b23f-e6b0d136a0d5"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Retry = "20febd7b-183b-5ae2-ac4a-720e7ce64774"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"

[compat]
Distributions = "=0.19.2"
StatsBase = "=0.30.0"
StatsModels = ">=0.6.3"
julia = "1.0.0"

[extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "StatsModels", "GLM", "DataFrames"]

With the above (found by trial and error), the package tests just fine, see the CI run here. However, if I remove the restriction on Distributions.jl so that the compat section reads

[compat]
StatsBase = "=0.30.0"
StatsModels = ">=0.6.3"
julia = "1.0.0"

and re-run CI, I get (see here)

 Testing ARCHModels

 Resolving package versions...

ERROR: Unsatisfiable requirements detected for package GLM [38e38edf]:

 GLM [38e38edf] log:

 ├─possible versions are: [0.2.0-0.2.5, 0.3.0-0.3.2, 0.4.0-0.4.8, 0.5.0-0.5.6, 0.6.0-0.6.1, 0.7.0, 0.8.0-0.8.1, 0.9.0, 0.10.0-0.10.1, 0.11.0, 1.0.0-1.0.2, 1.1.0-1.1.1, 1.2.0, 1.3.0] or uninstalled

 ├─restricted to versions * by an explicit requirement, leaving only versions [0.2.0-0.2.5, 0.3.0-0.3.2, 0.4.0-0.4.8, 0.5.0-0.5.6, 0.6.0-0.6.1, 0.7.0, 0.8.0-0.8.1, 0.9.0, 0.10.0-0.10.1, 0.11.0, 1.0.0-1.0.2, 1.1.0-1.1.1, 1.2.0, 1.3.0]

 ├─restricted by compatibility requirements with Distributions [31c24e10] to versions: [0.2.0-0.2.5, 0.3.0-0.3.2, 0.4.0-0.4.8, 0.5.0-0.5.6, 0.6.0-0.6.1, 0.7.0, 0.8.0-0.8.1, 0.9.0, 0.10.0-0.10.1, 0.11.0, 1.0.0-1.0.2, 1.1.0-1.1.1] or uninstalled, leaving only versions: [0.2.0-0.2.5, 0.3.0-0.3.2, 0.4.0-0.4.8, 0.5.0-0.5.6, 0.6.0-0.6.1, 0.7.0, 0.8.0-0.8.1, 0.9.0, 0.10.0-0.10.1, 0.11.0, 1.0.0-1.0.2, 1.1.0-1.1.1]

 │ └─Distributions [31c24e10] log:

 │   ├─possible versions are: [0.1.0-0.1.4, 0.2.0-0.2.13, 0.3.0, 0.6.4-0.6.7, 0.7.0-0.7.6, 0.8.0-0.8.10, 0.9.0, 0.10.0-0.10.2, 0.11.0-0.11.1, 0.12.0-0.12.5, 0.13.0, 0.14.0-0.14.2, 0.15.0, 0.16.0-0.16.4, 0.17.0, 0.18.0, 0.19.1-0.19.2, 0.20.0, 0.21.0-0.21.1] or uninstalled

 │   ├─restricted to versions * by ARCHModels [6d3278bc], leaving only versions [0.1.0-0.1.4, 0.2.0-0.2.13, 0.3.0, 0.6.4-0.6.7, 0.7.0-0.7.6, 0.8.0-0.8.10, 0.9.0, 0.10.0-0.10.2, 0.11.0-0.11.1, 0.12.0-0.12.5, 0.13.0, 0.14.0-0.14.2, 0.15.0, 0.16.0-0.16.4, 0.17.0, 0.18.0, 0.19.1-0.19.2, 0.20.0, 0.21.0-0.21.1]

 │   │ └─ARCHModels [6d3278bc] log:

 │   │   ├─possible versions are: 0.4.0 or uninstalled

 │   │   └─ARCHModels [6d3278bc] is fixed to version 0.4.0

 │   └─restricted to versions 0.20.0 by an explicit requirement, leaving only versions 0.20.0

 ├─restricted by compatibility requirements with StatsModels [3eaba693] to versions: [0.2.0-0.2.5, 0.3.0-0.3.2, 0.4.0-0.4.8, 0.5.0-0.5.6, 0.6.0-0.6.1, 0.7.0, 0.8.0-0.8.1, 1.3.0] or uninstalled, leaving only versions: [0.2.0-0.2.5, 0.3.0-0.3.2, 0.4.0-0.4.8, 0.5.0-0.5.6, 0.6.0-0.6.1, 0.7.0, 0.8.0-0.8.1]

 │ └─StatsModels [3eaba693] log:

 │   ├─possible versions are: [0.0.1-0.0.2, 0.1.0, 0.2.0-0.2.6, 0.3.0-0.3.1, 0.4.0, 0.5.0, 0.6.0-0.6.3] or uninstalled

 │   └─restricted to versions 0.6.3-* by an explicit requirement, leaving only versions 0.6.3

 └─restricted by julia compatibility requirements to versions: [1.0.0-1.0.2, 1.1.0-1.1.1, 1.2.0, 1.3.0] or uninstalled — no versions left

It is counterintuitive to me that removing a restriction makes it impossible to satisfy the requirements, so that I wind up hunting for a compatible combination of packages manually. Is this the intended behavior?

This could potentially happen if removing the compat entry installs a version of a dependency that is not compatible with a test dependency.

1 Like

Thanks, I see.