Update packages without restarting

I don’t like having to restart Julia when I update packages because I lose my state and have to wait 10 minutes or more to get back to it, usually once or twice a day.

Is it possible to avoid this? Is that a feature Julia could have in the future, or is that impossible?

you have to restart. it’s probably possible that a future version would support this, bit it’s kind of hard to imagine it being a necessary feature.

Just to confirm, are you putting all projects in separate environments? Updating all your packages twice a day seems like a sign you have too many packages in a single environment.

My projects are in separate environments. This happens in a single project. It is inconvenient to have a lot of packages in a project for the reason I said, but aside from this issue I haven’t had a problem with the number of packages.

You update all of your packages once or twice a day? Why?

(If you are developing a package, see the Revise.jl package — you typically don’t need to restart at all.)

1 Like

No – once or twice a day I update some package and have to restart in order to use it.

It isn’t clear if it is your package, but presuming it is, pay attention to @stevengj 's reference to Revise.jl. If you are not familiar with it, check it out. Seriously worth its weight in bitcoins.

No they are dependencies of my project.

Hmm, and these dependencies change once or twice a day!? That is hard to believe.

I don’t have the data, but I think many packages update every n days. Having more than n dependencies means more than one daily update.

It still sounds somewhat unusual to update daily even if there’s something new to update to every day. I rarely update dependencies of anything more often than once a month or so. I guess you’re using a particularly vibrant part of the package ecosystem where things happen all the time and it’s rewarding to live on the bleeding edge.

4 Likes

If you don’t want to update, you can ]pin --all all your dependencies in your environments. You’ll have to unpin and update manually though.

Is there a good reason to update these third party packages (dependencies)? The changes are likely small/insignificant for your purposes so you can probably get away with updating them far less frequently.

I only update them when I need to for a bugfix or feature.

Even though it is stated that updating packages regularly is rare, I find myself updating packages all the time. Partly this is because I’m developing a whole suite of packages and as I update them I need to update my working environment, but also I’m also consuming packages in the ecosystem that are on the bleeding edge and have significant changes with each update (i.e. ModelingToolkit.jl).

I know that if I have my dependencies added to my working environment as “developed”, then Revise.jl will do it’s thing. But in some cases I would like to be using the “published” version in which case Revise.jl will no longer track changes when updating versions. Why use the published version? Because I may be making some breaking changes to one of the dependencies, and I’d like my working environment to be set to a particular published version.

Maybe the solution is to have my working environment set to developed mode for all my dependencies, and when I need to make breaking changes I clone the changing package in a different path. Then I have a path for my working version, and a path for my changing version. Is this what the community recommends?