r-lib / rig

The R Installation Manager
MIT License
629 stars 22 forks source link

How to add existing R installation to rig #224

Open JosiahParry opened 5 months ago

JosiahParry commented 5 months ago

I presently have 2 versions of R installed 4.3 and 4.4. However rig only knows about the 4.4 version. I tried running rig add but this started to install a new version of 4.3. Rather, I'd like to be able to run a command like rig system discover

josiahparry@Josiahs-MBP-2 ~ % rig ls
* name       version    aliases
------------------------------------------
* 4.4-arm64  (R 4.4.0)  
josiahparry@Josiahs-MBP-2 ~ % ll /Library/Frameworks/R.framework/Versions
total 16
drwxrwxr-x  6 root  admin   192 Apr 13 08:50 .
drwxrwxr-x  9 root  admin   288 Apr 13 08:50 ..
-rw-rw-r--@ 1 root  admin  6148 Jan  6 07:35 .DS_Store
drwxrwxr-x  4 root  admin   128 Apr 13 08:50 4.3-arm64
drwxrwxr-x  6 root  admin   192 Apr 13 08:50 4.4-arm64
lrwxrwxr-x  1 root  admin     9 Apr 13 08:50 Current -> 4.4-arm64
gaborcsardi commented 5 months ago

I am not sure why the previous installation would be missing, but you can try running this:

rig system forget
rig system make-orthogonal
rig system make-links
JosiahParry commented 5 months ago

No dice. If I run rig add will it replace my packages for 4.3? Or is it same to use rig to reinstall 4.3?

image
gaborcsardi commented 5 months ago

I don't know, it is hard to guess in what state your installations are in. Look around and see if 4.3-arm64 is working at all, e.g. set the Current link back to that and try start it up.

JosiahParry commented 3 weeks ago

@gaborcsardi do you know where I can find the logic that rig uses to find existing installs? Perhaps I can make a PR that checks other default locations as well

gaborcsardi commented 3 weeks ago

Here: https://github.com/r-lib/rig/blob/140115c9b565167670cfc6f303e6c968c563db98/src/macos.rs#L29

But why not just reinstall it with rig? It literally takes a two minutes....