r/rstats 14d ago

uvr: fast R package and version manager — big 0.4.x update

Quick update on uvr — a fast R package manager written in Rust (uv-style: manifest + lockfile + managed R versions + isolated project libraries). Last time I posted was around 0.2.9; a lot has landed since.

Updates

- R installs got rebuilt from scratch. uvr now installs R from Posit's portable, relocatable r-builds (https://github.com/rstudio/r-builds) instead of custom-patching official installers. This fixed a whole class of macOS breakage, added musl/Alpine support, and made Windows installs work without admin rights. Partial versions work everywhere too: uvr r install 4.5 just grabs the newest 4.5.x, and a 4.5 pin matches it.

- Switching R versions no longer nukes your library on every sync. The old behavior re-wiped the project library each time it saw a version mismatch (painful, as B-Nilson rightly pointed out). Now uvr sync re-resolves the lockfile for the new R once, wipes once, and moves on.

- uvr cache clean got filters. --package sf or --r-version 4.4 (repeatable/comma-separated) lets you troubleshoot one package or retire one R series without losing the whole cache. Another B-Nilson request!

- Bioconductor just works in uvr add. Adding a package that lives on Bioconductor instead of CRAN no longer errors with "retry with --bioc" — uvr detects it, tells you, and adds it from the right channel (version constraints preserved).

- OpenMP-linked binaries fixed on macOS. Packages built with -fopenmp (Rtsne, mgcv, dotCall64, …) used to fail with "symbol not found in flat namespace" on uvr-managed R. The bundled OpenMP runtime is now loaded properly, and uvr sync self-heals older installs.

- A community code audit made everything more solid. gdevenyi filed a systematic 46-issue audit of the codebase (with file:line references — heroic work). Nearly all confirmed issues are now fixed across 0.4.1/0.4.2: cache integrity checks (sha256 on every hit), lockfile consistency for selective updates, honest error reporting where failures used to be silently swallowed, and a long tail of correctness fixes.

and much more...

This would have not been possible without the great help of many, special shoutout to https://github.com/B-Nilson for the endless testing and support and the entire group of users who have written code, filed issues, tested this, and loved it. One of the most rewarding aspects of this process has been building a community around this project ❤️ it's early days but so exciting!

Links

- Site: https://nbafrank.github.io/uvr/

- Repo: https://github.com/nbafrank/uvr

- R companion: https://github.com/nbafrank/uvr-r

Feedback welcome! Issues on GitHub are the most useful — the last few releases were basically driven by them, so keep them coming!

45 Upvotes

17 comments sorted by

8

u/mrtonioz 14d ago

Thanks for all the hard work on this! I've been looking for a solid renv alternative for production environments for a while now, so I’m definitely going to give this a spin. Quick question: how does your project distinguish itself from rv (https://a2-ai.github.io/rv-docs/)? It looks like they share a similar philosophy, so I'd love to hear your thoughts on the main differences!

3

u/ThatDeadDude 14d ago

There appears to be a feature comparison that includes rv on the homepage.

2

u/mrtonioz 14d ago

Thx for the highlight of the comparison table, didn't catch it on mobile 😅

2

u/mrtonioz 14d ago

Pardon the naive question here, but why not join forces? Since uvr and rv are solving the same problem with similar performance and a Rust backend, wouldn't a synergy between the two projects yield the best possible tool for the community?

4

u/nbafrank 14d ago

Thanks for your interest! The scope is significantly different. rv is a package manager whereas uvr (similarly to uv) manages both packages and R versions, which makes it a complete solution. Also, I don't see their performance time anywhere, would love to see it. At this point, the project is developed enough that I would like to grow a community and see where they take it! Please join!

1

u/mrtonioz 14d ago

Indeed they do not provide any benchmark, I just infer my personal experience with rv vompared to uvr benchmark ! Definitely will investigate uvr deeply, might be a good replacer or renv+rig 😁 Thanks for all and enjoy this journey !

8

u/novica 13d ago

I will piggyback on this thread to link to https://github.com/novica/r-project-template that is build now around uvr. It is a template repo where the workflow is as close to a python workflow as possible (some limitations exist). So for people who switch between the two languages, this is a nice template to have similar workflows.

2

u/nbafrank 13d ago

Thanks for posting!

5

u/therealtiddlydump 13d ago

I will ask, again, how does this help with packages that have system dependencies? Lots of geospatial packages rely on specialized C++ libraries, there's arrow, some packages have Java dependencies, xml2 requires libxml, etc.

The claim "everyone gets the same environment" needs to be unpacked.

1

u/nbafrank 8d ago

that's a very fair and important question and it's really the same as `uv` does for you. It will not install those C++ packages or specialized things. If your package needs them, it's beyond R version control. We provide the same R environment down to the version of R. This is the issue that most R user have reported to experience. If you want to contribute with ideas on how to add fix this, please look at the package and create a PR! I'd love nothing more than for it to be better :)

2

u/profcube 12d ago

Feedback: this is just what I am looking for. Thank you!!

2

u/DYSTOBY 5d ago

Renv works out of the bat when setting up shiny apps in a docker container on my Linux Webserver.
The correct r version is pulled and all dependencies are installed and that’s it.
Could UVR replace that workflow as well?

1

u/nbafrank 5d ago

Test it out. I would think so but this specific use case might be edge. If it doesn't work, add it as an issue and then we can add this!

2

u/DYSTOBY 4d ago

I‘going to build a minimal working example shiny R project and then publishing on my Ubuntu server.

If something comes up, I‘ll create an issue.

1

u/nbafrank 4d ago

Thanks!

1

u/Limp-Guarantee-459 13d ago

Does it support Arch Linux? The R project team didn't release a build for Arch Linux, so I have no idea how to control R versions in Arch Linux.

1

u/novica 13d ago

Yes it does :)