Skip to content

Commit

Permalink
apacheGH-27839: [R] Fetch latest nightly binary for arrow R dev versi…
Browse files Browse the repository at this point in the history
…ons. (apache#38236)

### Rationale for this change

We currently need to manually download the latest nightly build as the ".9000' dev version never matches any nightly builds.

### What changes are included in this PR?

Check the nightly  repo html listing for the latest version matching the local major version.
Refactor  nixlibs.R and integrate the functionality of winlibs.R  into it to simplify maintenance and prepare for the future of in-line windows libarrow builds.

These changes are build on apache#38195 so once that is merged I will rebase this.

### Are these changes tested?

Crossbow
* Closes: apache#27839

Lead-authored-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
  • Loading branch information
2 people authored and dgreiss committed Feb 17, 2024
1 parent 0815781 commit 7575fee
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 228 deletions.
20 changes: 19 additions & 1 deletion r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,27 @@ find_arrow () {
do_bundled_build () {
${R_HOME}/bin/Rscript tools/nixlibs.R $VERSION

if [ $? -ne 0 ]; then
# If the nixlibs.R script failed, we can't continue
echo "------------------------- NOTE ---------------------------"
echo "There was an issue building the Arrow C++ libraries."
echo "See https://arrow.apache.org/docs/r/articles/install.html"
echo "---------------------------------------------------------"
exit 1
fi

if [ -d "libarrow/arrow-$VERSION" ]; then
_LIBARROW_FOUND="`pwd`/libarrow/arrow-${VERSION}"
else
# It's possible that the version of the libarrow binary is not identical to the
# R version, e.g. if the R build is a patch release, so find what the dir is
# actually called. If there is more than one version present, use the one
# with the highest version:
_LIBARROW_FOUND="`pwd`/libarrow/$(ls libarrow/ | grep ^arrow- | tail -n 1)"
fi

# Handle a few special cases, using what we know about the bundled build
# and our ability to make edits to it since we "own" it.
_LIBARROW_FOUND="`pwd`/libarrow/arrow-${VERSION}"
LIB_DIR="${_LIBARROW_FOUND}/lib"
if [ -d "$LIB_DIR" ]; then
if [ "${PKG_CONFIG_AVAILABLE}" = "true" ]; then
Expand Down
3 changes: 1 addition & 2 deletions r/configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ GCS_LIBS="-lcurl -lnormaliz -lssh2 -lgdi32 -lssl -lcrypto -lcrypt32 -lwldap32 \
function configure_release() {
VERSION=$(grep ^Version DESCRIPTION | sed s/Version:\ //)
# Try to find/download a C++ Arrow binary,
# including possibly a local .zip file if RWINLIB_LOCAL is set
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "tools/winlibs.R" $VERSION $RWINLIB_LOCAL
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "tools/nixlibs.R" $VERSION
# If binary not found, script exits nonzero
if [ $? -ne 0 ]; then
echo "Arrow C++ library was not found"
Expand Down
Loading

0 comments on commit 7575fee

Please sign in to comment.