# Plots downgraded GR to 0.52 for no good reason

**URL:** <https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115>\
**Category:** General Usage\
**Tags:** pkg, plots, gr\
**Created:** [May 31, 2021, 8:22am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115 "2021-05-31T08:22:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [May 31, 2021, 8:22am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/1 "2021-05-31T08:22:58Z")

</div>

I’m a person who does `] up` all the time, today I found the Plots.jl is downgrading GR.jl back to 0.52 for no reason.  
If I go to `] dev Plots`, and remove older versions of GR in [compat], keeps only the latest 0.57, and `] up` can successfully install GR 0.57.5, the latest version.  
From this experiment, there is no conflict or compact request to make it use GR 0.52, so why it’s using an old 0.52 version rather than latest 0.57?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 31, 2021, 9:26am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/2 "2021-05-31T09:26:06Z")

</div>

Try

```julia
pkg> add Plots@whatever-the-latest-version-is

```

and the error message will tell you what’s holding it back.

---

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [May 31, 2021, 9:33am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/3 "2021-05-31T09:33:03Z")

</div>

Plots.jl is the latest version, but GR is not, which is required by Plots.jl.  
I tried `add Plots@1.15.2` on a new empty environment, the GR is still 0.52, no any error message.

---

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [May 31, 2021, 9:34am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/4 "2021-05-31T09:34:02Z")

</div>

It seems that although GR 0.57 and 0.52 are all compatible, but 0.52 is preferred than 0.57.  
So if you just add Plots like normal, the old 0.52 of GR get installed

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 31, 2021, 9:51am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/5 "2021-05-31T09:51:20Z")

</div>

So what happens when you try to add the latest GR?

---

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [May 31, 2021, 9:51am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/6 "2021-05-31T09:51:31Z")

</div>

Also I tried to add GR@0.57.5, it also has no error at all.

```julia
    Updating `C:\Users\zhang\Project\CorticalSpikingNetwork.jl\Project.toml`
  [28b8d3ca] ↑ GR v0.52.0 ⇒ v0.57.5
    Updating `C:\Users\zhang\Project\CorticalSpikingNetwork.jl\Manifest.toml`
  [c87230d0] ↑ FFMPEG v0.3.0 ⇒ v0.4.0
  [28b8d3ca] ↑ GR v0.52.0 ⇒ v0.57.5
  [cd3eb016] ↑ HTTP v0.8.19 ⇒ v0.9.9
  [5c2747f8] + URIs v1.3.0
  [6e34b625] ↓ Bzip2_jll v1.0.8+0 ⇒ v1.0.6+5
  [83423d85] ↓ Cairo_jll v1.16.1+0 ⇒ v1.16.0+6
  [b22a6f82] ↓ FFMPEG_jll v4.4.0+0 ⇒ v4.3.1+4
  [a3f928ae] ↓ Fontconfig_jll v2.13.93+0 ⇒ v2.13.1+14
  [d7e528f0] ↓ FreeType2_jll v2.10.4+0 ⇒ v2.10.1+5
  [0656b61e] + GLFW_jll v3.3.4+0
  [d2c73de3] + GR_jll v0.57.3+0
  [3b182d85] - Graphite2_jll v1.3.14+0
  [2e76f6c2] - HarfBuzz_jll v2.8.1+0
  [aacddb02] + JpegTurbo_jll v2.1.0+0
  [dd192d2f] + LibVPX_jll v1.10.0+0
  [7e76a0d4] + Libglvnd_jll v1.3.0+3
  [89763e89] + Libtiff_jll v4.3.0+0
  [ea2cea3b] + Qt5Base_jll v5.15.2+0
  [a2964d1f] + Wayland_jll v1.17.0+4
  [2381bf8a] + Wayland_protocols_jll v1.18.0+4
  [935fb764] + Xorg_libXcursor_jll v1.2.0+4
  [d091e8ba] + Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] + Xorg_libXi_jll v1.7.10+4
  [d1454406] + Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] + Xorg_libXrandr_jll v1.5.2+4
  [cc61e674] + Xorg_libxkbfile_jll v1.1.0+4
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] + Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] + Xorg_xkeyboard_config_jll v2.27.0+4
  [0ac62f75] ↓ libass_jll v0.15.1+0 ⇒ v0.14.0+4
  [f638f0a6] ↓ libfdk_aac_jll v2.0.2+0 ⇒ v0.1.6+4
  [1270edf5] ↓ x264_jll v2021.5.5+0 ⇒ v2020.7.14+2
  [dfaa095f] ↓ x265_jll v3.5.0+0 ⇒ v3.0.0+3
  [d8fb68d0] + xkbcommon_jll v0.9.1+5

```

