Skip to content

Commit

Permalink
Merge pull request #193657 from Homebrew/apache-arrow-llvm
Browse files Browse the repository at this point in the history
apache-arrow: backport LLVM 19 support, update dependencies
  • Loading branch information
BrewTestBot authored Oct 13, 2024
2 parents 47ba4fa + 4377557 commit cfd4f24
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 81 deletions.
53 changes: 28 additions & 25 deletions Formula/a/apache-arrow.rb
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
class ApacheArrow < Formula
desc "Columnar in-memory analytics layer designed to accelerate big data"
homepage "https://arrow.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz"
mirror "https://archive.apache.org/dist/arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz"
sha256 "9d280d8042e7cf526f8c28d170d93bfab65e50f94569f6a790982a878d8d898d"
license "Apache-2.0"
revision 8
revision 9
head "https://github.com/apache/arrow.git", branch: "main"

stable do
url "https://www.apache.org/dyn/closer.lua?path=arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz"
mirror "https://archive.apache.org/dist/arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz"
sha256 "9d280d8042e7cf526f8c28d170d93bfab65e50f94569f6a790982a878d8d898d"

# Backport support for LLVM 19
patch do
url "https://github.com/apache/arrow/commit/3505457946192ef2ee0beac3356d9c0ed0d22b0f.patch?full_index=1"
sha256 "60793569736ebc72ecddcd06443cf281342d7fa81b5d4727152247f2cb7ad58a"
end
end

bottle do
sha256 cellar: :any, arm64_sequoia: "2fc6008982d88365d2a0ca4465f00130b40dd2fd79f0df172c5ae93f759e42e2"
sha256 cellar: :any, arm64_sonoma: "1d2fcbae3434a44040708720517351b884b96975ec9a91e123f904de0a5579fa"
sha256 cellar: :any, arm64_ventura: "b35302f7cb3518093962e5f62dc96c07c57b245e8dc17e441de519a15c82f4ac"
sha256 cellar: :any, sonoma: "ea36e30752a599b4a7eb00ac6289c26b6c7af7511b9291385edf9436cfa81522"
sha256 cellar: :any, ventura: "7826c2dbec52f2437f02bae7fc4e7400947fd9d0ae9ed0d821523af91d5d5c9c"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e785e61f8af34a802197e17c8a75cf5199cf88c8919d9b02e5edca22f57e3dea"
sha256 cellar: :any, arm64_sequoia: "f411c20ea4914620fd382f3a20758201f814da354e278f32d85f58487bb8b87e"
sha256 cellar: :any, arm64_sonoma: "edf15aeb53a7086430f00b887733e15c9c36944054c635ff1f7db35af3a4051b"
sha256 cellar: :any, arm64_ventura: "aa1b6d8b51c21d5f85e20e08ddc0969b7c1f50a0ec7db108ff122ad94bd89361"
sha256 cellar: :any, sonoma: "91ecb17642422cf3457e27b124ede15788e83bcbbda0634fd85fad7fdf5fe71e"
sha256 cellar: :any, ventura: "65c738d4286249ede5a7d0bc69d31186f4e9f12d03aa66770f80b1d915687843"
sha256 cellar: :any_skip_relocation, x86_64_linux: "60103c33895e2ff5dc98233b4e203894983e199252afb7482f6c162059d02c44"
end

depends_on "boost" => :build
depends_on "cmake" => :build
depends_on "gflags" => :build
depends_on "ninja" => :build
depends_on "rapidjson" => :build
depends_on "xsimd" => :build
depends_on "abseil"
depends_on "aws-sdk-cpp"
depends_on "brotli"
depends_on "bzip2"
depends_on "c-ares"
depends_on "glog"
depends_on "grpc"
depends_on "llvm@18"
depends_on "llvm"
depends_on "lz4"
depends_on "openssl@3"
depends_on "protobuf"
depends_on "rapidjson"
depends_on "re2"
depends_on "snappy"
depends_on "thrift"
depends_on "utf8proc"
depends_on "zstd"

uses_from_macos "python" => :build
uses_from_macos "bzip2"
uses_from_macos "zlib"

fails_with gcc: "5"

