How do I forcefully upgrade a package to its latest version?

Some packages have malfunctional requirements and set explicit, fixed versions for critical packages, e.g., setting LanguageServer to 2.0.1. How can I forcefully ignore these requirements, and install the latest version of a package? How can I pin some package to its latest version, so that it will always update regardless of constraints by other packages?

I tried Pkg.pin(PackageSpec(name="LanguageServer", version="3.2.0")) (which would have been bad even if it worked, as it needs manual pinning whenever a new version comes along), but it fails:

ERROR: Unsatisfiable requirements detected for package SymbolServer [cf896787]:
 SymbolServer [cf896787] log:
 ├─possible versions are: [0.0.1, 0.1.0-0.1.3, 0.2.0-0.2.5, 1.0.0-1.0.1, 2.0.0, 3.0.0, 3.1.0-3.1.1, 4.0.0, 4.1.0, 4.2.0, 4.3.0, 4.4.0, 4.5.0, 5.0.0, 5.1.0] or uninstalled
 ├─restricted to versions 3.1.1 by an explicit requirement, leaving only versions 3.1.1
 └─restricted by compatibility requirements with LanguageServer [2b0e0bc5] to versions: [4.2.0, 4.3.0, 4.4.0, 4.5.0, 5.0.0, 5.1.0] — no versions left
   └─LanguageServer [2b0e0bc5] log:
     ├─possible versions are: [0.5.0-0.5.1, 0.6.0-0.6.1, 1.0.0, 2.0.0-2.0.1, 3.0.0, 3.1.0, 3.2.0] or uninstalled
     └─restricted to versions 3.2.0 by an explicit requirement, leaving only versions 3.2.0
Stacktrace:
 [1] propagate_constraints!(::Pkg.Resolve.Graph, ::Set{Int64}; log_events::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Resolve/graphtype.jl:1010
 [2] propagate_constraints! at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Resolve/graphtype.jl:951 [inlined] (repeats 2 times)
 [3] simplify_graph!(::Pkg.Resolve.Graph, ::Set{Int64}; clean_graph::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Resolve/graphtype.jl:1465
 [4] simplify_graph! at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Resolve/graphtype.jl:1465 [inlined] (repeats 2 times)
 [5] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:341
 [6] pin(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:1204
 [7] pin(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:261
 [8] pin at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:238 [inlined]
 [9] #pin#55 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:236 [inlined]
 [10] pin at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:236 [inlined]
 [11] #pin#53 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:234 [inlined]
 [12] pin(::Pkg.Types.PackageSpec) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:234
 [13] top-level scope at REPL[56]:1

I don’t think there’s a way to do that now, but there’s a PR to add that functionality: https://github.com/JuliaLang/Pkg.jl/pull/1607

1 Like