`] update Foo` vs `] up Foo`

Ok, so I recently discovered – much to my surprise – that ] update Foo in fact updates all of the packages in my project. To update a single package you have to instead do ] up Foo. This is super, super confusing. I’ve been doing ] update Foo this whole time incorrectly.

Can we fix this somehow? Either a single, combined command for updating packages or at the very least an error if you give unexpected arguments to these commands.

I think if these are not identical then it’s a bug. Do you have an example to try to reproduce the bad behaviour?

4 Likes

I think you’re imagining it :wink:

3 Likes

Oh woah that’s nuts… I’m confused in my own confusion. So if up and update are synonymous then eg both ] update DataFrams and ] up DataFrames actually update all the packages, the DataFrames bit is completely ignored.

How do I update just a single package?

I’d like to present my own misunderstanding of my own confusion as further evidence that this interface is confusing :stuck_out_tongue:

]up DataFrames should not be updating anything but the DataFrames package and its dependencies. What Julia version are you using?

I don’t think this is actually true, unless something has changed since: Installing package seems to update everything unintentionally? I share OPs view that its kind of unintuitive, but I’m guessing solving this is a harder graph theory problem than I realize.

In any case, assuming this hasn’t changed, I think the solution for now is 1) either pin things you for sure don’t want to update or 2) version control your Manifest.toml so you can always roll back if something broke.

Indeed there have been some changes. AFAIK the tiered resolver approach has been implemented, and you can even specify a --preserve option for the tier. Updating a package however should always fix unrelated dependencies in your project.

2 Likes

From a purely practical standpoint how do I simply update a single update a single package and its dependencies? All I need is something analogous to what I can do in npm, yarn, cargo, etc.

Pkg should already be doing just that. ]up Foo will only update Foo and its dependencies, and will even leave shared dependencies with other added packages in the same project untouched. If your entire project is being updated, this is likely a bug unless you’re using Julia pre-1.0. Could you produce an MWE?

Just for reference, this is actually mentioned explicitly in the Pkg docs:

Simply calling up will try to update all the dependencies of the project to the latest compatible version. Sometimes this is not what you want. You can specify a subset of the dependencies to upgrade by giving them as arguments to up

3 Likes

These are good solutions, also sometimes doing add DataFrames@v1.<whatever> gives a different result than up, and may give a more informative error if there are things that are blocking.

Unless someone can produce toml files that reproduces this it will be difficult to tell what is going on. I can at least verify that basic examples work as expected:

$ pkg st
Status `/tmp/tmp.YQdQZVnahc/Project.toml`
  [a93c6f00] DataFrames v0.21.6
  [7876af07] Example v0.5.1

$ pkg up DataFrames
Updating `/tmp/tmp.YQdQZVnahc/Project.toml`
  [a93c6f00] ↑ DataFrames v0.21.6 ⇒ v0.21.7
Updating `/tmp/tmp.YQdQZVnahc/Manifest.toml`
  [a93c6f00] ↑ DataFrames v0.21.6 ⇒ v0.21.7

$ pkg up
Updating `/tmp/tmp.YQdQZVnahc/Project.toml`
  [7876af07] ↑ Example v0.5.1 ⇒ v0.5.3
Updating `/tmp/tmp.YQdQZVnahc/Manifest.toml`
  [7876af07] ↑ Example v0.5.1 ⇒ v0.5.3
2 Likes

I can wait to see if this happens again and try to get a reproduction of the behavior I’m seeing. I think the issue may be same as was observed in this thread: Installing package seems to update everything unintentionally?

Ok, just came across this:

(odecontrol) pkg> up DifferentialEquations
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Installed LaTeXStrings ─── v1.2.0
  Installed ArrayInterface ─ v2.13.1
  Installed Tracker ──────── v0.2.12
  Installed Unitful ──────── v1.4.1
  Installed OffsetArrays ─── v1.2.1
  Installed Requires ─────── v1.0.3
  Installed DataStructures ─ v0.18.6
  Installed OrdinaryDiffEq ─ v5.42.9
  Installed Adapt ────────── v2.1.0
  Installed FiniteDiff ───── v2.7.0
  Installed Juno ─────────── v0.8.4
  Installed PDMats ───────── v0.10.1
  Installed HTTP ─────────── v0.8.19
  Installed GPUArrays ────── v5.2.1
  Installed Polynomials ──── v1.1.8
  Installed ColorSchemes ─── v3.10.0
No Changes to `~/dev/research/julia/odecontrol/Project.toml`
Updating `~/dev/research/julia/odecontrol/Manifest.toml`
  [79e6a3ab] ↑ Adapt v2.0.2 ⇒ v2.1.0
  [4fba245c] ↑ ArrayInterface v2.12.0 ⇒ v2.13.1
  [35d6a980] ↑ ColorSchemes v3.9.0 ⇒ v3.10.0
  [864edb3b] ↑ DataStructures v0.18.5 ⇒ v0.18.6
  [6a86dc24] ↑ FiniteDiff v2.6.0 ⇒ v2.7.0
  [0c68f7d7] ↑ GPUArrays v5.1.0 ⇒ v5.2.1
  [cd3eb016] ↑ HTTP v0.8.17 ⇒ v0.8.19
  [e5e0dc1b] ↑ Juno v0.8.3 ⇒ v0.8.4
  [b964fa9f] ↑ LaTeXStrings v1.1.0 ⇒ v1.2.0
  [6fe1bfb0] ↑ OffsetArrays v1.2.0 ⇒ v1.2.1
  [1dea7af3] ↑ OrdinaryDiffEq v5.42.8 ⇒ v5.42.9
  [90014a1f] ↑ PDMats v0.10.0 ⇒ v0.10.1
  [f27b6e38] ↑ Polynomials v1.1.7 ⇒ v1.1.8
  [ae029012] ↑ Requires v1.0.2 ⇒ v1.0.3
  [9f7883ad] ↑ Tracker v0.2.11 ⇒ v0.2.12
  [1986cc42] ↑ Unitful v1.4.0 ⇒ v1.4.1

So I asked it to update DifferentialEquations.jl, and it doesn’t say anything about DifferentialEquations.jl, but it updated all kinds of other stuff. What’s up with that?