jonkeane commented on a change in pull request #12745:
URL: https://github.com/apache/arrow/pull/12745#discussion_r838574315



##########
File path: .github/workflows/r.yml
##########
@@ -329,12 +329,37 @@ jobs:
         if: ${{ matrix.config.rtools == 35 }}
         shell: Rscript {0}
         run: install.packages("cpp11", type = "source")
+      - name: Prune dependencies (on R 3.6)
+        if: ${{ matrix.config.rtools == 35 }}
+        shell: Rscript {0}
+        run: |
+            # To prevent the build from timing out, let's prune some optional 
deps (and their possible version requirements)
+            setwd("r")
+            # create a backup to use later
+            file.copy("DESCRIPTION", "DESCRIPTION.bak")
+            d <- read.dcf("DESCRIPTION")
+            to_prune <- c("duckdb", "DBI", "dbplyr", "decor", "knitr", 
"rmarkdown", "pkgload", "reticulate")
+            pattern <- paste0("\\n?", to_prune, "( \\([^,]*\\))?,?", collapse 
= "|")
+            d[,"Suggests"] <- gsub(pattern, "", d[,"Suggests"])
+            write.dcf(d, "DESCRIPTION")
+      - name: Restore R package cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ${{ env.R_LIBS_USER }}/*
+          key: ${{ steps.get-version.outputs.os-version }}-${{ 
steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ 
hashFiles('r/DESCRIPTION') }}
+          restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ 
steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-
       - name: Install R package dependencies
         shell: Rscript {0}
         run: |
           # options(pkgType="win.binary") # processx doesn't have a binary for 
UCRT yet
           install.packages(c("remotes", "rcmdcheck"))
           remotes::install_deps("r", dependencies = TRUE)
+      - name: Restore DESCRIPTION for 3.6

Review comment:
       The checks will warn (and therefor fail the build) if the DESCRIPTION 
file doesn't include packages that we reference in the code, so this restores 
the unedited file for checking.
   
   Ultimately, we might not want to do anything with the editing, just use 
caching to speed up the dependency installation but still install all of them. 
But I was curious what the difference in time was + trying to get even the 
first run as quick as possible at first




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to