Pkg3 does nothing when adding a package that depends on an earlier than installed version of another package:
pkg> add CSV
INFO: Resolving package versions
INFO: Updating "~/.julia/environments/v0.6/Project.toml"
[336ed68f] + CSV v0.2.1
INFO: Updating "~/.julia/environments/v0.6/Manifest.toml"
[336ed68f] + CSV v0.2.1
[324d7699] + CategoricalArrays v0.3.3
[944b1d66] + CodecZlib v0.4.2
[a93c6f00] + DataFrames v0.11.5
[9a8bc11e] + DataStreams v0.3.4
[73a701b4] + NamedTuples v4.0.0
[3bb67fe8] + TranscodingStreams v0.4.1
[ea10d353] + WeakRefStrings v0.4.1
pkg> add Benchmark
INFO: Resolving package versions
ERROR: Unsatisfiable requirements detected for package DataFrames [a93c6f00]:
DataFrames [a93c6f00] log:
├─possible versions are: [0.1.0, 0.2.0-0.2.5, 0.3.0-0.3.16, 0.4.0-0.4.3, 0.5.0-0.5.12, 0.6.0-0.6.11, 0.7.0-0.7.8, 0.8.0-0.8.5, 0.9.0-0.9.1, 0.10.0-0.10.1, 0.11.0-0.11.5] or uninstalled
├─restricted by compatibility requirements with CSV [336ed68f] to versions: 0.11.0-0.11.5
│ └─CSV [336ed68f] log:
│ ├─possible versions are: [0.0.1-0.0.9, 0.0.11-0.0.14, 0.1.0-0.1.2, 0.1.4-0.1.5, 0.2.0-0.2.1] or uninstalled
│ └─restricted to versions 0.2.1 by an explicit requirement, leaving only versions 0.2.1
└─restricted by compatibility requirements with Benchmark [de6e09b3] to versions: [0.1.0, 0.2.0-0.2.5, 0.3.0-0.3.16, 0.4.0-0.4.3, 0.5.0-0.5.12, 0.6.0-0.6.11, 0.7.0-0.7.8, 0.8.0-0.8.5, 0.9.0-0.9.1, 0.10.0-0.10.1] — no versions left
└─Benchmark [de6e09b3] log:
├─possible versions are: [0.0.1-0.0.3, 0.1.0] or uninstalled
└─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.3, 0.1.0]
Stacktrace:
[1] #propagate_constraints!#75(::Bool, ::Function, ::Pkg3.GraphType.Graph, ::Set{Int64}) at /home/mhu027/.julia/v0.6/Pkg3/src/GraphType.jl:977
[2] propagate_constraints!(::Pkg3.GraphType.Graph) at /home/mhu027/.julia/v0.6/Pkg3/src/GraphType.jl:918
[3] #simplify_graph!#139(::Bool, ::Function, ::Pkg3.GraphType.Graph, ::Set{Int64}) at /home/mhu027/.julia/v0.6/Pkg3/src/GraphType.jl:1432
[4] simplify_graph!(::Pkg3.GraphType.Graph) at /home/mhu027/.julia/v0.6/Pkg3/src/GraphType.jl:1432
[5] resolve_versions!(::Pkg3.Types.EnvCache, ::Array{Pkg3.Types.PackageSpec,1}) at /home/mhu027/.julia/v0.6/Pkg3/src/Operations.jl:212
[6] add(::Pkg3.Types.EnvCache, ::Array{Pkg3.Types.PackageSpec,1}) at /home/mhu027/.julia/v0.6/Pkg3/src/Operations.jl:624
[7] #add#4(::Bool, ::Function, ::Pkg3.Types.EnvCache, ::Array{Pkg3.Types.PackageSpec,1}) at /home/mhu027/.julia/v0.6/Pkg3/src/API.jl:21
[8] do_add!(::Pkg3.Types.EnvCache, ::Array{Tuple{Symbol,Vararg{Any,N} where N},1}) at /home/mhu027/.julia/v0.6/Pkg3/src/REPLMode.jl:378
[9] #do_cmd!#3(::Bool, ::Function, ::Array{Tuple{Symbol,Vararg{Any,N} where N},1}, ::Base.REPL.LineEditREPL) at /home/mhu027/.julia/v0.6/Pkg3/src/REPLMode.jl:146
[10] do_cmd(::Base.REPL.LineEditREPL, ::String) at /home/mhu027/.julia/v0.6/Pkg3/src/REPLMode.jl:112
[11] (::Pkg3.REPLMode.##4#5{Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at /home/mhu027/.julia/v0.6/Pkg3/src/REPLMode.jl:511
pkg>
Standard Pkg downgrades the depending packages:
julia> Pkg.add("Benchmark")
INFO: Installing Benchmark v0.1.0
INFO: Downgrading CSV: v0.2.1 => v0.1.5
INFO: Downgrading CategoricalArrays: v0.3.3 => v0.1.6
[...]
julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating Pkg3 master...
INFO: Computing changes...
INFO: No packages to install, update or remove
I feel somewhat ambivalent, but probably downgrading is best (as you asked for it, albeit indirectly). If this will be the way to handle it in Pkg3, the word Downgrading could be coloured red.
I included the Pkg.update() part to show that Pkg does not appear to upgrade packages that would be upgradable if it were not for the newly installed conflicting package. But it does not provide the user with any such information. That may be a Pkg bug.
In general, Pkg2 is much more aggressive about changing the versions of anything and everything as it feels like – regardless of whether you asked for it. Pkg3 won't change the versions of anything that you didn't ask for. In this case the ideal interaction, imo, would be that the package manager first tries to install without upgrading or downgrading any direct dependencies, but if it finds that it can't, then it would prompt the user if they want to upgrade/downgrade existing dependencies in order to allow the install, listing all the changes, and prompting for their approval.
Any updates on when this feature might be added to Pkg3?
When I rewrite the resolver. Unfortunately hasn’t been a top priority.
is it a bug when ]instantiate a new project from Project.toml, where nobody explicit specifies the latest ImageCore version? (E.g., https://github.com/JuliaIO/ImageMagick.jl/pull/152, https://github.com/JuliaImages/ImageShow.jl/pull/8)
IMO restricted to versions 0.8.0 by an explicit requirement, leaving only versions 0.8.0 seems to be an unnecessary restriction.
# ImageMagick side
ERROR: Unsatisfiable requirements detected for package ImageCore [a09fc81d]:
ImageCore [a09fc81d] log:
├─possible versions are: [0.0.1-0.0.5, 0.1.0-0.1.5, 0.2.0-0.2.1, 0.3.0-0.3.3, 0.4.0-0.4.1, 0.5.0, 0.6.0, 0.7.0-0.7.4, 0.8.0] or uninstalled
├─restricted to versions * by ImageMagick [6218d12a], leaving only versions [0.0.1-0.0.5, 0.1.0-0.1.5, 0.2.0-0.2.1, 0.3.0-0.3.3, 0.4.0-0.4.1, 0.5.0, 0.6.0, 0.7.0-0.7.4, 0.8.0]
│ └─ImageMagick [6218d12a] log:
│ ├─possible versions are: 0.7.2 or uninstalled
│ └─ImageMagick [6218d12a] is fixed to version 0.7.2
├─restricted to versions 0.8.0 by an explicit requirement, leaving only versions 0.8.0
└─restricted by compatibility requirements with ImageShow [4e3cecfd] to versions: [0.0.1-0.0.5, 0.1.0-0.1.5, 0.2.0-0.2.1, 0.3.0-0.3.3, 0.4.0-0.4.1, 0.5.0, 0.6.0, 0.7.0-0.7.4] — no versions left
└─ImageShow [4e3cecfd] log:
├─possible versions are: 0.1.0-0.1.2 or uninstalled
└─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.1.2
ImageMagick.Project.toml
name = "ImageMagick"
uuid = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
version = "0.7.2"
[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[compat]
BinaryProvider = "≥ 0.3.0"
ColorTypes = "≥ 0.2.7"
FixedPointNumbers = "≥ 0.3.0"
julia = "≥ 1.0.0"
[extras]
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
ImageMetadata = "bc367c6b-8a6b-528e-b4bd-a4b897500b49"
ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31"
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
IndirectArrays = "9b13fd28-a010-5f03-acff-a1bbcff69959"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
[targets]
test = ["Colors", "OffsetArrays", "Pkg", "ColorVectorSpace", "Test", "Random", "IndirectArrays", "ZipFile", "ImageTransformations", "ImageShow", "ImageMetadata"]
# ImageShow side
ERROR: Unsatisfiable requirements detected for package ImageMagick [6218d12a]:
ImageMagick [6218d12a] log:
├─possible versions are: [0.0.1, 0.1.0-0.1.8, 0.2.0-0.2.4, 0.3.0, 0.4.0, 0.5.0-0.5.2, 0.7.0-0.7.1] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1, 0.1.0-0.1.8, 0.2.0-0.2.4, 0.3.0, 0.4.0, 0.5.0-0.5.2, 0.7.0-0.7.1]
├─restricted by compatibility requirements with ImageCore [a09fc81d] to versions: [0.0.1, 0.1.0-0.1.8, 0.2.0-0.2.1, 0.2.4, 0.3.0, 0.4.0, 0.5.0-0.5.2] or uninstalled, leaving only versions: [0.0.1, 0.1.0-0.1.8, 0.2.0-0.2.1, 0.2.4, 0.3.0, 0.4.0, 0.5.0-0.5.2]
│ └─ImageCore [a09fc81d] log:
│ ├─possible versions are: [0.0.1-0.0.5, 0.1.0-0.1.5, 0.2.0-0.2.1, 0.3.0-0.3.3, 0.4.0-0.4.1, 0.5.0, 0.6.0, 0.7.0-0.7.4, 0.8.0] or uninstalled
│ ├─restricted to versions * by ImageShow [4e3cecfd], leaving only versions [0.0.1-0.0.5, 0.1.0-0.1.5, 0.2.0-0.2.1, 0.3.0-0.3.3, 0.4.0-0.4.1, 0.5.0, 0.6.0, 0.7.0-0.7.4, 0.8.0]
│ │ └─ImageShow [4e3cecfd] log:
│ │ ├─possible versions are: 0.2.0 or uninstalled
│ │ └─ImageShow [4e3cecfd] is fixed to version 0.2.0
│ └─restricted to versions 0.8.0 by an explicit requirement, leaving only versions 0.8.0
└─restricted by julia compatibility requirements to versions: 0.7.0-0.7.1 or uninstalled — no versions left
ImageShow.Project.toml
name = "ImageShow"
uuid = "4e3cecfd-b093-5904-9786-8bbb286a6a31"
version = "0.2.0"
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
[compat]
ColorTypes = ">= 0.7.4"
julia = ">= 1.0"
[extras]
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
PaddedViews = "5432bcbf-9aad-5242-b902-cca2824c8663"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[targets]
test = ["ImageMagick", "PaddedViews", "Test"]
Maybe a more helpful error message that suggests what the user should do can be added? I think when I first came across this error, I didn't know what to do even after some googling, so I deleted all the installed packages and reinstalled them.
Yes, that would be great. However, non-trivial to accomplish.
@StefanKarpinski, has this issue been resolved?
Closed by #1330 as indicated just above your comment.
Most helpful comment
In general, Pkg2 is much more aggressive about changing the versions of anything and everything as it feels like – regardless of whether you asked for it. Pkg3 won't change the versions of anything that you didn't ask for. In this case the ideal interaction, imo, would be that the package manager first tries to install without upgrading or downgrading any direct dependencies, but if it finds that it can't, then it would prompt the user if they want to upgrade/downgrade existing dependencies in order to allow the install, listing all the changes, and prompting for their approval.