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

Mounting filesystem images vignette unclear #24

Open
JosiahParry opened this issue Apr 3, 2024 · 1 comment
Open

Mounting filesystem images vignette unclear #24

JosiahParry opened this issue Apr 3, 2024 · 1 comment

Comments

@JosiahParry
Copy link
Contributor

The vignette for mounting file system images seems like it will help me understand how to build an R package for webr but im quite lost while reading it. It indicates that we should use rwasm::add_pkg() to build a package repo. Though the context is unclear.

To build an R package library image we must first build one or more Wasm R packages using `add_pkg()`. As an example, let's build a package with a few hard dependencies. Ensure that you are running R in an environment with access to Wasm development tools^[See the "Setting up the WebAssembly toolchain" section in `vignette("rwasm")` for further details.], then run:
```{r eval=FALSE}
rwasm::add_pkg("dplyr")
```

Should the rwasm be installed from pak into a webr interpreter? If so, how is that done? Should rwasm be used from a normal R session and then the output added into an active webr session?

If additional context about where these commands should be ran that would be very helpful!

@georgestagg
Copy link
Member

The vignette for mounting file system images seems like it will help me understand how to build an R package for webr but im quite lost while reading it.

Have you read the Getting Started document yet? It tries to lead you through creating a package repository and is targeted more towards beginners.

The "Mounting filesystem images" method is only really beneficial over creating a package repository if you have arbitrary data you'd like to include on the virtual filesystem. If you're only really interested in building R packages, you don't strictly need to build a full filesystem image with rwasm::make_vfs_library() and can do without the steps described in that vignette.

Should the rwasm be installed from pak into a webr interpreter?

No, rwasm should be installed in a traditional R system so that R packages can be cross-compiled for WebAssembly in an environment where the WebAssembly build tools are available. Hopefully, this is made clearer in the Getting Started document.

Should rwasm be used from a normal R session and then the output added into an active webr session?

Correct. Again, the Getting Started vignette describes both a "local testing" method and "static deployment" method to make the R packages available to webR.

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

No branches or pull requests

2 participants