Skip to content

package does not install when another package needs to downgrade #110

@mvhulten

Description

@mvhulten

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions