PSA: Compat requirements in the General registry are changing

TL;DR:

Currently standard libraries have an implied version number based of the Julia version. This is changing and will require users to update their Project.toml.

Update – November 9th 2023:

While rolling this change out we encountered some unfortunate interactions. Namely that using Pkg inside the test sandbox would lead to confusing errors like:

   Resolving package versions...
ERROR: LoadError: Unsatisfiable requirements detected for package LinearAlgebra [37e2e46d]:
 LinearAlgebra [37e2e46d] log:
 ├─possible versions are: 0.0.0 or uninstalled (package in sysimage!)
 ├─LinearAlgebra [37e2e46d] is fixed to version 0.0.0
 └─restricted to versions 1.6.0-1 by ControlSystemsBase [aaaaaaaa] — no versions left
   └─ControlSystemsBase [aaaaaaaa] log:
     ├─possible versions are: 1.9.5 or uninstalled
     └─ControlSystemsBase [aaaaaaaa] is fixed to version 1.9.5

This means that we would need to require:

[compat]
StdlibName = "<0.0.1,1"

everywhere. We are pausing the RegistryCI requirement for now while we are searching for better answers.

Update – November 2nd 2023: How do I determine what the [compat] entry should be for a stdlib?

The answer depends on which versions of Julia your package supports.If your package requires Julia 1.4+, then for most stdlibs you can set:

[compat]
 StdlibName = "1"

However, for the SHA stdlib, you should set:

[compat]
 SHA = "0.7, 1"

If your package supports Julia 1.3 or earlier, then for most stdlibs you should set:

[compat]
 StdlibName = "<0.0.1, 1"

However, for the SHA stdlib, you should set:

[compat]
 SHA = "<0.0.1, 0.7, 1"

Original post

Up until now standard libraries have been excluded from the mandatory
requirement of being listed in [compat]. Stdlibs were exempt because the version of a standard library was tightly coupled to the version of Julia it was shipped with.

In Julia v1.11 (and to an lesser extend v1.10) we are moving towards upgradeable standard libaries.
This means that Julia will still come with the same selection of standard libraries, but instead of waiting
for a new Julia release, standard libraries will have their own release cycle.
So it should be possible in the future to use Pkg v1.12 on Julia v1.11.

In effect standard libraries are becoming normal Julia packages, with the only difference that a version of
them will be shipped with a default Julia install.

Now this means that version numbers of standard libraries and Julia are no longer coupled and one
must manually declare [compat] requirements for standard libraries as well as Julia in your Project.toml. We will handle the registry side of things automatically, but developers will have to
manually adjust their Project.toml the next time they release a version to the registry.

For now you should simply match the version of your Julia compat entry, for all your standard library compat entries.

So a Project.toml like:

name = "MyPackage"
uuid = "4a0d4eb6-ee8c-4d0f-9d49-1daa6f6c32cf"
version = "0.1.0"

[deps]
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
julia = "1.6"

Would become:

name = "MyPackage"
uuid = "4a0d4eb6-ee8c-4d0f-9d49-1daa6f6c32cf"
version = "0.1.0"

[deps]
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
julia = "1.6"
Statistics = "1.6"

This change has been deployed:

60 Likes

This topic was automatically closed after 1 minute. New replies are no longer allowed.