fix: isolate external projects from host toolchain library paths#367
Open
suxiaogang223 wants to merge 1 commit into
Open
fix: isolate external projects from host toolchain library paths#367suxiaogang223 wants to merge 1 commit into
suxiaogang223 wants to merge 1 commit into
Conversation
Add -DCMAKE_LIBRARY_PATH= and -DCMAKE_PREFIX_PATH= to EP_COMMON_CMAKE_ARGS to prevent external projects (Arrow, ORC, etc.) from finding incompatible libraries from non-system toolchains. Problem ------- On a Fedora machine with a non-system LLVM toolchain (ldb_toolchain) on PATH, cmake derives implicit library search paths from the compiler location. This caused Arrow's bundled dependency build to find libunwind.so from the toolchain at /home/socrates/ldb_toolchain/lib/, which lacks the _Unwind_RaiseException symbol (actually provided by libgcc_s). At test runtime this produced: symbol lookup error: undefined symbol: _Unwind_RaiseException This does not reproduce in CI (GitHub Actions Ubuntu runners) because CI images have no such toolchain and no unversioned libunwind.so. Fix ---- Block CMAKE_LIBRARY_PATH and CMAKE_PREFIX_PATH in EP_COMMON_CMAKE_ARGS, which are passed to every external project's cmake configure step. All external project dependencies are already passed explicitly via xxx_ROOT/xxx_HOME/xxx_DIR variables, so clearing these search paths is safe. This is a subtask of alibaba#260 (cmake infrastructure improvements). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zjw1111
reviewed
Jun 15, 2026
Comment on lines
1853
to
1856
| find_library(LIBUNWIND_LIBRARY NAMES unwind) | ||
| if(LIBUNWIND_LIBRARY) | ||
| target_link_libraries(glog INTERFACE ${LIBUNWIND_LIBRARY}) | ||
| endif() |
Collaborator
There was a problem hiding this comment.
Won’t glog also report an error about _Unwind_RaiseException?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When building paimon-cpp on a Fedora machine with a non-system LLVM toolchain (ldb_toolchain) on PATH, all tests crash with:
Root cause: cmake derives implicit library search paths from the compiler location. When ldb_toolchain is on PATH, Arrow find_library(unwind) finds libunwind.so under the toolchain directory. However, this toolchain-provided libunwind lacks the _Unwind_RaiseException symbol, which is actually provided by libgcc_s.so.1.
Why CI passes: GitHub Actions Ubuntu runners have no non-system toolchain and no unversioned libunwind.so (only libunwind.so.8). Arrow cannot find libunwind, falls back to libgcc_s, and works correctly.
Fix
Add -DCMAKE_LIBRARY_PATH= and -DCMAKE_PREFIX_PATH= to EP_COMMON_CMAKE_ARGS, which are passed to every external project cmake configure step. This blocks host toolchain library paths from leaking into external project builds (Arrow, ORC, etc.).
All external project dependencies are already passed explicitly via xxx_ROOT/xxx_HOME/xxx_DIR variables, so clearing these search paths is safe.
Files Changed
cmake_modules/ThirdpartyToolchain.cmake | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Verification
Fedora x86_64, GCC 16 + ldb_toolchain:
🤖 Generated with Claude Code