Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions dev/tasks/homebrew-formulae/autobrew/apache-arrow-static.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 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.

# https://github.com/autobrew/homebrew-cran/blob/master/Formula/apache-arrow.rb
class ApacheArrowStatic < Formula
desc "Columnar in-memory analytics layer designed to accelerate big data"
homepage "https://arrow.apache.org/"
url "https://downloads.apache.org/arrow/arrow-6.0.1/apache-arrow-6.0.1.tar.gz"
# Uncomment and update to test on a release candidate
mirror "https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-6.0.1-rc1/apache-arrow-6.0.1.tar.gz"
sha256 "3786b3d2df954d078b3e68f98d2e5aecbaa3fa2accf075d7a3a13c187b9c5294"
head "https://github.com/apache/arrow.git"

bottle do
root_url "https://github.com/autobrew/homebrew-cran/releases/download/apache-arrow-static-6.0.1"
sha256 cellar: :any, arm64_big_sur: "c6a7a85eb0747ddfe1eb389e9234a9658ae8dbed948f3d2a08ae0dd3061d4a5c"
sha256 cellar: :any, big_sur: "767142d88b6be9a36de8d1c5f6f3b64f22284c4bc3c22c9916a65a0b016fd286"
sha256 cellar: :any, catalina: "2579168ae3c3266091b8801477fa30355e9095724c9600b72d321fe7b831701f"
end

depends_on "boost" => :build
depends_on "cmake" => :build
depends_on "aws-sdk-cpp-static"
depends_on "lz4"
depends_on "snappy"
depends_on "thrift"
depends_on "zstd"

conflicts_with "apache-arrow", because: "both install Arrow"

def install
ENV.cxx11
args = %W[
-DARROW_COMPUTE=ON
-DARROW_CSV=ON
-DARROW_DATASET=ON
-DARROW_FILESYSTEM=ON
-DARROW_HDFS=OFF
-DARROW_JSON=ON
-DARROW_PARQUET=ON
-DARROW_BUILD_SHARED=OFF
-DARROW_JEMALLOC=ON
-DARROW_USE_GLOG=OFF
-DARROW_PYTHON=OFF
-DARROW_S3=ON
-DARROW_WITH_LZ4=ON
-DARROW_WITH_SNAPPY=ON
-DARROW_WITH_ZLIB=ON
-DARROW_WITH_ZSTD=ON
-DARROW_BUILD_UTILITIES=ON
-DCMAKE_UNITY_BUILD=OFF
-DPARQUET_BUILD_EXECUTABLES=ON
-DLZ4_HOME=#{Formula["lz4"].prefix}
-DTHRIFT_HOME=#{Formula["thrift"].prefix}
]

args << "-DARROW_MIMALLOC=ON" unless Hardware::CPU.arm?

mkdir "build"
cd "build" do
system "cmake", "../cpp", *std_cmake_args, *args
system "make"
system "make", "install"
end
end

test do
(testpath/"test.cpp").write <<~EOS
#include "arrow/api.h"
int main(void) {
arrow::int64();
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-std=c++11", "-I#{include}", "-L#{lib}", \
"-larrow", "-larrow_bundled_dependencies", "-o", "test"
system "./test"
end
end
14 changes: 12 additions & 2 deletions dev/tasks/r/github.macos.autobrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,29 @@

jobs:
autobrew:
name: "Autobrew"
runs-on: macOS-latest
name: "Autobrew {{ "${{ matrix.platform }}" }}"
runs-on: {{ "${{ matrix.platform }}" }}
strategy:
matrix:
platform:
- macos-11
- macos-10.15
steps:
{{ macros.github_checkout_arrow()|indent }}


- name: Configure autobrew script
run: |
cd arrow/r
# Put the formula inside r/ so that it's included in the package build
cp ../dev/tasks/homebrew-formulae/autobrew/apache-arrow.rb tools/apache-arrow.rb
cp ../dev/tasks/homebrew-formulae/autobrew/apache-arrow-static.rb tools/apache-arrow-static.rb
# Pin the current commit in the formula to test so that we're not always pulling from master
sed -i.bak -E -e 's@https://github.com/apache/arrow.git"$@{{ arrow.remote }}.git", :revision => "{{ arrow.head }}"@' tools/apache-arrow.rb && rm -f tools/apache-arrow.rb.bak
sed -i.bak -E -e 's@https://github.com/apache/arrow.git"$@{{ arrow.remote }}.git", :revision => "{{ arrow.head }}"@' tools/apache-arrow-static.rb && rm -f tools/apache-arrow-static.rb.bak
# Sometimes crossbow gives a remote URL with .git and sometimes not. Make sure there's only one
sed -i.bak -E -e '[email protected]@.git@' tools/apache-arrow.rb && rm -f tools/apache-arrow.rb.bak
sed -i.bak -E -e '[email protected]@.git@' tools/apache-arrow-static.rb && rm -f tools/apache-arrow-static.rb.bak
# Get minio for S3 testing
brew install minio
- uses: r-lib/actions/setup-r@v1
Expand All @@ -54,6 +63,7 @@ jobs:
env:
_R_CHECK_CRAN_INCOMING_: false
ARROW_USE_PKG_CONFIG: false
ARROW_R_DEV: true
run: arrow/ci/scripts/r_test.sh arrow
- name: Dump install logs
run: cat arrow/r/check/arrow.Rcheck/00install.out
Expand Down
18 changes: 16 additions & 2 deletions r/tools/autobrew
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1

# Official Homebrew no longer supports El-Capitan
UPSTREAM_ORG="autobrew"
if [[ ${OSTYPE:6} -ge 20 ]]; then
# We are on a modern enough macOS, we can use the real brew
UPSTREAM_ORG="homebrew"
PKG_BREW_NAME="$PKG_BREW_NAME-static"
else
# Official Homebrew no longer supports El-Capitan
# so We need to use the forked autobrew version of brew that supports old macOSes
UPSTREAM_ORG="autobrew"
fi

if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
AUTOBREW=${TMPDIR-/tmp}
Expand All @@ -36,6 +43,13 @@ curl -fsSL https://github.com/$UPSTREAM_ORG/brew/tarball/master | tar xz --strip
export HOMEBREW_CACHE="$AUTOBREW"
LOCAL_FORMULA="tools/${PKG_BREW_NAME}.rb"
if [ -f "$LOCAL_FORMULA" ]; then
if [[ ${OSTYPE:6} -ge 20 ]]; then
$BREW tap

# Tap https://github.com/autobrew/homebrew-cran so that we can get dependencies from there
$BREW tap autobrew/cran
fi

# Use the local brew formula and install --HEAD
$BREW deps -n "$LOCAL_FORMULA" 2>/dev/null
BREW_DEPS=$($BREW deps -n "$LOCAL_FORMULA" 2>/dev/null)
Expand Down