This is an automated email from the ASF dual-hosted git repository.
paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git
The following commit(s) were added to refs/heads/main by this push:
new 7395bf2 [R] Make installation work with default args to
`remotes::install_github()`/`pak::pkg_install()` (#63)
7395bf2 is described below
commit 7395bf25275679f6a4fbc35c7cf9bc8fbd6b6150
Author: Dewey Dunnington <[email protected]>
AuthorDate: Tue Oct 25 12:09:10 2022 -0300
[R] Make installation work with default args to
`remotes::install_github()`/`pak::pkg_install()` (#63)
* make it work with default args to remotes::install_github()
* be quiet on calls to curl
---
r/configure | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/r/configure b/r/configure
index 636988d..df7f432 100755
--- a/r/configure
+++ b/r/configure
@@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-# if we are building from within the nanoarrow repo, we want to use cmake
-# to generate the bundled header/source
+# If we are building from within the nanoarrow repo, we want to use cmake
+# to regenerate the bundled header/source
if [ -f "../src/nanoarrow/nanoarrow.h" ]; then
echo "Bundling nanoarrow using ../CMakeLists.txt"
rm -f src/nanoarrow.h src/nanoarrow.c
@@ -35,6 +35,22 @@ if [ -f "src/nanoarrow.h" ] && [ -f "src/nanoarrow.c" ]; then
exit 0
fi
+# We have a situation where the package has been built via R CMD build
+# but there is no vendored nanoarrow. This occurs with
+# remotes::install_github() with the default arguments. In this case, pull
+# the latest bundled version from GitHub. To ensure commit-level consistency,
+# use remotes::install_github(build = FALSE) (which will run cmake to get
+# a fresh bundle with a specific commit).
+curl -L https://github.com/apache/arrow-nanoarrow/raw/main/dist/nanoarrow.h \
+ --output src/nanoarrow.h --silent
+curl -L https://github.com/apache/arrow-nanoarrow/raw/main/dist/nanoarrow.c \
+ --output src/nanoarrow.c --silent
+
+if [ -f "src/nanoarrow.h" ] && [ -f "src/nanoarrow.c" ]; then
+ echo "Fetched bundled nanoarrow from
https://github.com/apache/arrow-nanoarrow/tree/main/dist"
+ exit 0
+fi
+
echo "Vendored src/nanoarrow.h and/or src/nanoarrow.c are missing"
echo "The .tar.gz was probably built incorrectly and it's probably not your
fault"
exit 1