This is an automated email from the ASF dual-hosted git repository.

npr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e5d3e6f87 ARROW-16899: [R][CI] R nightly builds used old libarrow 
(#13411)
9e5d3e6f87 is described below

commit 9e5d3e6f87a6a3a4ae8384f68f60b7b739a72e45
Author: Jacob Wujciak-Jens <[email protected]>
AuthorDate: Fri Jun 24 18:13:02 2022 +0200

    ARROW-16899: [R][CI] R nightly builds used old libarrow (#13411)
    
    Authored-by: Jacob Wujciak-Jens <[email protected]>
    Signed-off-by: Neal Richardson <[email protected]>
---
 dev/tasks/macros.jinja          | 19 ++++++++++++++++---
 dev/tasks/r/github.packages.yml | 31 +++++++++----------------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja
index 4e7fc4cf35..03de66cbe1 100644
--- a/dev/tasks/macros.jinja
+++ b/dev/tasks/macros.jinja
@@ -293,6 +293,19 @@ on:
     shell: Rscript {0}
     run: |
       # getwd() is necessary as this macro is used within jobs using a docker 
container
-      tools::write_PACKAGES(file.path(getwd(), "/repo/src/contrib", fsep = 
"/"), type = "source", verbose = TRUE)
-  - run: ls -R repo
-{% endmacro %}
+      tools::write_PACKAGES(file.path(getwd(), "repo/src/contrib", fsep = 
"/"), type = "source", verbose = TRUE)
+  - name: Show repo 
+    shell: bash 
+    # tree not available in git-bash on windows
+    run: |
+      ls -R repo
+  - name: Add dev repo to .Rprofile
+    shell: Rscript {0}
+    run: |
+      str <- paste0("options(arrow.dev_repo ='file://", getwd(), "/repo' )")
+      print(str)
+      profile_path <- file.path(getwd(), ".Rprofile")
+      write(str, file = profile_path, append = TRUE)
+      # Set envvar for later steps by appending to $GITHUB_ENV 
+      write(paste0("R_PROFILE_USER=", profile_path), file = 
Sys.getenv("GITHUB_ENV"), append = TRUE)
+  {% endmacro %}
diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml
index 30afda4ffa..4f5caa0e1c 100644
--- a/dev/tasks/r/github.packages.yml
+++ b/dev/tasks/r/github.packages.yml
@@ -158,6 +158,8 @@ jobs:
       - name: Build Binary
         id: build
         shell: Rscript {0}
+        env:  
+          ARROW_R_DEV: TRUE
         run: |
           on_windows <- tolower(Sys.info()[["sysname"]]) == "windows"
 
@@ -166,17 +168,9 @@ jobs:
             type = "binary",
             repos = c("https://nightlies.apache.org/arrow/r";, 
"https://cloud.r-project.org";)
           )
-          remove.packages("arrow")
 
-          # Setup local repo
-          dev_repo <- paste0(
-            ifelse(on_windows, "file:", "file://"),
-            getwd(),
-            "/repo")
-          
-          # This is necessary to use the local folder as a repo in both
-          # install_arrow & tools/*libs.R
-          options(arrow.dev_repo = dev_repo)
+          cat("Remove old arrow version.\n")
+          remove.packages("arrow")
           
           # Build
           Sys.setenv(MAKEFLAGS = paste0("-j", parallel::detectCores()))
@@ -186,11 +180,12 @@ jobs:
             INSTALL_opts <- c(INSTALL_opts, "--strip")
           }
 
-         
+          cat("Install arrow from dev repo.\n")
           install.packages(
             "arrow",
             type = "source",
-            repos = dev_repo,
+            # The sub is necessary to prevent an error on windows.
+            repos = sub("file://", "file:", getOption("arrow.dev_repo")),,
             INSTALL_opts = INSTALL_opts
           )
 
@@ -248,15 +243,11 @@ jobs:
 
           # Add R-devel to PATH
           echo "/opt/R-devel/bin" >> $GITHUB_PATH
+
       {{ macros.github_setup_local_r_repo(true, false)|indent }}
-      - name: Set dev repo
-        shell: bash
-        run: |
-          # It is important to use pwd here as this happens inside a container 
so the 
-          # normal github.workspace path is wrong.
-          echo "options(arrow.dev_repo = 'file://$(pwd)/repo')" >> ~/.Rprofile
       - name: Install arrow from our repo
         env:
+          ARROW_R_DEV: TRUE
           LIBARROW_BUILD: "FALSE"
           LIBARROW_BINARY: "TRUE"
         shell: Rscript {0}
@@ -273,10 +264,6 @@ jobs:
         with:
           install-r: false
       {{ macros.github_setup_local_r_repo(false, false)|indent }}
-      - name: Set dev repo
-        shell: bash
-        run: |
-          echo "options(arrow.dev_repo = 'file://$(pwd)/repo')" >> ~/.Rprofile
       - name: Install arrow from nightly repo
         env:
           # Test source build so be sure not to download a binary

Reply via email to