How to pin a package to previous version on Julia 1.0?

question

#1

I was following this thread:

But wanted to ask something very specific. Now that 1.0 is released, how can I pin a package to a specific, older version? Here’s a concrete example. On Julia v0.6.4, the following works:

Pkg.pin("Blink", v"0.6.2")
Pkg.pin("PlotlyJS", v"0.10.2")

How could one accomplish the same behavior on Julia v1.0.0 ?


#2

Thats what the help says (on 0.7):

(v0.7) pkg> ?pin
  pin pkg[=uuid] ...

  Pin packages to given versions, or the current version if no version is
  specified. A pinned package has its version fixed and will not be upgraded
  or downgraded. A pinned package has the symbol ⚲ next to its version in the
  status list.

(v0.7) pkg> 

So if you have Blink v0.6.2 and PlotlyJS v0.10.2 installed,

pin Blink
pin PlotlyJS

should be sufficient.


#3

That makes sense. How can I resolve the uuid of v"0.6.2" of Blink and v"0.10.2" of PlotlyJS?


#4

If you just want to pin the current version the uuid is not required.


#5

That makes sense as well. But what if I want to pint to a specific, older version of the code?


#6

The uuid refers to the package, not the version. If you want to pin a specific version, use add to obtain it, then pin to pin it.

(v0.7) pkg> add Blink
[...]

(v0.7) pkg> st
    Status `~/.julia/environments/v0.7/Project.toml`
  [ad839575] Blink v0.7.0

(v0.7) pkg> add Blink@0.6.2
 Resolving package versions...
  Updating `~/.julia/environments/v0.7/Project.toml`
  [ad839575] ↓ Blink v0.7.0 ⇒ v0.6.2
  Updating `~/.julia/environments/v0.7/Manifest.toml`
  [ad839575] ↓ Blink v0.7.0 ⇒ v0.6.2
[...]

(v0.7) pkg> st
    Status `~/.julia/environments/v0.7/Project.toml`
  [ad839575] Blink v0.6.2

(v0.7) pkg> pin Blink
 Resolving package versions...
  Updating `~/.julia/environments/v0.7/Project.toml`
  [ad839575] ~ Blink v0.6.2 ⇒ v0.6.2 ⚲
  Updating `~/.julia/environments/v0.7/Manifest.toml`
  [ad839575] ~ Blink v0.6.2 ⇒ v0.6.2 ⚲

(v0.7) pkg> st
    Status `~/.julia/environments/v0.7/Project.toml`
  [ad839575] Blink v0.6.2 ⚲

#7

I tried this as I need package “GDAL” of version 0.1.2 pinned in Julia 0.7. But it does not work as expected.

(v0.7) pkg> add GDAL@0.1.2
Resolving package versions…
Updating ~/.Julia/environments/v0.7/Project.toml [add2ef01] + GDAL v0.2.0 updating~/.Julia/environments/v0.7/Manifest.toml`

strange behavior?


#8

You are posting the same question in multiple places. There is no need for that.


#9

oh. Thank you for letting me know. I will delete one if I get a solution.


#10

No need to delete it now. The reason for this is to prevent people putting time into answering your question, when it might have already been answered elsewhere.

Short answer is you first have to add the package before pinning it, for full answer see: https://stackoverflow.com/a/54216576/2875964