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
54 changes: 51 additions & 3 deletions dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,47 @@ test_and_install_cpp() {
DEFAULT_DEPENDENCY_SOURCE="AUTO"
fi

# TEMP - remove before merge: VERIFY_RC_DEBUG=1 probes the libLLVM @rpath cause.
# set +e: this is expected to abort (exit 134) and must not kill the script
if [ "${VERIFY_RC_DEBUG:-0}" -gt 0 ] && [ "$(uname)" = "Darwin" ] && [ -n "${CONDA_PREFIX:-}" ]; then
set +e
echo "===== VERIFY_RC_DEBUG: libLLVM @rpath probe ====="
echo "CONDA_PREFIX=${CONDA_PREFIX}"
echo "ARROW_HOME=${ARROW_HOME:-<unset>}"

envlib=$(ls -d "${CONDA_PREFIX}"/lib/libLLVM.*.dylib 2>/dev/null | head -1)
echo "env libLLVM : ${envlib:-MISSING}"
if [ -n "${envlib}" ]; then
otool -L "${envlib}" >/dev/null 2>&1 && echo "env libLLVM loadable : yes"
fi

# env binary resolving into the env = hardlinked (safe) vs. into pkgs = vulnerable
for tool in llvm-link llvm-ranlib; do
envln="${CONDA_PREFIX}/bin/${tool}"
[ -e "${envln}" ] || continue
real=$(python3 -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "${envln}" 2>/dev/null)
echo "env ${tool} realpath: ${real}"
case "${real}" in
"${CONDA_PREFIX}"/*) echo " -> INTO env (safe)" ;;
*) echo " -> pkgs cache (VULNERABLE)" ;;
esac
done

# controlled comparison on the pkgs binary (its @loader_path is always the pkgs cache)
pkgbin=$(ls -d "${CONDA_PREFIX}"/../../pkgs/llvm-tools-*/bin/llvm-link-* 2>/dev/null | head -1)
echo "pkgs llvm-link : ${pkgbin:-MISSING}"
if [ -n "${pkgbin}" ]; then
DYLD_LIBRARY_PATH="${ARROW_HOME}/lib" "${pkgbin}" --version >/dev/null 2>&1
echo "A) no conda lib : exit=$? (134 or 0, pkgs binary varies by run)"
DYLD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${ARROW_HOME}/lib" "${pkgbin}" --version >/dev/null 2>&1
echo "B) conda lib via DYLD_LIBRARY_PATH : exit=$? (expect 0)"
DYLD_LIBRARY_PATH="${ARROW_HOME}/lib" DYLD_FALLBACK_LIBRARY_PATH="${CONDA_PREFIX}/lib" "${pkgbin}" --version >/dev/null 2>&1
echo "C) conda lib via DYLD_FALLBACK (fix) : exit=$? (expect 0)"
fi
echo "===== end VERIFY_RC_DEBUG ====="
set -e
fi

mkdir -p $ARROW_TMPDIR/cpp-build
pushd $ARROW_TMPDIR/cpp-build

Expand Down Expand Up @@ -519,7 +560,14 @@ test_and_install_cpp() {
${ARROW_CMAKE_OPTIONS:-} \
${ARROW_SOURCE_DIR}/cpp
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-${NPROC}}
cmake --build . --target install
# Expose conda's lib on the *fallback* path so the LLVM tools (llvm-link,
# llvm-ranlib) find libLLVM.*.dylib on flaky @rpath miss on macOS. (Fallback is searched last,
# so it doesn't shadow system libs like libiconv during the build or leak into tests.)
if [ "$(uname)" = "Darwin" ] && [ "${USE_CONDA}" -gt 0 ] && [ -n "${CONDA_PREFIX:-}" ]; then
DYLD_FALLBACK_LIBRARY_PATH="${CONDA_PREFIX}/lib:${DYLD_FALLBACK_LIBRARY_PATH:-/usr/local/lib:/usr/lib}" cmake --build . --target install
else
cmake --build . --target install
fi

if [ ${TEST_CPP} -gt 0 ]; then
LD_LIBRARY_PATH=$PWD/release:$LD_LIBRARY_PATH ctest \
Expand Down Expand Up @@ -779,10 +827,10 @@ test_source_distribution() {

if [ "$(uname)" == "Darwin" ]; then
NPROC=$(sysctl -n hw.ncpu)
export DYLD_LIBRARY_PATH=$ARROW_HOME/lib:${DYLD_LIBRARY_PATH:-}
export DYLD_LIBRARY_PATH=$ARROW_HOME/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
else
NPROC=$(nproc)
export LD_LIBRARY_PATH=$ARROW_HOME/lib:${LD_LIBRARY_PATH:-}
export LD_LIBRARY_PATH=$ARROW_HOME/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
fi

pushd $ARROW_SOURCE_DIR
Expand Down
3 changes: 3 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ tasks:
ci: github
template: verify-rc/github.macos.yml
params:
# TEMP - remove before merge: enable the libLLVM @rpath probe
env:
VERIFY_RC_DEBUG: 1
target: {{ target }}
use_conda: True
github_runner: "macos-15-intel"
Expand Down
Loading