This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 21626ff chore(r): Add R library verification to source verification
script (#515)
21626ff is described below
commit 21626ff2829cbaa701d093330a009aa9fedaa9db
Author: Dewey Dunnington <[email protected]>
AuthorDate: Thu Mar 16 16:32:30 2023 -0400
chore(r): Add R library verification to source verification script (#515)
This PR adds the R packages into the bash-based verification script. The
general idea is to run `R CMD INSTALL` then `R CMD check` on both
packages but the bash is fairly verbose. My shell scripting is rather
new and while I tried to follow patterns elsewhere I imagine there are
improvements that could be made.
I didn't attempt Windows, mostly just because my PowerShell is
non-existent. In theory the same set of commands would work.
---
.github/workflows/verify.yml | 8 +++++++-
ci/conda_env_r.txt | 22 ++++++++++++++++++++++
dev/release/verify-release-candidate.sh | 29 +++++++++++++++++++++++++++++
r/adbcdrivermanager/DESCRIPTION | 1 -
r/adbcdrivermanager/configure | 2 +-
r/adbcsqlite/.Rbuildignore | 1 +
r/adbcsqlite/configure | 2 +-
7 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 6e5d741..fbde892 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -30,6 +30,13 @@ on:
required: false
type: string
default: ""
+ pull_request:
+ branches:
+ - main
+ paths:
+ - '.github/workflows/verify.yml'
+ - 'dev/release/verify-release-candidate.sh'
+ - 'dev/release/verify-release-candidate.ps1'
permissions:
contents: read
@@ -37,7 +44,6 @@ permissions:
jobs:
binary-unix:
name: "Verify Binaries/${{ matrix.os }}"
- if: inputs.version != '' && inputs.rc != ''
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
diff --git a/ci/conda_env_r.txt b/ci/conda_env_r.txt
new file mode 100644
index 0000000..0634096
--- /dev/null
+++ b/ci/conda_env_r.txt
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+compilers
+libsqlite
+libpq
+pkg-config
+r-testthat
diff --git a/dev/release/verify-release-candidate.sh
b/dev/release/verify-release-candidate.sh
index ee5a5d7..6acf859 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -466,6 +466,31 @@ test_python() {
"${ADBC_SOURCE_DIR}/ci/scripts/python_test.sh" "${ADBC_SOURCE_DIR}"
"${ARROW_TMPDIR}/python-build" "${install_prefix}"
}
+test_r() {
+ show_header "Build and test R libraries"
+
+ maybe_setup_conda --file "${ADBC_SOURCE_DIR}/ci/conda_env_r.txt" || exit 1
+
+ rm -rf "${ARROW_TMPDIR}/r"
+ mkdir "${ARROW_TMPDIR}/r"
+ mkdir "${ARROW_TMPDIR}/r/tmplib"
+
+ R_LIBS_USER="${ARROW_TMPDIR}/r/tmplib" R -e 'install.packages("nanoarrow",
repos = "https://cloud.r-project.org/")' --vanilla
+ R_LIBS_USER="${ARROW_TMPDIR}/r/tmplib" R -e 'if
(!requireNamespace("testthat", quietly = TRUE)) install.packages("testthat",
repos = "https://cloud.r-project.org/")' --vanilla
+ R CMD INSTALL "${ADBC_SOURCE_DIR}/r/adbcdrivermanager" --preclean
--library="${ARROW_TMPDIR}/r/tmplib"
+ R CMD INSTALL "${ADBC_SOURCE_DIR}/r/adbcsqlite" --preclean
--library="${ARROW_TMPDIR}/r/tmplib"
+
+ pushd "${ARROW_TMPDIR}/r"
+ R CMD build "${ADBC_SOURCE_DIR}/r/adbcdrivermanager"
+ R CMD build "${ADBC_SOURCE_DIR}/r/adbcsqlite"
+ local -r adbcdrivermanager_tar_gz="$(ls adbcdrivermanager_*.tar.gz)"
+ local -r adbcsqlite_tar_gz="$(ls adbcsqlite_*.tar.gz)"
+
+ R_LIBS_USER="${ARROW_TMPDIR}/r/tmplib" R CMD check
"${adbcdrivermanager_tar_gz}" --no-manual
+ R_LIBS_USER="${ARROW_TMPDIR}/r/tmplib" R CMD check "${adbcsqlite_tar_gz}"
--no-manual
+ popd
+}
+
test_glib() {
show_header "Build and test C GLib libraries"
@@ -609,6 +634,9 @@ test_source_distribution() {
if [ ${TEST_PYTHON} -gt 0 ]; then
test_python
fi
+ if [ ${TEST_R} -gt 0 ]; then
+ test_r
+ fi
popd
}
@@ -759,6 +787,7 @@ test_jars() {
: ${TEST_PYTHON:=${TEST_SOURCE}}
: ${TEST_JS:=${TEST_SOURCE}}
: ${TEST_GO:=${TEST_SOURCE}}
+: ${TEST_R:=${TEST_SOURCE}}
# Automatically test if its activated by a dependent
TEST_CPP=$((${TEST_CPP} + ${TEST_GO} + ${TEST_GLIB} + ${TEST_PYTHON}))
diff --git a/r/adbcdrivermanager/DESCRIPTION b/r/adbcdrivermanager/DESCRIPTION
index 18085e6..06ecc02 100644
--- a/r/adbcdrivermanager/DESCRIPTION
+++ b/r/adbcdrivermanager/DESCRIPTION
@@ -17,7 +17,6 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
SystemRequirements: C++11
Suggests:
- arrow,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Config/build/bootstrap: TRUE
diff --git a/r/adbcdrivermanager/configure b/r/adbcdrivermanager/configure
index 7ac9cac..1a7bede 100755
--- a/r/adbcdrivermanager/configure
+++ b/r/adbcdrivermanager/configure
@@ -22,7 +22,7 @@
# ADBC repo into this package. If the file doesn't exist, we're installing
# from a pre-built tarball.
if [ -f bootstrap.R ]; then
- $R_HOME/bin/Rscript bootstrap.R
+ $R_HOME/bin/Rscript bootstrap.R --vanilla
fi
if [ -f "src/adbc.h" ] && [ -f "src/adbc_driver_manager.h" ] && [ -f
"src/adbc_driver_manager.cc" ]; then
diff --git a/r/adbcsqlite/.Rbuildignore b/r/adbcsqlite/.Rbuildignore
index 8cfba5e..e3a55b5 100644
--- a/r/adbcsqlite/.Rbuildignore
+++ b/r/adbcsqlite/.Rbuildignore
@@ -6,3 +6,4 @@
^src/Makevars$
^src/sqlite3\.c$
^src/sqlite3\.h$
+^\.vscode$
diff --git a/r/adbcsqlite/configure b/r/adbcsqlite/configure
index cf96b8d..084aa22 100755
--- a/r/adbcsqlite/configure
+++ b/r/adbcsqlite/configure
@@ -22,7 +22,7 @@
# ADBC repo into this package. If the file doesn't exist, we're installing
# from a pre-built tarball.
if [ -f bootstrap.R ]; then
- $R_HOME/bin/Rscript bootstrap.R
+ $R_HOME/bin/Rscript bootstrap.R --vanilla
fi
# Include and library flags