Skip to content

Commit

Permalink
Ensure pak is installed to system library
Browse files Browse the repository at this point in the history
Includes workaround for r-wasm/webr#422.
  • Loading branch information
georgestagg committed May 7, 2024
1 parent ed18595 commit 83f5cb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions build-rwasm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
1 change: 0 additions & 1 deletion build-rwasm/code.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 83f5cb8

Please sign in to comment.