Skip to content

Automatic compat for stdlibs is problematic #4424

@GunnarFarneback

Description

@GunnarFarneback

If you for example run Julia 1.11 and Pkg.add Random to a package, this automatically adds a compat entry with 1.11 compat (since Random is an stdlib with version following Julia). As a consequence the package becomes incompatible with Julia 1.10 and older, as can be seen in this example (most output removed for clarity):

$ julia +1.11
(@v1.11) pkg> generate TestCompat
(@v1.11) pkg> activate TestCompat
(TestCompat) pkg> add Random
julia> mkdir("TestCompat/test")
julia> write("TestCompat/test/runtests.jl", "using Random")
(TestCompat) pkg> test
     Testing TestCompat tests passed 

$ julia +1.10 --project=TestCompat
(TestCompat) pkg> test
ERROR: Unsatisfiable requirements detected for package Random [9a3f8284]:
 Random [9a3f8284] log:
 ├─possible versions are: 1.10.10 or uninstalled (package in sysimage!)
 └─restricted to versions 1.11.0-1 by project [708c9892] — no versions left
   └─project [708c9892] log:
     ├─possible versions are: 0.0.0 or uninstalled
     └─project [708c9892] is fixed to version 0.0.0

This is problematic and has caused real problems where people have registered packages in General which have worked on the latest Julia version but not on older versions, e.g. the 1.10 LTS, within the declared Julia compat. It is also generally confusing for people who add an stdlib and it works fine locally, but fails in CI, which happens to run an older Julia version.

Either the automatic compat should be disabled for stdlibs or add a safe entry, if that is possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions