Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-4649: [C++/CI/R] Add nightly job that tests the homebrew formula #5360

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 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
30 changes: 30 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1844,3 +1844,33 @@ This project includes code from the autobrew project.
Copyright: Copyright (c) 2017 - 2019, Jeroen Ooms.
All rights reserved.
Homepage: https://github.com/jeroen/autobrew

--------------------------------------------------------------------------------

ci/apache-arrow.rb has the following license:

BSD 2-Clause License

Copyright (c) 2009-present, Homebrew contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 changes: 57 additions & 0 deletions ci/apache-arrow.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
class ApacheArrow < Formula
nealrichardson marked this conversation as resolved.
Show resolved Hide resolved
desc "Columnar in-memory analytics layer designed to accelerate big data"
homepage "https://arrow.apache.org/"
url "https://www.apache.org/dyn/closer.cgi?path=arrow/arrow-0.15.0-SNAPSHOT/apache-arrow-0.15.0-SNAPSHOT.tar.gz"
sha256 "9948ddb6d4798b51552d0dca3252dd6e3a7d0f9702714fc6f5a1b59397ce1d28"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When should we update url and sha256?
If it's release time, we should update them automatically in release process.
(dev/release/00-prepare.sh?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, will do.

head "https://github.com/apache/arrow.git"

depends_on "cmake" => :build
depends_on "boost"
depends_on "brotli"
depends_on "double-conversion"
depends_on "flatbuffers"
depends_on "glog"
depends_on "grpc"
depends_on "lz4"
depends_on "numpy"
depends_on "openssl"
depends_on "protobuf"
depends_on "python"
depends_on "rapidjson"
depends_on "snappy"
depends_on "thrift"
depends_on "zstd"

def install
ENV.cxx11
args = %W[
-DARROW_FLIGHT=ON
-DARROW_ORC=ON
-DARROW_PARQUET=ON
-DARROW_PLASMA=ON
-DARROW_PROTOBUF_USE_SHARED=ON
-DARROW_PYTHON=ON
-DARROW_INSTALL_NAME_RPATH=OFF
-DPYTHON_EXECUTABLE=#{Formula["python"].bin/"python3"}
]

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", "-o", "test"
system "./test"
end
end
14 changes: 14 additions & 0 deletions dev/release/00-prepare-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ def test_update_version_pre_tag
"+pkgver=#{@release_version}"],
],
},
{
path: "ci/apache-arrow.rb",
hunks: [
["- url \"https://www.apache.org/dyn/closer.cgi?path=arrow/arrow-#{@snapshot_version}/apache-arrow-#{@snapshot_version}.tar.gz\"",
"+ url \"https://www.apache.org/dyn/closer.cgi?path=arrow/arrow-#{@release_version}/apache-arrow-#{@release_version}.tar.gz\""],
],
},
{
path: "cpp/CMakeLists.txt",
hunks: [
Expand Down Expand Up @@ -248,6 +255,13 @@ def test_update_version_post_tag
"+pkgver=#{@release_version}.9000"],
],
},
{
path: "ci/apache-arrow.rb",
hunks: [
["- url \"https://www.apache.org/dyn/closer.cgi?path=arrow/arrow-#{@release_version}/apache-arrow-#{@release_version}.tar.gz\"",
"+ url \"https://www.apache.org/dyn/closer.cgi?path=arrow/arrow-#{@next_snapshot_version}/apache-arrow-#{@next_snapshot_version}.tar.gz\""],
],
},
{
path: "cpp/CMakeLists.txt",
hunks: [
Expand Down
40 changes: 21 additions & 19 deletions dev/release/00-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ update_versions() {
;;
esac

cd "${SOURCE_DIR}/../../cpp"
sed -i.bak -E -e \
"s/^set\(ARROW_VERSION \".+\"\)/set(ARROW_VERSION \"${version}\")/" \
CMakeLists.txt
rm -f CMakeLists.txt.bak
git add CMakeLists.txt
cd -

cd "${SOURCE_DIR}/../../c_glib"
sed -i.bak -E -e \
"s/^m4_define\(\[arrow_glib_version\], .+\)/m4_define([arrow_glib_version], ${version})/" \
Expand All @@ -61,6 +53,27 @@ update_versions() {
git add configure.ac meson.build
cd -

cd "${SOURCE_DIR}/../../ci"
sed -i.bak -E -e \
"s/^pkgver=.+/pkgver=${r_version}/" \
PKGBUILD
rm -f PKGBUILD.bak
git add PKGBUILD
sed -i.bak -E -e \
"s/arrow-[0-9.\-]+[0-9SNAPHOT]+/arrow-${version}/g" \
apache-arrow.rb
rm -f apache-arrow.rb.bak
git add apache-arrow.rb
cd -

cd "${SOURCE_DIR}/../../cpp"
sed -i.bak -E -e \
"s/^set\(ARROW_VERSION \".+\"\)/set(ARROW_VERSION \"${version}\")/" \
CMakeLists.txt
rm -f CMakeLists.txt.bak
git add CMakeLists.txt
cd -

cd "${SOURCE_DIR}/../../csharp"
sed -i.bak -E -e \
"s/^ <Version>.+<\/Version>/ <Version>${version}<\/Version>/" \
Expand Down Expand Up @@ -99,17 +112,6 @@ update_versions() {
DESCRIPTION
rm -f DESCRIPTION.bak
git add DESCRIPTION
cd -

cd "${SOURCE_DIR}/../../ci"
sed -i.bak -E -e \
"s/^pkgver=.+/pkgver=${r_version}/" \
PKGBUILD
rm -f PKGBUILD.bak
git add PKGBUILD
cd -

cd "${SOURCE_DIR}/../../r"
if [ ${type} = "snapshot" ]; then
# Add a news entry for the new dev version
echo "dev"
Expand Down
1 change: 1 addition & 0 deletions dev/release/rat_exclude_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.json
*.snap
.github/ISSUE_TEMPLATE.md
ci/apache-arrow.rb
cpp/CHANGELOG_PARQUET.md
cpp/src/arrow/io/mman.h
cpp/src/arrow/util/random.h
Expand Down
41 changes: 41 additions & 0 deletions dev/tasks/homebrew-formulae/travis.osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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.

os: osx
language: ruby
cache: bundler

# don't build twice
if: tag IS blank

env:
global:
- TRAVIS_TAG={{ task.tag }}
- ARROW_FORMULA=./arrow/{{ formula }}

before_script:
- git clone --no-checkout {{ arrow.remote }} arrow
- git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
- if [ $CROSSBOW_USE_COMMIT_ID == true ]; then git -C arrow checkout {{ arrow.head }}; else git -C arrow checkout FETCH_HEAD; fi
- brew update
- brew audit $ARROW_FORMULA
script:
- brew install -v --build-from-source --HEAD $ARROW_FORMULA
- brew test $ARROW_FORMULA

notifications:
email:
- {{ job.email }}
18 changes: 18 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ groups:
- ubuntu-disco-arm64
- centos-6
- centos-7
- homebrew-cpp
- homebrew-cpp-autobrew
- gandiva-jar-trusty
- gandiva-jar-osx
- docker-r
Expand Down Expand Up @@ -1085,6 +1087,22 @@ tasks:
- plasma-glib-libs-{no_rc_version}-1.el7.x86_64.rpm
- plasma-libs-{no_rc_version}-1.el7.x86_64.rpm

############################## Homebrew Tasks ################################

homebrew-cpp:
ci: travis
platform: osx
template: homebrew-formulae/travis.osx.yml
params:
formula: ci/apache-arrow.rb

homebrew-cpp-autobrew:
ci: travis
platform: osx
template: homebrew-formulae/travis.osx.yml
params:
formula: r/tools/apache-arrow.rb
nealrichardson marked this conversation as resolved.
Show resolved Hide resolved

nealrichardson marked this conversation as resolved.
Show resolved Hide resolved
############################## Gandiva Tasks ################################

gandiva-jar-trusty:
Expand Down
4 changes: 2 additions & 2 deletions r/tools/apache-arrow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class ApacheArrow < Formula

depends_on "cmake" => :build
depends_on "flatbuffers" => :build
depends_on "double-conversion"
depends_on "boost"
depends_on "double-conversion"
depends_on "lz4"
depends_on "thrift"
depends_on "snappy"
depends_on "thrift"

def install
ENV.cxx11
Expand Down