ARROW-6258: [R] Add macOS build scripts #5095
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When installing the R package from source on macOS, if the configure script cannot find libarrow with pkgconfig, and if
apache-arrow
has not been installed via Homebrew (neither of which is the case on CRAN), an "autobrew" step happens: a script is downloaded and sourced, which uses a fork of Homebrew to download and install binary dependencies for bundling with the R package.This patch alters the configure script to let you
FORCE_AUTOBREW
, which is useful for testing, and it will use a localautobrew
script file, if found, rather than downloading it. The patch also adds theautobrew
script and theapache-arrow.rb
brew formula to ther/tools
directory, alongside the similar script that downloads the Arrow C++ binary on Windows. The two scripts are copied exactly from their "upstream" versions (noted on L18 of each file), with two minor modifications: (1)autobrew
will use a localapache-arrow.rb
formula if the file exists, and (2) the formula adds thehead
reference so you canbrew install --build-from-source --HEAD apache-arrow.rb
and pull the latest master branch ofapache/arrow
from GitHub.See this in action at https://github.com/nealrichardson/arrow-r-nightly/blob/34d27bf482fa1d9f490003a8396fabdff5beea37/.travis.yml. Ordinarily I would add a Travis-CI job to
apache/arrow
for this, but I know we're anxious not to delay build times further, so I'll run this job nightly. Nightly runs will solve https://issues.apache.org/jira/browse/ARROW-5134, and it will also allow us to host an R package repository with nightly binaries for macOS (and Windows too, using the existing Appveyor config + deploy to bintray).To install a binary from that repository on macOS,
install.packages("arrow", repos="https://dl.bintray.com/nealrichardson/arrow-r")
.One TODO: get @jeroen 's approval to include these scripts here under the Apache license and add a citation to LICENSE.txt.