Skip to content

force_latest_compatible_version does not respect julia version compatibilities #4349

@devmotion

Description

@devmotion

force_latest_compatible_version=true tries to use the latest version of the dependencies, irrespective of whether they are compatible with the julia version.

This is problematic for packages such as JET where latest releases are limited to more recent Julia versions. This bug already causes problems in the ecosystem as it affects all CompatHelper PRs (for which julia-actions/julia-runtest sets force_latest_compatible_version=true), e.g. in JuliaStats/StatsBase.jl#959 and JuliaDecisionFocusedLearning/ImplicitDifferentiation.jl#183. The only workaround currently is to close the CompatHelper PRs and manually open PRs with the version bumps suggested by CompatHelper (for which force_latest_compatible_version is automatically set to false).


MWE:

Project.toml:

name = "MWE"
uuid = "3b558226-ac18-4827-ac56-5f5eb11256d2"
version = "0.1.0"

[deps]
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"

[compat]
JET = "0.9, 0.10"
julia = "1.10"

src/MWE.jl:

module MWE

import JET

end # module MWE

test/runtests.jl:

import MWE

On Julia 1.11.6 (note that JET 0.10 only supports Julia >= 1.12-):

> julia +release --project=. -e 'import Pkg; Pkg.test()'
...
     Testing Running tests...
     Testing MWE tests passed
> julia +release --project=. -e 'import Pkg; Pkg.test(; force_latest_compatible_version=false)'
...
     Testing Running tests...
     Testing MWE tests passed
> julia +release --project=. -e 'import Pkg; Pkg.test(; force_latest_compatible_version=true)'
...
     Testing MWE
┌ Warning: Could not use exact versions of packages in manifest, re-resolving
└ @ Pkg.Operations ~/.julia/juliaup/julia-1.11.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1924
ERROR: Unsatisfiable requirements detected for package JET [c3a54625]:
 JET [c3a54625] log:
 ├─possible versions are: 0.0.1 - 0.10.6 or uninstalled
 ├─restricted to versions 0.9 - 0.10 by MWE [3b558226], leaving only versions: 0.9.0 - 0.10.6
 │ └─MWE [3b558226] log:
 │   ├─possible versions are: 0.1.0 or uninstalled
 │   └─MWE [3b558226] is fixed to version 0.1.0
 ├─restricted to versions 0.10 by an explicit requirement, leaving only versions: 0.10.0 - 0.10.6
 └─restricted by julia compatibility requirements to versions: 0.8.28 - 0.9.19 or uninstalled — no versions left
Stacktrace:
  [1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
    @ Pkg.Resolve ~/.julia/juliaup/julia-1.11.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/Resolve/graphtype.jl:1072
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Priority Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions