Instantiate ignores the [compat] section of a project file

I have the following Project.toml file (please scroll down to see the end of it):

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CodecXz = "ba30903b-d9e8-5048-a5ec-d1f5b0d4b47b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
MeshIO = "7269a6da-0436-5bbc-96c2-40638cbb6118"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
Rotations = "1.0.2"
StaticArrays = "1.2.5"
julia = "~1.6"

When I run:

julia --project
using Pkg
Pkg.instantiate()

I get the following packages installed:

(KiteViewer) pkg> st
      Status `~/repos/KiteViewer/Project.toml`
  [69666777] Arrow v2.2.0
  [6e4b80f9] BenchmarkTools v1.2.2
  [336ed68f] CSV v0.9.11
  [ba30903b] CodecXz v0.7.0
  [a93c6f00] DataFrames v1.3.1
  [39dd38d3] Dierckx v0.5.1
  [5789e2e9] FileIO v1.11.2
  [e9467ef8] GLMakie v0.4.7
  [5c1252a2] GeometryBasics v0.4.1
  [ee78f7c6] Makie v0.15.3
  [7269a6da] MeshIO v0.4.9
  [2774e3e8] NLsolve v4.5.1
  [9b87118b] PackageCompiler v2.0.4
  [d96e819e] Parameters v0.12.3
  [731186ca] RecursiveArrayTools v2.20.0
  [189a3867] Reexport v1.2.2
  [295af30f] Revise v3.2.1
  [6038ab10] Rotations v1.1.0
  [0bca4576] SciMLBase v1.23.1
  [90137ffa] StaticArrays v1.2.13
  [09ab397b] StructArrays v0.6.3
  [c3572dad] Sundials v4.6.0
  [ddb6d928] YAML v0.4.7

As you can see, the newest versions of Rotations and StaticArrays are installed, and not the versions I specified.

What am I doing wrong?

(using Julia 1.6.4 on Ubuntu)

Julia respects semantic versioning. That means = ”1.2.3” includes the range [1.2.3, 2.0.0). Basically, it is by default assumed that no update with the same minor version is breaking. If you want to limit further for some reason, there’s = ~1.2.3.

https://pkgdocs.julialang.org/v1/compatibility/

5 Likes

This change fixed my problem:

[compat]
Rotations = "= 1.0.2"
StaticArrays = "= 1.2.5"
julia = "~1.6"

Thank you! :slight_smile:

Can I ask why you’re limiting it like that? You’ll be pretty likely to have strange compat complications if you add other packages and you haven’t given Julia any leeway.

Newer versions of StaticArrays have a bug that I reported here: https://github.com/JuliaArrays/StaticArrays.jl/issues/981

And newer versions of Rotations.jl have another bug that I did not report yet…

A simple way to get the compat notation right is to edit it with PackageCompatUI.

Thanks for the tip!