posit-dev / r-shinylive

https://posit-dev.github.io/r-shinylive/
Other
156 stars 16 forks source link

Support for R4.4: can't install packages from wasm CRAN build with R4.4 #77

Closed DivadNojnarg closed 5 months ago

DivadNojnarg commented 5 months ago

I am maintaining a wasm CRAN-like which was build from GA with R4.3 few weeks ago using the r-wasm/actions flow from @georgestagg: https://github.com/RinteRface/rinterface-wasm-cran.

I updated it today and since R4.4 was released recently, my WASM repo is now built with R4.4. shinylive depends on older webr version (webR only supports R4.4.0 since recently https://github.com/r-wasm/webr/commit/28077f533596b5ab706c5fa2178ddfe737eeadde). Therefore, shinylive still runs R4.3 (there are references to R4.3 such as in webr::install):

webr::install
function (packages, repos = NULL, info = NULL, lib = NULL, quiet = FALSE, 
    mount = TRUE) 
{
    ...
    contrib <- gsub("repo.r-wasm.org/bin/emscripten/contrib/4.3", 
        "repo.r-wasm.org/bin/emscripten/contrib/4.3.3", contrib, 
        fixed = TRUE)
...
}
getRversion()
[1] ‘4.3.3’

which prevents from retrieving and installing the package from my CRAN like.

Here is the shinylive link to reproduce.

I currently can't release shinyMobile 2.0.0 since most vignettes have running shinylive examples.

DivadNojnarg commented 5 months ago

For the time being, as a very dirty workaround (to allow me to continue to work on the writing), I can hardcode the R version in webr::install such that:

custom_install <- function (packages, repos = NULL, info = NULL, lib = NULL, quiet = FALSE, 
    mount = TRUE) 
{
    if (is.null(lib)) {
        lib <- .libPaths()[[1]]
    }
    if (is.null(repos)) {
        repos <- getOption("webr_pkg_repos")
    }
    ver <- "4.4.0"
...
DivadNojnarg commented 5 months ago

Closing as wrong repository (got confused with shinylive)