Skip to content
Draft
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
60 changes: 60 additions & 0 deletions .github/actions/setup-conda-arrow/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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.

name: Set up conda Arrow
description: Install Arrow and Parquet from conda-forge for CMake builds.

inputs:
runtime-library-path:
description: Runtime library path variable to export.
required: false
default: LD_LIBRARY_PATH
extra-packages:
description: Extra conda packages to install, space separated.
required: false
default: ""

runs:
using: composite
steps:
- name: Set up conda
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
miniforge-version: latest
channels: conda-forge
channel-priority: strict
activate-environment: arrow
- name: Install Arrow and Parquet
shell: bash -el {0}
env:
RUNTIME_LIBRARY_PATH: ${{ inputs.runtime-library-path }}
EXTRA_PACKAGES: ${{ inputs.extra-packages }}
run: |
read -r -a extra_packages <<< "${EXTRA_PACKAGES}"
mamba install -y "libarrow=24.0.*" "libparquet=24.0.*" "${extra_packages[@]}"
echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX}" >> "$GITHUB_ENV"
echo "ICEBERG_REQUIRE_SYSTEM_ARROW=ON" >> "$GITHUB_ENV"

case "${RUNTIME_LIBRARY_PATH}" in
LD_LIBRARY_PATH|DYLD_FALLBACK_LIBRARY_PATH) ;;
*)
echo "::error::Unsupported runtime-library-path: ${RUNTIME_LIBRARY_PATH}"
exit 1
;;
esac
runtime_path_var="${RUNTIME_LIBRARY_PATH}"
echo "${runtime_path_var}=${!runtime_path_var:+${!runtime_path_var}:}${CONDA_PREFIX}/lib" >> "$GITHUB_ENV"
12 changes: 11 additions & 1 deletion .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libsqlite3-dev libpq-dev default-libmysqlclient-dev
- name: Set up conda Arrow
uses: ./.github/actions/setup-conda-arrow
with:
# This leg builds Hive, whose Thrift runtime needs Boost headers.
extra-packages: libboost-devel
- name: Set up sccache
uses: ./.github/actions/setup-sccache
with:
Expand All @@ -78,7 +83,12 @@ jobs:
-DICEBERG_SQL_SQLITE=ON \
-DICEBERG_SQL_POSTGRESQL=ON \
-DICEBERG_SQL_MYSQL=ON \
-DICEBERG_BUILD_HIVE=ON
-DICEBERG_BUILD_HIVE=ON \
-DICEBERG_BUNDLE_THRIFT=OFF
if [[ -d _deps/vendoredarrow-src ]]; then
echo "::error::Expected Arrow from CMAKE_PREFIX_PATH, but CMake configured vendored Arrow"
exit 1
fi
cmake --build .
- name: Save sccache
if: always()
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ jobs:
env:
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "2G"
ICEBERG_EXTRA_CMAKE_ARGS: "-DICEBERG_BUILD_HIVE=ON"
# Prebuilt Arrow exports no Thrift target, so resolve the Thrift runtime
# from conda instead of Arrow's bundled build.
ICEBERG_EXTRA_CMAKE_ARGS: "-DICEBERG_BUILD_HIVE=ON -DICEBERG_BUNDLE_THRIFT=OFF"
steps:
- name: Checkout iceberg-cpp
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand All @@ -102,6 +104,12 @@ jobs:
- name: Install dependencies
shell: bash
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: Set up conda Arrow
uses: ./.github/actions/setup-conda-arrow
with:
# Thrift's public C++ headers include Boost, and libboost-devel (not
# libboost-headers) is the package carrying BoostConfig.cmake.
extra-packages: libboost-devel
- name: Restore sccache cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
Expand Down
6 changes: 4 additions & 2 deletions cmake_modules/FindThriftAlt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ endif()

include(FindPackageHandleStandardArgs)
if(TARGET thrift::thrift)
# CONFIG mode already produced the target; satisfy REQUIRED_VARS with it.
# CONFIG mode already produced the target. REQUIRED_VARS dereferences names as
# variables, so pass a variable holding the target rather than the target name.
set(ThriftAlt_TARGET thrift::thrift)
find_package_handle_standard_args(
ThriftAlt
REQUIRED_VARS thrift::thrift
REQUIRED_VARS ThriftAlt_TARGET
VERSION_VAR ThriftAlt_VERSION)
else()
find_package_handle_standard_args(
Expand Down
Loading