Difference between project.toml and required package versions

Can anyone explain to me why the package MMG_jll.jl cannot be installed with version 7 of SCOTCH_jll.jl ?

When installing MMG_jll.jl, Pkg installs the version 6 of SCOTCH_jll.jl and I cannot upgrade it to version 7 without removing MMG_jll.jl (my initial problem is that it is not impossible to install simultaneously MUMPS.jl v1.4 and Gmsh.jl v3).

The project.toml file of MMG_jll.jl is:

name = "MMG_jll"
uuid = "86086c02-e288-5929-a127-40944b0018b7"
version = "5.6.0+0"

[deps]
JLLWrappers = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SCOTCH_jll = "a8d0f55d-b80e-548d-aff6-1a04c175f0f9"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
LinearElasticity_jll = "18c40d15-f7cd-5a6d-bc92-87468d86c5db"

[compat]
JLLWrappers = "1.2.0"
julia = "1.6"

The version of SCOTCH_jll.jl is not specified in the compat section and other packages (LinearElasticity, etc.) do not require SCOTCH_jll.jl.
So why is it impossible to install MMG_jll.jl with SCOTCH_jll.jl v7?

You’re looking at the wrong place: what matters is the registry:

The compat bounds were retroactively added in Add compat bounds for JLL packages compiled with SCOTCH_jll by amontoison · Pull Request #81580 · JuliaRegistries/General · GitHub

Thanks!

Indeed, I was looking at https://github.com/JuliaBinaryWrappers/MMG_jll.jl/blob/main/Project.toml

So the modification was made directly on the general registry and not on the package’s github?

Correct, and that was done to prevent runtime issues (using MMG_jll would error because it wouldn’t find libraries it needs, if you used an incompatible version of SCOTCH_jll)