def llvm
deps.map(&:to_formula).find { |f| f.name.match?(/^llvm(@\d+)?$/) }
on_macos do
depends_on "c-ares"
end

def install
# Work around an Xcode 15 linker issue which causes linkage against LLVM's
# libunwind due to it being present in a library search path.
ENV.remove "HOMEBREW_LIBRARY_PATHS", llvm.opt_lib if DevelopmentTools.clang_build_version >= 1500
ENV.append "LDFLAGS", "-Wl,-rpath,#{llvm.opt_lib}" if OS.linux?

# We set `ARROW_ORC=OFF` because it fails to build with Protobuf 27.0
args = %W[
-DCMAKE_INSTALL_RPATH=#{rpath}
-DLLVM_ROOT=#{llvm.opt_prefix}
-DLLVM_ROOT=#{Formula["llvm"].opt_prefix}
-DARROW_DEPENDENCY_SOURCE=SYSTEM
-DARROW_ACERO=ON
-DARROW_COMPUTE=ON
-DARROW_CSV=ON
Expand Down
91 changes: 35 additions & 56 deletions Formula/v/vineyard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ class Vineyard < Formula
url "https://github.com/v6d-io/v6d/releases/download/v0.23.2/v6d-0.23.2.tar.gz"
sha256 "2a2788ed77b9459477b3e90767a910e77e2035a34f33c29c25b9876568683fd4"
license "Apache-2.0"
revision 5
revision 6

bottle do
rebuild 1
sha256 arm64_sequoia: "e0b3bb0b7d5d1d05ae0209c60e848be0ed63d9fdc7db6ff9b7cc51ce62b864b0"
sha256 arm64_sonoma: "ab2d74aa237dffa7d8c3c6cfbcd3849644e1b2c202c0dc502e8ec4b929c1cd1f"
sha256 arm64_ventura: "fd10aa8b7085f27018464b8bf91ac28d0f6b983d1e9c0ef32eb0435726245915"
sha256 sonoma: "5676475adc6e6b9b58ab403d418fd14423128887c0436f17cf7f863d8bd36044"
sha256 ventura: "ec2c89c0a1c723efc3ac0b21c58f83f1158f86c7a54d728107b83b0ca39cf9c4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "df83d67107663ce1c59b1f7c5ea63c1d4bab4608a6cce6a35ca48df509f85ac4"
sha256 arm64_sequoia: "f207ec66068890b869177a0eadad0c42e5347f4da45b0536746d792b4559e76f"
sha256 arm64_sonoma: "55bd20736624b45cb6c1315f64fe92f11b8c401a9ae4a6208208ddd4d6351383"
sha256 arm64_ventura: "15f8603be5c0d72954bf36b5b78b2690c29649f497ba28f96366f0355fe43676"
sha256 sonoma: "a813107094d2dd535d1e53133c397f8be7e6bf026812abe3528526b4c4aa903c"
sha256 ventura: "33a196fda4385724478f30de6323fd65c3b6e143797ca3f199142fec5fc426ee"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a858805f653607fb358050102b941bb00a06fecdf99dc97d2296e8f76966d961"
end

depends_on "cmake" => [:build, :test]
depends_on "llvm@18" => [:build, :test]
depends_on "llvm" => :build # for clang Python bindings
depends_on "openssl@3" => :build # indirect (not linked) but CMakeLists.txt checks for it
depends_on "[email protected]" => :build
depends_on "apache-arrow"
depends_on "boost"
Expand All @@ -28,55 +28,39 @@ class Vineyard < Formula
depends_on "etcd-cpp-apiv3"
depends_on "gflags"
depends_on "glog"
depends_on "hiredis"
depends_on "libgrape-lite"
depends_on "open-mpi"
depends_on "openssl@3"
depends_on "protobuf"
depends_on "redis"

on_macos do
depends_on "abseil"
depends_on "c-ares"
depends_on "re2"
end

fails_with gcc: "5"

def llvm
deps.map(&:to_formula).find { |f| f.name.match?(/^llvm(@\d+)?$/) }
end

resource "setuptools" do
url "https://files.pythonhosted.org/packages/1c/1c/8a56622f2fc9ebb0df743373ef1a96c8e20410350d12f44ef03c588318c3/setuptools-70.1.0.tar.gz"
sha256 "01a1e793faa5bd89abc851fa15d0a0db26f160890c7102cd8dce643e886b47f5"
url "https://files.pythonhosted.org/packages/27/b8/f21073fde99492b33ca357876430822e4800cdf522011f18041351dfa74b/setuptools-75.1.0.tar.gz"
sha256 "d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"
end

def install
python = "python3.12"
venv = virtualenv_create(libexec, python)
python3 = "python3.12"
venv = virtualenv_create(buildpath/"venv", python3)
venv.pip_install resources
# LLVM is keg-only.
ENV.prepend_path "PYTHONPATH", llvm.opt_prefix/Language::Python.site_packages(python)

# Work around an Xcode 15 linker issue which causes linkage against LLVM's
# libunwind due to it being present in a library search path.
ENV.remove "HOMEBREW_LIBRARY_PATHS", llvm.opt_lib if DevelopmentTools.clang_build_version >= 1500
ENV.append "LDFLAGS", "-Wl,-rpath,#{llvm.opt_lib}/#{Hardware::CPU.arch}-unknown-linux-gnu" if OS.linux?

system "cmake", "-S", ".", "-B", "build",
"-DCMAKE_CXX_STANDARD=17",
"-DCMAKE_CXX_STANDARD_REQUIRED=TRUE",
"-DPYTHON_EXECUTABLE=#{venv.root}/bin/python",
"-DUSE_EXTERNAL_ETCD_LIBS=ON",
"-DUSE_EXTERNAL_REDIS_LIBS=ON",
"-DUSE_EXTERNAL_HIREDIS_LIBS=ON",
"-DBUILD_VINEYARD_TESTS=OFF",
"-DUSE_LIBUNWIND=OFF",
"-DLIBGRAPELITE_INCLUDE_DIRS=#{Formula["libgrape-lite"].opt_include}",
"-DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix}",
"-DBUILD_VINEYARD_SERVER_ETCD=OFF", # Fails with protobuf 27
*std_cmake_args
llvm = deps.map(&:to_formula).find { |f| f.name.match?(/^llvm(@\d+)?$/) }
ENV.prepend_path "PYTHONPATH", llvm.opt_prefix/Language::Python.site_packages(python3)

args = [
"-DBUILD_VINEYARD_PYTHON_BINDINGS=OFF",
"-DBUILD_VINEYARD_TESTS=OFF",
"-DCMAKE_CXX_STANDARD=17",
"-DCMAKE_CXX_STANDARD_REQUIRED=TRUE",
"-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON", # for newer protobuf
"-DLIBGRAPELITE_INCLUDE_DIRS=#{Formula["libgrape-lite"].opt_include}",
"-DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix}",
"-DPYTHON_EXECUTABLE=#{venv.root}/bin/python",
"-DUSE_EXTERNAL_ETCD_LIBS=ON",
"-DUSE_EXTERNAL_HIREDIS_LIBS=ON",
"-DUSE_EXTERNAL_REDIS_LIBS=ON",
"-DUSE_LIBUNWIND=OFF",
]
args << "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-dead_strip_dylibs" if OS.mac?

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"

Expand Down Expand Up @@ -117,17 +101,12 @@ def install
target_link_libraries(vineyard-test PRIVATE ${VINEYARD_LIBRARIES})
EOS

# Work around an Xcode 15 linker issue which causes linkage against LLVM's
# libunwind due to it being present in a library search path.
ENV.remove "HOMEBREW_LIBRARY_PATHS", llvm.opt_lib if DevelopmentTools.clang_build_version >= 1500

# Remove Homebrew's lib directory from LDFLAGS as it is not available during
# `shell_output`.
ENV.remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"

system "cmake", "-S", testpath, "-B", testpath/"build",
*std_cmake_args
system "cmake", "--build", testpath/"build"
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"

# prepare vineyardd
vineyardd_pid = spawn bin/"vineyardd", "--norpc",
Expand Down

0 comments on commit cfd4f24

Please sign in to comment.