Is it possible to select the Julia version in an environmet?

Hi,

I’m starting to get familiar with environments while following the course on Parallel Computing with Julia in JuliaAcademy. The repository for that course comes with Project.toml and Manifest.toml files to specify the particular versions needed for that environment. All OK with that, but I was just wondering if it is also possible to specify the Julia version itself? (I don’t have any need for it right now, I’m using 1.4.0 and all works OK, but I can imagine that things will start to break at a later Julia version, so is it also possible to specify the version of Julia needed?)

Many thanks,
AdV

The compatibility section of the Project.toml can be used to specify it (in fact, it is requirement to do so for the general registry).

I see, thanks.

In the case of the environment I was looking at, there is no compatibility section. I assume then that every package includes information about which Julia version it requires (perhaps something like +1.0), and if the Julia version I’m running does not meet the requirements, then the environment cannot get activated?

And what happens if the compatibility section says I need another version of Julia? It simply stops and informs about this requirement or it automagically does something cleverer?

Thanks
AdV

Surprisingly, it just works:

julia> VERSION
v"1.4.0"

shell> cat Foo/Project.toml
name = "Foo"
uuid = "7b91d50f-2228-4ab2-8171-0fe17056363f"
authors = ["Tamas K. Papp <tkpapp@gmail.com>"]
version = "0.1.0"

[compat]
julia = "2"

(@v1) pkg> activate ./Foo
 Activating environment at `/tmp/Foo/Project.toml`

so I am assuming it is not enforced at activation time.

I could not find an existing issue.

OK, many thanks. Don’t expect this to bother me for the time being, but just to understand a bit more how environments were working.