From 0628c5cc0f83f24860f7243552a95d46a1857964 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Fri, 8 Nov 2024 19:15:07 +0100 Subject: [PATCH] Test if pak hangs are fixed now --- Dockerfile | 11 +++++------ Rprofile | 31 +++++++++++-------------------- entrypoint.sh | 3 ++- 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3e46da..c296dc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,9 +32,9 @@ RUN CRANLIBS=$(curl https://r-universe.dev/stats/sysdeps/noble | jq --slurp -r ' apt-get clean all # Setup Node, Emscripten & webR -ENV PATH /opt/emsdk:/opt/emsdk/upstream/emscripten:$PATH -ENV EMSDK /opt/emsdk -ENV WEBR_ROOT /opt/webr +ENV PATH=/opt/emsdk:/opt/emsdk/upstream/emscripten:$PATH +ENV EMSDK=/opt/emsdk +ENV WEBR_ROOT=/opt/webr ENV R_LIBS_USER=/opt/R/current/lib/R/site-library @@ -42,9 +42,8 @@ ENV R_LIBS_USER=/opt/R/current/lib/R/site-library COPY Renviron /opt/R/current/lib/R/etc/Renviron.site COPY Rprofile /opt/R/current/lib/R/etc/Rprofile.site -# Install pak and rwasm -RUN R -e 'install.packages("pak")' -RUN R -e 'pak::pak("r-wasm/rwasm")' +# Use devel-pak (until solver hangs are fixed) +RUN R -e 'install.packages("pak", lib = .Library, repos = "https://r-lib.github.io/p/pak/devel/source/linux-gnu/x86_64")' # Set default shell to bash COPY entrypoint.sh /entrypoint.sh diff --git a/Rprofile b/Rprofile index 2a64ed5..c8c8ff5 100644 --- a/Rprofile +++ b/Rprofile @@ -4,26 +4,17 @@ local({ binary_universe <- function(universe){ sprintf("%s/bin/linux/%s/%s", universe, distro, r_branch) } - bioc_urls <- function(){ - ver <- utils:::.BioC_version_associated_with_R_version(); - c( - BioCsoft = sprintf("https://bioconductor.org/packages/%s/bioc", ver), - BioCann = sprintf("https://bioconductor.org/packages/%s/data/annotation", ver), - BioCexp = sprintf("https://bioconductor.org/packages/%s/data/experiment", ver) - ) - } - options(repos = c( - P3M = sprintf("https://p3m.dev/all/__linux__/%s/latest", distro), - BIOC = binary_universe("https://bioc.r-universe.dev"), - CRAN = "https://cloud.r-project.org", - CRANHAVEN = binary_universe("https://cranhaven.r-universe.dev"), - bioc_urls() - )) - options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os))) - my_universe <- Sys.getenv("MY_UNIVERSE") - if(nchar(my_universe)){ - options(repos = c(binaries = binary_universe(my_universe), universe = my_universe, getOption("repos"))) + # PAK adds cran/p3m automatically + repos <- c(BIOC = binary_universe("https://bioc.r-universe.dev")) + if(nchar(Sys.getenv("MY_UNIVERSE"))){ + repos <- c(repos, universe = binary_universe(Sys.getenv("MY_UNIVERSE"))) } -}) + options( + repos = repos, + HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os)) + ) + pak::repo_add(PPM = "PPM@latest") + # print(pak::repo_status()[,1:2]) +}) diff --git a/entrypoint.sh b/entrypoint.sh index 7d959e6..500cadf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,7 +27,8 @@ echo "::endgroup::" # For the GitHub Action if [ "$SOURCEPKG" ]; then # Workaround for pak resolver hangs - R -e "install.packages(sub('_.*', '', '${SOURCEPKG}'), depends=TRUE)" || true + # R -e "install.packages(sub('_.*', '', '${SOURCEPKG}'), depends=TRUE)" || true + R -e "pak::local_install('./${SOURCEPKG}')" R -e "rwasm::build('./${SOURCEPKG}')" BINARYPKG=${SOURCEPKG/.tar.gz/.tgz} echo "binarypkg=$BINARYPKG" >> $GITHUB_OUTPUT