6
votes

How do you do version control in Julia if you want to use it in a production environment. That is, most of the Julia packages and Julia itself have a 0.3.10 or similar version number, so you should be prepared for major interface changes in the (near) future, and especially when the first digit flips from 0 to 1.

My package status look something like this:

julia> Pkg.status()
4 required packages:
 - DataFrames                    0.6.9
 - Gadfly                        0.3.13
 - Jewel                         1.0.5
 - Mongo                         0.1.3
44 additional packages:
 - ArrayViews                    0.6.3
 - BinDeps                       0.3.15
 - Calculus                      0.1.10
 - Codecs                        0.1.4
 - Color                         0.4.7
 - Compat                        0.6.0
 - Compose                       0.3.13
 - Contour                       0.0.7
 - DataArrays                    0.2.17
 - DataStructures                0.3.12
etc...

It is recommended that you use Pkg.update() often so you have the most recent patches on all your packages.

If you need to update a package because of these patches or you need to use a new feature, you may break your code and there may also be dependencies between various packages, too.

Julia may be a mature enough language that does not have serious version-control problems, but I feel the need to poll the opinion of Julia users about their experience.

2

2 Answers

9
votes

In a production environment you should not be using Pkg.update() often, or at least not without testing in a non-production environment first. This is true for every packaging system, not just Julia. For Julia in particular, I would also recommend establishing a set of versions that work for you, then use appropriate lower and upper bounds in your REQUIRE file.

For example, suppose JuMP 0.9.2 works well for me, as does Gadfly 0.4.2. I would probably do something like the following in ~/.julia/v0.3/REQUIRE:

JuMP 0.9.2 0.10
Gadfly 0.4.2 0.5

This way, if I run Pkg.update() I will get 0.9.3 and 0.4.3 if they come out, but I won't be automatically upgraded to JuMP 0.10. Of course, this only works if you trust package maintainers to use version numbers sensibly, which is a serious problem especially when they are pre-1.0.

5
votes

The DeclarativePackages.jl package (https://github.com/rened/DeclarativePackages.jl) allows you to specify exactly which versions of each package you want to use for each project: it starts Julia with exactly those versions of those packages available. This sounds like it might be what you're looking for.