beniaminogreen / zoomerjoin

Superlatively-fast fuzzy-joins in R
https://beniamino.org/zoomerjoin/
GNU General Public License v3.0
103 stars 5 forks source link

Provide R package binaries? #85

Closed etiennebacher closed 1 year ago

etiennebacher commented 1 year ago

Hello again!

Installing zoomerjoin requires Rust and building the source locally. It would be very convenient to provide R binaries, either via R-universe of via Github releases (as polars does for example) so that one can just install the package in a couple of seconds without needing Rust.

beniaminogreen commented 1 year ago

Hi there, and thanks for your continued engagement with the package!

Providing a pre-built is also a goal of mine. In addition to being faster, it would also allow people who can't install Rust to use the package. I had looked at the CRAN policies for Rust packages and thought that they seemed to difficult to comply with, but it's good to know about R-universe and I will look into the process of using it.

Do you have any documentation or resources that you found useful in releasing polars and tidypolars to R-universe?

Best, and thanks for your help, Ben

etiennebacher commented 1 year ago

Regarding CRAN policies, they are indeed difficult to comply with for now for packages using Rust but it's not impossible, string2path or prqlr for example made their way to CRAN. They are some new functions in the development version of rextendr to generate the authors list for the crates you depend on. You might also consider joining the Discord of extendr where you can ask questions about CRAN requirements.

Regarding R-universe, you first need to setup your own one if it doesn't already exist. This is done with a specific github repo where you specify what packages your R-universe should contain (it can contain packages of other people). Here's mine for example: https://github.com/etiennebacher/etiennebacher.r-universe.dev. R-universe is updated every 3 or 4 hours. If I remember correctly, it should automatically build the package binaries for several platforms. I'm not the person who set up the whole thing in polars so maybe I forgot some stuff, but happy to discuss more about this if you need help.

There are also some info here: https://ropensci.org/blog/2021/06/22/setup-runiverse/

eitsupi commented 1 year ago

Based on my current experience with r-polars, I am trying to figure out how to automatically install the libs from the GitHub releases (eitsupi/prqlr#189, eitsupi/prqlr#191). Once these tasks are completed, I believe we will be able to do Rust-free installations on all major platforms with commands like Sys.setenv(NOT_CRAN="true"); remotes::install_github("eitsupi/prqlr"), even from GitHub.

beniaminogreen commented 1 year ago

Based on my current experience with r-polars, I am trying to figure out how to automatically install the libs from the GitHub releases (eitsupi/prqlr#189, eitsupi/prqlr#191). Once these tasks are completed, I believe we will be able to do Rust-free installations on all major platforms with commands like Sys.setenv(NOT_CRAN="true"); remotes::install_github("eitsupi/prqlr"), even from GitHub.

Looks like a great resource! I'll look into it and would be very receptive to a PR if you figure out how to make it work. In the meantime, I am working on deploying with R-universe, which seems to be building the package correctly for recent versions of R.

Are you able to install the package without Rust using the following command?

install.packages(
  'zoomerjoin', 
  repos = c('https://beniaminogreen.r-universe.dev', getOption("repos"))
)

I am working on testing it, but I only have Arch Linux machines that aren't supported by r-universe

etiennebacher commented 1 year ago

I already have Rust installed but the install.packages() code seems to work fine

beniaminogreen commented 1 year ago

Fantastic, thanks for verifying this! Closing this issue as resolved. @eitsupi, I can't speak to distributing the package using Github actions, but I was successful in setting up distribution with r-universe. If you think it looks promising, you could to compile your library with the edits I made to the src/Makevars.win file in #87, which ensure the correct rust targets are installed before trying to compile the binaries on Windows.

eitsupi commented 1 year ago

I made to the src/Makevars.win file in #87, which ensure the correct rust targets are installed before trying to compile the binaries on Windows.

R-universe doesn't need that. Because there is already the gnu target on the GitHub runner. See r-universe-org/help#219