Skip to content
Open
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
21 changes: 1 addition & 20 deletions .github/actions/setup-conda-arrow/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ 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
Expand All @@ -41,20 +37,5 @@ runs:
- 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"
run: '"${{ github.action_path }}/install-arrow.sh"'
49 changes: 49 additions & 0 deletions .github/actions/setup-conda-arrow/install-arrow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
#
# 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.
#
# Installs Arrow and Parquet into the active conda environment and exports the
# paths CMake and the test binaries need. Run from the setup-conda-arrow action.

set -euo pipefail

toolchain="${GITHUB_WORKSPACE}/cmake_modules/IcebergThirdpartyToolchain.cmake"

# Keep conda Arrow in sync with the vendored build.
arrow_version=$(sed -nE 's/^set\(ICEBERG_ARROW_BUILD_VERSION "([0-9]+\.[0-9]+\.[0-9]+)"\)$/\1/p' "${toolchain}")
if [[ -z "${arrow_version}" ]]; then
echo "::error::Could not read ICEBERG_ARROW_BUILD_VERSION from ${toolchain}"
exit 1
fi

packages=("libarrow==${arrow_version}" "libparquet==${arrow_version}")
if [[ -n "${EXTRA_PACKAGES:-}" ]]; then
read -r -a extra_packages <<< "${EXTRA_PACKAGES}"
packages+=("${extra_packages[@]}")
fi
mamba install -y "${packages[@]}"

echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX}" >> "${GITHUB_ENV}"
# build_iceberg.sh reads this and fails if CMake configured vendored Arrow anyway.
echo "ICEBERG_REQUIRE_SYSTEM_ARROW=ON" >> "${GITHUB_ENV}"

if [[ "${RUNNER_OS}" == "macOS" ]]; then
echo "DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH:+${DYLD_FALLBACK_LIBRARY_PATH}:}${CONDA_PREFIX}/lib" >> "${GITHUB_ENV}"
else
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${CONDA_PREFIX}/lib" >> "${GITHUB_ENV}"
fi
2 changes: 0 additions & 2 deletions .github/workflows/aws_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ jobs:
- name: Set up conda Arrow
if: ${{ matrix.bundle_awssdk == 'OFF' }}
uses: ./.github/actions/setup-conda-arrow
with:
runtime-library-path: ${{ startsWith(matrix.runs-on, 'macos') && 'DYLD_FALLBACK_LIBRARY_PATH' || 'LD_LIBRARY_PATH' }}
- name: Set up sccache
uses: ./.github/actions/setup-sccache
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/sql_catalog_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ jobs:
- name: Set up conda Arrow
if: ${{ !startsWith(matrix.runs-on, 'windows') }}
uses: ./.github/actions/setup-conda-arrow
with:
runtime-library-path: ${{ startsWith(matrix.runs-on, 'macos') && 'DYLD_FALLBACK_LIBRARY_PATH' || 'LD_LIBRARY_PATH' }}
- name: Set up sccache
uses: ./.github/actions/setup-sccache
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ jobs:
persist-credentials: false
- name: Set up conda Arrow
uses: ./.github/actions/setup-conda-arrow
with:
runtime-library-path: DYLD_FALLBACK_LIBRARY_PATH
- name: Set up sccache
uses: ./.github/actions/setup-sccache
with:
Expand Down
Loading