Skip to content

Commit 4f60019

Browse files
authored
GH-50242: [CI][Release] Fix flaky dylib load failure in macOS verify-rc build (#50243)
### Rationale for this change The nightly job [Verify release candidate on macOS](https://github.com/ursacomputing/crossbow/actions/runs/27960474749/job/82740300712#step:3:1689) intermittently aborts the C++ build with `Library not loaded: @ rpath/libLLVM.22.1.dylib`). Conda's LLVM tools resolve `libLLVM` via `@ loader_path/../lib` and can point at the package cache which has no `libLLVM`. The conda env lib dir is not on the loader path. The same @ rpath miss seen with three different conda libraries (libLLVM, libprotoc, libabsl) through four binaries (llvm-link and llvm-ranlib, grpc_cpp_plugin, protoc) and may affect any shared library on osx - conda-forge/cmake-feedstock#230. ### What changes are included in this PR? Add `$CONDA_PREFIX/lib` to `DYLD_FALLBACK_LIBRARY_PATH` for the step `cmake --build`. (Fallback is searched last, so it resolves the `@ rpath` miss without overriding system libraries.) Also drop unneeded empty element from DYLD_LIBRARY_PATH/LD_LIBRARY_PATH assignment (trailing `:` when the variable was unset). ### Are these changes tested? Tested by nightly jobs verify-rc-source-*-macos-conda-* : [cpp](https://github.com/ursacomputing/crossbow/actions/runs/28116539944/job/83257363676#step:3:919), [integration](https://github.com/ursacomputing/crossbow/actions/runs/28116540139/job/83257364464#step:3:958) and [python](https://github.com/ursacomputing/crossbow/actions/runs/28116539626/job/83257362478#step:3:919) tasks pass. ### Are there any user-facing changes? No. * GitHub Issue: #50242 Authored-by: Tadeja Kadunc <tadeja.kadunc@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 9e47fbb commit 4f60019

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

dev/release/verify-release-candidate.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,15 @@ test_and_install_cpp() {
519519
${ARROW_CMAKE_OPTIONS:-} \
520520
${ARROW_SOURCE_DIR}/cpp
521521
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-${NPROC}}
522-
cmake --build . --target install
522+
# On macOS, conda package-cache binaries intermittently fail to load their @rpath
523+
# dependencies even though the libs are present. Add the env lib dir to the fallback
524+
# path (searched last, to not override system libs) so they resolve.
525+
# See https://github.com/conda-forge/cmake-feedstock/issues/230
526+
if [ "$(uname)" = "Darwin" ] && [ "${USE_CONDA}" -gt 0 ] && [ -n "${CONDA_PREFIX:-}" ]; then
527+
DYLD_FALLBACK_LIBRARY_PATH="${CONDA_PREFIX}/lib" cmake --build . --target install
528+
else
529+
cmake --build . --target install
530+
fi
523531

524532
if [ ${TEST_CPP} -gt 0 ]; then
525533
LD_LIBRARY_PATH=$PWD/release:$LD_LIBRARY_PATH ctest \
@@ -779,10 +787,10 @@ test_source_distribution() {
779787

780788
if [ "$(uname)" == "Darwin" ]; then
781789
NPROC=$(sysctl -n hw.ncpu)
782-
export DYLD_LIBRARY_PATH=$ARROW_HOME/lib:${DYLD_LIBRARY_PATH:-}
790+
export DYLD_LIBRARY_PATH=$ARROW_HOME/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
783791
else
784792
NPROC=$(nproc)
785-
export LD_LIBRARY_PATH=$ARROW_HOME/lib:${LD_LIBRARY_PATH:-}
793+
export LD_LIBRARY_PATH=$ARROW_HOME/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
786794
fi
787795

788796
pushd $ARROW_SOURCE_DIR

0 commit comments

Comments
 (0)