Update a package updates everything?

This topic is similar to this old one:

But I do not think that a complete answer was provided there.

Whenever I update any package, it seems that all other (or a huge number of them) get updated. For example:

@v1.6) pkg> up SPGBox
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Installed SPGBox ─ v0.2.1
    Updating `~/.julia/environments/v1.6/Project.toml`
  [bf97046b] ↑ SPGBox v0.2.0 ⇒ v0.2.1
    Updating `~/.julia/environments/v1.6/Manifest.toml`
  [3da002f7] ↓ ColorTypes v0.11.0 ⇒ v0.10.12
  [82e4d734] ↑ ImageIO v0.4.1 ⇒ v0.5.4
  [eebad327] + PkgVersion v0.1.1
  [bf97046b] ↑ SPGBox v0.2.0 ⇒ v0.2.1
  [731e570b] + TiffImages v0.3.2
Precompiling project...
  39 dependencies successfully precompiled in 84 seconds (342 already precompiled)

SPGBox, the package that was to be updated, has only “Julia 1” as a dependency.

The thing is that for this kind of thing I am getting very frequent updates precompilations of CUDA, Flux and Plots, and particularly the first two are packages I do not use often. And these precompilations take too long to be ok in the middle of another work.

I know that I could be obsessive and work with different environments to avoid that, but that is quite annoying for daily use.

3 Likes

Pkg.update allows some control over what is updated — see its docs.

That said, from 1.6 onwards working with different (and even temporary) environments as necessary may be the best solution; I would not call is obsessive, just convenient.

It is a little bit messy for me. I would have to remember which was the environment where I had installed DelimitedFiles, or Flux, or whatever, or reinstall it in the temporary module each time.

1 Like

I also experienced this. Why would the default behavior be to update everything if that particular package has only one dependency? I find it unrelated to environments.

4 Likes

I’ve wondered about this too. It’s even been faster for me to update and then just immediately restart the REPL, especially when using packages with longer compile times.

The linked discourse thread was helpful. I’ll have to try playing around with the —preserve option.

1 Like

We run into the same problem.
We have a package MyPackage that has a dependency to package MyDependency.
Package MyPackage has a Manifest.toml.
Package MyDependency has no Manifest.toml.

We want to upgrade the version of B in MyPackage from version 0.7.0 to 0.7.1 by running (MyPackage) pkg > update MyDependency

Package MyDependency has no difference between version 0.7.0 and 0.7.1 in terms of dependency.

(MyPackage) pkg> update MyDependency
    Updating registry at `~/.julia/registries/General`
    Updating registry at `~/.julia/registries/MyJuliaRegistry`
    Updating git-repo `git@github.mycompany.com:risk/JuliaRegistry.git`
    Updating `/home/my_user/MyPackage.jl-debug-update/Project.toml`
  [c5dd4ef6] ↑ MyDependency v0.7.0 ⇒ v0.7.1
    Updating `/home/my_user/MyPackage.jl-debug-update/Manifest.toml`
  [fbe9abb3] ↑ AWS v1.67.0 ⇒ v1.71.0
  [324d7699] ↑ CategoricalArrays v0.10.1 ⇒ v0.10.2
  [d360d2e6] ↑ ChainRulesCore v1.10.1 ⇒ v1.11.1
  [9e997f8a] + ChangesOfVariables v0.1.1
  [34da2185] ↑ Compat v3.39.0 ⇒ v3.40.0
  [48062228] ↑ FilePathsBase v0.9.12 ⇒ v0.9.14
  [3587e190] ↑ InverseFunctions v0.1.1 ⇒ v0.1.2
  [2ab3a3ac] ↑ LogExpFunctions v0.3.4 ⇒ v0.3.5
  [1914dd2f] ↑ MacroTools v0.5.8 ⇒ v0.5.9
  [90014a1f] ↑ PDMats v0.11.1 ⇒ v0.11.3
  [c5dd4ef6] ↑ MyDependency v0.7.0 ⇒ v0.7.1
  [79098fc4] ↑ Rmath v0.6.1 ⇒ v0.7.0
  [c35d69d1] ↑ SMTPClient v0.6.0 ⇒ v0.6.1
  [91c51154] ↑ SentinelArrays v1.3.7 ⇒ v1.3.8
  [276daf66] ↑ SpecialFunctions v1.8.0 ⇒ v1.8.1
  [4c63d2b9] ↑ StatsFuns v0.9.12 ⇒ v0.9.13
  [81def892] ↑ VersionParsing v1.2.0 ⇒ v1.2.1
  [94ce4f54] ↑ Libiconv_jll v1.16.0+8 ⇒ v1.16.1+1
  [5ced341a] ↑ Lz4_jll v1.9.2+2 ⇒ v1.9.3+0
  [efe28fd5] ↑ OpenSpecFun_jll v0.5.3+4 ⇒ v0.5.5+0
  [f50d1b31] ↑ Rmath_jll v0.2.2+2 ⇒ v0.3.0+0
  [02c8fc9c] ↑ XML2_jll v2.9.10+3 ⇒ v2.9.12+0
  [3161d3a3] ↑ Zstd_jll v1.4.8+0 ⇒ v1.5.0+0
  [a9144af2] ↑ libsodium_jll v1.0.19+0 ⇒ v1.0.20+0
  [0dad84c5] ~ ArgTools v1.1.1 ⇒ 
  [56f22d72] ~ Artifacts v1.3.0 ⇒ 
  [f43a241f] ~ Downloads v1.5.1 ⇒ 
  [4af54fe1] ~ LazyArtifacts v1.3.0 ⇒ 
  [b27032c2] ~ LibCURL v0.6.3 ⇒ 
  [ca575930] ~ NetworkOptions v1.2.0 ⇒ 
  [fa267f1f] ~ TOML v1.0.3 ⇒ 
  [a4e569a6] + Tar
  [e66e0078] ~ CompilerSupportLibraries_jll v0.3.4+0 ⇒ 
  [deac9b47] ~ LibCURL_jll v7.70.0+2 ⇒ 
  [29816b5a] ~ LibSSH2_jll v1.9.0+3 ⇒ 
  [c8ffd9c3] ~ MbedTLS_jll v2.16.8+1 ⇒ 
  [14a3606d] ~ MozillaCACerts_jll v2021.1.19+0 ⇒ 
  [05823500] ~ OpenLibm_jll v0.7.1+0 ⇒ 
  [83775a58] ~ Zlib_jll v1.2.11+18 ⇒ 
  [8e850ede] ~ nghttp2_jll v1.40.0+2 ⇒ 
  [3f19e933] + p7zip_jll

Side note :
Pkg.update("MyDependency";level = UPLEVEL_PATCH) has kind of the same problem, it updates everything to the lastest minor version.