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

Installation from r-universe emits an error about PACKAGES.rds #435

Open
helgasoft opened this issue Jun 9, 2024 · 2 comments
Open

Installation from r-universe emits an error about PACKAGES.rds #435

helgasoft opened this issue Jun 9, 2024 · 2 comments

Comments

@helgasoft
Copy link

Appreciation and gratitude for your work, WebR is a gamechanger ! 🏆
I have two questions related to installation.

Wondering how often those 20K binary repo packages are re-compiled to WebAssembly. Is there some trigger by package, or a general update schedule for all packages (monthly, etc.), or is it a non-scheduled batch job ?

There is a footnote in the docs about an alternative repo called r-universe. Looks good indeed and they recompile really fast the latest package version when published. But trying to install from them I got and reported an error. Here is the code:

var webR;
import('https://webr.r-wasm.org/latest/webr.mjs').then(async ({ WebR }) => {
  webR = new WebR();
  await webR.init();
  // ok, but gets older version from repo.r-wasm.org :
  // await webR.installPackages(["echarty"])  

  // trying to get the latest version
  await webR.installPackages(["echarty"], {repos:'https://helgasoft.r-universe.dev'});  
ERROR 404:
https://helgasoft.r-universe.dev/bin/emscripten/contrib/4.4/PACKAGES.rds
Unsupported PACKAGES format: rds

To summarize the issue - repo.r-wasm.org works fine, but packages are not updated often, r-universe.dev has quick updates, but generates some installation error.

@georgestagg
Copy link
Member

Wondering how often those 20K binary repo packages are re-compiled to WebAssembly.

It's currently a non-scheduled batch job. Updates follow CRAN versions of packages but on a much slower release frequency. I can also update individual packages on request.


AFAICT it doesn't look like r-universe generates a PACKAGES.rds file, leading to the 404 error. However, R has fallback options, PACKAGES.gz and PACKAGES, which do exist. So, despite the error message, R should have continued on and loaded the package list from one of the fallback options.

For me, at least in a web browser, when I run

await webR.installPackages(["echarty"], {repos:'https://helgasoft.r-universe.dev'});
await webR.installPackages(["dplyr", "htmlwidgets", "data.tree"]);

The error is generated, but R continues to download using the fallback option and once complete I can successfully run

library(echarty)

I will try to think if there is some better way to raise and report the network error in this context.

@georgestagg georgestagg added the question Further information is requested label Jun 10, 2024
@georgestagg georgestagg changed the title installation from binary repos Installation from r-universe emits an error about PACKAGES.rds Jun 18, 2024
@georgestagg georgestagg removed the question Further information is requested label Jun 18, 2024
@helgasoft
Copy link
Author

despite the error message, R should have continued on and loaded the package list from one of the fallback options.

Yes, correct.     Just FYI some performance data, o3 are (dplyr, htmlwidgets, data.tree)

loading elapsed ms
echarty only from r-wasm (o3 auto-loaded as dependencies) 7,354
echarty from r-universe, o3 from r-wasm (your example) 7,976
echarty and o3 (one-by-one), all from r-universe 12,784

So loading from r-wasm is almost twice as fast as r-universe (at least from my PC and location).
BTW, thanks for updating echarty to the latest version 🤙

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