diff --git a/build-rwasm/Dockerfile b/build-rwasm/Dockerfile index ab6c7be..8821436 100644 --- a/build-rwasm/Dockerfile +++ b/build-rwasm/Dockerfile @@ -6,6 +6,10 @@ FROM $WEBR_IMAGE # Copies your code file from your action repository to the filesystem path `/` of the container COPY code.R /code.R +# TODO: Remove this workaround for r-wasm/webr#422 when no longer needed +RUN find /root/R/x86_64-pc-linux-gnu-library -maxdepth 2 -wholename '*/pak' -exec rm -rf {} \; +RUN /opt/R/current/bin/R -q -e 'install.packages("pak", lib = .Library)' + # Code file to execute when the docker container starts up (`entrypoint.sh`) ENTRYPOINT [ "Rscript" ] # ENTRYPOINT [ "/bin/bash", "-l", "-c" ] diff --git a/build-rwasm/code.R b/build-rwasm/code.R index 510b70f..2f5520f 100644 --- a/build-rwasm/code.R +++ b/build-rwasm/code.R @@ -31,7 +31,6 @@ if (is.character(strip) && length(strip) == 1 && strip == "NULL") strip <- NULL cat("\nArgs:\n") str(list(image_path = image_path, repo_path = repo_path, packages = packages, strip = strip)) -if (!require("pak", character.only = TRUE, quietly = TRUE)) install.packages("pak") if (!require("withr", character.only = TRUE, quietly = TRUE)) install.packages("withr") # Work in the GHA directory so that package reference 'local::.' works as expected