Running Old Project on Latest Julia Version?

Is there a proper way (best practice) to convert a project originally compiled in an older Julia version, to the latest released version?

The message I’m greeted with in this scenario is:

Warning: The active manifest file has dependencies that were resolved with a different julia version (1.8.5). Unexpected behavior may occur.

I’ve managed to get this working now, but I feel like it was more of a trial-and-error job. Thanks for your time!

usually just julia> ] up will update everything.

of course if the syntax of packages changed during the updates, your code might have to be updated for newer versions of the packages you’re using.

Wow, seems simple enough. Thank you, @lmiq. And yes, totally understandable if there are changes to syntax, etc.

I’ll try it out on another “old” project and see what happens. Thanks again.

Another more conservative alternative is to just keep using the version of Julia where the project worked to start with. For that, if you have installed julia with juliaup, you can just do:

juliaup add 1.8.5

and then

julia +1.8.5 --project
1 Like

I’ve found what typically works best for me is to manually add compat specifiers to the project for the top-level dependences. That is, if I have a Project/Manifest with a dozen packages in the project and hundreds in the manifest, I’ll grab the status of the status quo and then copy all the current versions of the dozen top level into exact compat specs. And then I’ll update everything else.

This ensures that the packages that I (apparently) cared most about preserve their APIs, but lower level dependencies are free to grab newer versions.

1 Like

The package update route, pkg> up worked perfectly. I’ll have to try out juliaup, though, as I haven’t done so yet.

@mbauman, thanks for the feedback. This would be an even more conservative approach to make the jump to a later Julia version.

I would backup your old Manifest.toml in case you run into trouble.

2 Likes

Julia has a syntax guarantee, since 1.0/0.7. Julia also has a stable API guarantee, but some undocumented “API” is used by some packages, and then Julia potentially changes, and they break. Either you don’t update Julia, or you do, and then upgrading packages usually fixes. This is probably less of a problem over time, and you can try updating up one Julia version at a time, at least if you have a problem, or I guess just jump to latest, at least try it first.

There has been no new, or at least changed syntax since 0.7. [Except if I recall in 1.7, something new and technically breaking, not in practice, very obscure related to nD matrix syntax.]

I wasn’t aware of that warning but here’s the solution (or one of):

Nothing is wrong, you’re just getting a warning so you know there’s been a change of versions. You can run upgrade_manifest to get rid of the warning.

No, those are all very different — and quite unrelated — points.

The Manifest format change happened in Julia 1.7 (and support for it was backported to 1.6). This isn’t about the format of the manifest itself, but rather the fact that it was generated and — more importantly — resolved using a different version of Julia. Why does this matter? It matters because some packages have specific compatibility requirements with Julia itself. And as such, the manifest may be specifying versions of packages than what is actually supported.

2 Likes