Is it possible to have multiple Manifest.toml files for the same project, corresponding to different Julia versions?

I am testing my code on julia 1.8 parallelly with 1.7, and instantiating the environment on 1.8 gives me a warning that the packages have been resolved using julia 1.7, which might lead to unpredictable results. On the other hand, a manifest generated for 1.8 might not be backward-compatible with 1.7. Is there a way to maintain two different Manifest.toml files, one for each version, and use the version specific one each time?

2 Likes

I don’t know, but you can always have two subfolders for the two projects and activate them, likelly you can do that programmatically based on the julia version you are running, something on the line of Pkg.activate("./v$(julia_version)")

I suppose I may have copies named “Manifestv1.7.toml” and “Manifestv1.8.toml”, and rename the appropriate one to “Manifest.toml” when julia is launched. Maybe this can be added to startup.jl.

If you keep the project as a Git repository, you can create different 1.7 and 1.8 branches and just check out the one that you need depending on the Julia version you are running.

(That won’t work if you want to run Julia 1.7 and 1.8 simultaneously, but probably that’s not the best, because while testing you might eventually want to try some variations of the code depending on the version.)

1 Like