Adding compat entry to stdlib breaks tests on Julia 1.3

I’m trying to register a new package version, and JuliaRegistrator asked me to add a compat entry for LinearAlgebra.jl. I added LinearAlgebra = "1" to my compat entry, but then my Github CI tests for Julia 1.3 fail with error

 Resolving package versions...
ERROR: LoadError: empty intersection between LinearAlgebra@0.0.0 and project compatibility 1

Is this expected? Do I need to bump my minimum supported Julia version if I add stdlib compat entries?

This is basically a bug in old versions of Julia. To workaround it, set your compat to

LinearAlgebra = "<0.0.1, 1" 

to allow this fake v0.0.0 version. That workaround will be necessary for all stdlibs for Julia pre-1.3.

The stdlib SHA additionally needs v0.7: SHA = "<0.0.1, 0.7, 1"

5 Likes

Thank you! Does does the stdlib SHA need to go in the Project.toml file too?

Yeah, all stdlibs do, if you are using them. (If you aren’t, then don’t worry about it!)

I am using LinearAlgebra.jl, so I guess I need the SHA? I’m unclear on where this goes, however - do you have a link to an example Project.toml file with a SHA entry?

No, if you are just using LinearAlgebra then you don’t need SHA. They are just two totally separate stdlibs. I only brought it up bc SHA is different from the others in that it additionally needs v0.7. But if there’s no SHA in your Project now, then you don’t need it.

3 Likes

Ah, I see what you mean now - thanks for the clarification and help! I misunderstood that you were talking about the SHA package.

1 Like

Why <0.0.1 and not simply 0, which is documented to match 0.0.0 only?

"<0.0.1" is not equivalent to "0".

And "0" will match more than just v0.0.0. I think that "0" will match any version number of the form v0.x.y.

julia> Pkg.Versions.semver_spec("<0.0.1") == Pkg.Versions.semver_spec("0")
false

julia> v"0.0.0" in Pkg.Versions.semver_spec("<0.0.1")
true

julia> v"0.0.1" in Pkg.Versions.semver_spec("<0.0.1")
false

julia> v"0.1.0" in Pkg.Versions.semver_spec("<0.0.1")
false

julia> v"0.2.0" in Pkg.Versions.semver_spec("<0.0.1")
false

julia> v"0.0.0" in Pkg.Versions.semver_spec("0")
true

julia> v"0.0.1" in Pkg.Versions.semver_spec("0")
true

julia> v"0.1.0" in Pkg.Versions.semver_spec("0")
true

julia> v"0.2.0" in Pkg.Versions.semver_spec("0")
true

julia> v"0.999.9999" in Pkg.Versions.semver_spec("0")
true
1 Like

What did JuliaRegistrator ask for if not that exactly? Maybe it could or should?

However, since this has not been needed so far, what is really the problem with Julia old versions like e.g. 1.3? Old Julia’s were never guaranteed to be forward compatible with new Julia package versions. Isn’t that what you’re doing, adding a new one, and the older would still work?

That suggestion is not to break old Julias, and it’s great that you even want too support those still. It’s not strictly needed?

JuliaRegistrator’s message was

Your new version pull request does not meet the guidelines for auto-merging. Please make sure that you have read the General registry README and the AutoMerge guidelines. The following guidelines were not met:

  • The following dependencies do not have a [compat] entry that is upper-bounded and only includes a finite number of breaking releases: LinearAlgebra

It would certainly help if JuliaRegistrator suggested the “<0.0.1, 1” compat bound for stdlibs.

That suggestion is not to break old Julias, and it’s great that you even want too support those still. It’s not strictly needed?

I don’t strictly need v1.3, but it seems odd to update the Julia version when I don’t use any new features in 1.3+. I would have done this if @ericphanson didn’t explain the “<0.0.1, 1” compat bound workaround.

2 Likes