---

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [May 31, 2021, 10:08am UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/7 "2021-05-31T10:08:21Z")

</div>

So is Pkg decide the priority by how many packages get updated and how many get downgraded?  
Because from 0.52 → 0.57, there are only 4 get updated, but 9 get downgraded, so 0.52 is preferred?

Maybe Pkg should consider the priority by level of dependency rather than total number.  
Since the packages get downgraded are not direct dependencies of Plots.jl, but the upgraded ones are indeed direct dependency. Keep the direct dependency more updated is more reasonable isn’t it?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 31, 2021, 12:05pm UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/8 "2021-05-31T12:05:04Z")

</div>

There are various options for the resolver, see

[https://pkgdocs.julialang.org/dev/api/#Pkg.add](https://pkgdocs.julialang.org/dev/api/#Pkg.add)

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 31, 2021, 12:13pm UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/9 "2021-05-31T12:13:58Z")

</div>

> [@ChunXi\_Zhang](#):
>
> So is Pkg decide the priority by how many packages get updated and how many get downgraded?  
> Because from 0.52 → 0.57, there are only 4 get updated, but 9 get downgraded, so 0.52 is preferred?

If there are multiple “pareto optimal” solutions you will just get one of them. If you need specific version of packages you ensure that by using the `compat` section in the project file. For example, if you need `0.57` you can add:

```julia
[compact]
GR = "0.57"

```

to your project file of the current project.

---

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [May 31, 2021, 12:52pm UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/10 "2021-05-31T12:52:05Z")

</div>

I’m suggesting that having direct dependency fall behind by a large number is much worse than having indirect dependency fall behind by a bit.  
The choice of using `GR@0.52` should not be a “pareto optimal” solution in this scenario.

Btw the choice is not like this few days before, since `GR@0.52` is not usable due to a bug that makes the plotting very very small in Pluto, it would be obvious to find it. I checked the `Project.toml` of `Plots` and `GR`, didn’t find anything that could cause this. So it’s some even more basic dependency that causes the change of choice.

Imagine a new user of julia come and use the Plots in Pluto, and find that the plotting extremely small, and with a lot searching, and find out it was a long fixed bug, but for some reason it’s not the latest version by default, and there is no incompatible issue at all, and he should add an explicit compat entry in the toml and carefully maintaining that config in the future.

Plots should remove some older version in [compact], and Pkg maybe should optimize the strategy to choose a optimal solution more wisely.

Also from [Packages downgraded after `Pkg.update()`? · Issue #2550 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/2550#issuecomment-841728987) I found there is a log of how Pkg decide which version to choose when there is no choice left, can I print that when there is multiple choices?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 31, 2021, 1:52pm UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115/11 "2021-05-31T13:52:21Z")

</div>

> [@ChunXi\_Zhang](#):
>
> but for some reason it’s not the latest version by default, and there is no incompatible issue at all, and he should add an explicit compat entry in the toml and carefully maintaining that config in the future.

Yes, that situation is not ideal. The suggestion for compat was more a way to directly deal with the current situation, not a way to say that the situation is perfect as is.

> [@ChunXi\_Zhang](#):
>
> Pkg maybe should optimize the strategy to choose a optimal solution more wisely.

This is a good suggestion, it’s mostly a question of someone willing to do the work.
