JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
621 stars 269 forks source link

"add" updates unrelated dependencies #2643

Open PallHaraldsson opened 3 years ago

PallHaraldsson commented 3 years ago

If there are no dependencies (as here, not even a Project file), shouldn't "add" be quick, and not update anything?

Happened on Julia 1.6.0 (fixed on later 1.6? or 1.7, 1.8? Not sure).

I'm pretty sure I saw (completely unrelated) "Libiconv_jll v1.16.1+1" before it disappeared, that triggered 97 dependencies updated:

(@v1.6) pkg> add PlusPlus
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.6/Project.toml`
    Updating `~/.julia/environments/v1.6/Manifest.toml`
  Progress [========================================>]  102/102
  ? Makie
97 dependencies successfully precompiled in 82 seconds (384 already precompiled, 4 skipped during auto due to previous errors)
1 dependency failed but may be precompilable after restarting julia

I guess it could be ok to have it updated, since it was a minor version update, if that, it may have been from "Libiconv_jll v1.16.1+0". I'm not sure on which side of the + the zero was at. Anyway, if update can happen for any package (or maybe only JLL), then there could still be a bug/incompatibility in the updated version despite of semver. Mostly the wait is annoying.

I've experienced strange update before, if I recall with a Project file in case it matters, and not as here REQUIRE.

IanButterworth commented 3 years ago

Firstly, I'd recommend updating to 1.6.1 (and 1.6.2 when it comes out shortly). 1.6.1 fixed an overprinting bug in the output above which confuses the info printed. and the precompilation of loaded packages (Makie in your case) has improved a little in 1.6.2.

The garbled output above has hidden that the work being done during the Progress [========================================>] 102/102 is precompilation. It's not that the packages are being updated.

Somehow your system got into a state where it updated other packages previously, but Pkg didn't finish precompiling them. That could've happened if you ctrl-C-ed during precompilation, for instance.

In typical use, Pkg should be able to keep everything precompiled efficiently. Your experience above should be rare. The one exception is when you're using a new julia version, which will retrigger precompilation for all packages.