# Adding compat entry to stdlib breaks tests on Julia 1.3

**URL:** <https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705>\
**Category:** General Usage\
**Tags:** package, versioning\
**Created:** [November 2, 2023, 3:17pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705 "2023-11-02T15:17:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [November 2, 2023, 3:17pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/1 "2023-11-02T15:17:40Z")

</div>

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

```julia
 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?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [November 2, 2023, 3:39pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/2 "2023-11-02T15:39:03Z")

</div>

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

```julia
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"`

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [November 2, 2023, 3:46pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/3 "2023-11-02T15:46:16Z")

</div>

> [@ericphanson](#):
>
> `LinearAlgebra = "<0.0.1, 1" `

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

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [November 2, 2023, 3:46pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/4 "2023-11-02T15:46:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [November 2, 2023, 3:54pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/5 "2023-11-02T15:54:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [November 2, 2023, 3:55pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/6 "2023-11-02T15:55:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [November 2, 2023, 3:57pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/7 "2023-11-02T15:57:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [November 2, 2023, 5:34pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/8 "2023-11-02T17:34:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [November 2, 2023, 5:59pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/9 "2023-11-02T17:59:54Z")

</div>

`"<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
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

```

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [November 2, 2023, 6:20pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/10 "2023-11-02T18:20:35Z")

</div>

> [@jlchan](#):
>
> JuliaRegistrator asked me to add a compat entry for LinearAlgebra.jl. I added `LinearAlgebra = "1"` to my compat entry

> [@ericphanson](#):
>
> This is basically a bug in old versions of Julia. To workaround it, set your compat to
> 
> `LinearAlgebra = "<0.0.1, 1" `

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?

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [November 2, 2023, 6:58pm UTC](https://discourse.julialang.org/t/adding-compat-entry-to-stdlib-breaks-tests-on-julia-1-3/105705/11 "2023-11-02T18:58:33Z")

</div>

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](https://github.com/JuliaRegistries/General/blob/master/README.md) and the [AutoMerge guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/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.
