Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to name or add tags to installation #129

Closed
MLKaufman opened this issue Nov 11, 2022 · 5 comments
Closed

Ability to name or add tags to installation #129

MLKaufman opened this issue Nov 11, 2022 · 5 comments

Comments

@MLKaufman
Copy link

Thanks for all the hard work on this tool! The ability to name the installed versions of R while using the rig add command would be great. This would allow multiple installs of the same version. I was previously able to do this with R Switch. Rig already sort of does this when installing the arm64 version of R side by side with the x86 version.

It might look something like this:

rig list
* name                version    aliases
------------------------------------------
  4.1-seurat          (R 4.1.2)  
  4.1-spatial         (R 4.1.2)  
  4.1-spotlight       (R 4.1.2)  
  4.2                 (R 4.2.2)  release
* 4.2-arm64           (R 4.2.2)  
  4.2-bc4.15-spatial  (R 4.2.0)  
@gaborcsardi
Copy link
Member

Hmmmm, this seems hard to do on macOS, actually, so I am curious how rswitch was supporting this.

@gaborcsardi
Copy link
Member

gaborcsardi commented Nov 13, 2022

So, this is difficult, because the CRAN R and package builds use a fixed link path, so even if you move R to a different directory, the shared libs in R and in the R packages will point to the default one:

❯ otool -L /Users/gaborcsardi/Library/R/arm64/4.2/library/cli/libs/cli.so
/Users/gaborcsardi/Library/R/arm64/4.2/library/cli/libs/cli.so:
	cli.so (compatibility version 0.0.0, current version 0.0.0)
	/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libR.dylib (compatibility version 4.2.0, current version 4.2.2)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)

It is possible to update the link path, but you would have to do it for every package (with compiled code) after installation. Plus the tools that compile code, like Rcpp::cppFunction() would still not work.

This is why I am wondering how you did this with Rswitch.

@MLKaufman
Copy link
Author

With R Switch I opened the Frameworks folder and manually renamed the folder. I was able to switch between them afterwards no problem. Perhaps something in the internals wasn't fully switched over that I didn't notice? I am not the biggest R user. I didn't have any problems with package versions though. Everything seemed to be an isolated environment with different installed packages. This was with x86 R and Rosetta, haven't tried it with the arm64 versions of R yet.

@gaborcsardi
Copy link
Member

Perhaps something in the internals wasn't fully switched over that I didn't notice? I am not the biggest R user. I didn't have any problems with package versions though. Everything seemed to be an isolated environment with different installed packages.

Yeah, those installations are not independent. See the link paths in my comment above. As long as you install the same package versions in the different libraries, they will probably work, but as soon as you install different versions, you'll get undefined behavior.

If you just want several independent libraries for an R version, rig can help you with that, see rig lib --help.

@MLKaufman
Copy link
Author

Good to know. Yeah I have been testing out rig lib. So far so good! Thanks for the working on rig!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants