Uh oh!
There was an error while loading. Please reload this page.
HDDS-15559. Add libhadoop to DYLD_LIBRARY_PATH or LD_LIBRARY_PATH - #10513
Conversation
ChenSammi
commented
Jun 15, 2026
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ChenSammi for working on this. This change makes the build output depend on user's environment (OS, architecture). As discussed in #10305, this decision should be made at runtime, not build time. Build output should include all available libs, so user downloading binary tarball can use it on all platforms. (We also use the same tarball for creating Ozone Docker image.)
ChenSammi
commented
Jun 22, 2026
@adoroszlai , thanks for the review. These are the observations when I run ozone in docker in Mac M1,
|
Yes:
|
jojochuang
commented
Jul 7, 2026
There's a repeated CI failure due to downloading rocksdbjni. We're updating rocksdb to 10 not sure if that's going to solve this problem. #9813 |
jojochuang
commented
Jul 15, 2026
My Cursor is fixing the native lib problem: https://github.com/jojochuang/ozone/commits/refs/heads/HDDS-15559/ |
5554ef6 to
b7c5094Compareadoroszlai
commented
Jul 16, 2026
Can we please keep it as draft until CI is passing in fork? |
ChenSammi
commented
Jul 16, 2026
@adoroszlai@jojochuang , could you help to review the patch again? |
yandrey321
commented
Jul 16, 2026
is it a fix for m1/arm environments? |
| # Forcefully recreate it so it points to the correct target file | ||
| ln -sf "$TARGET_FILE" "$LINK_FILE" > /dev/null 2>&1 | ||
| fi | ||
| export DYLD_LIBRARY_PATH=$OZONE_HOME/lib/native:$DYLD_LIBRARY_PATH |
There was a problem hiding this comment.
would this export be effective to the current build/test execution process?
There was a problem hiding this comment.
This is mainly for the Mac user of final ozone bin package.
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ChenSammi for getting this to work. I have some minor code comments, I will address them in follow-up.
Uh oh!
There was an error while loading. Please reload this page.
| pushd . > /dev/null && cd lib/native | ||
| # If no matching file variant was found for the current environment | ||
| if [ -z "$TARGET_FILE" ]; then | ||
| echo "Error: libhadoop doesn't support platform combination ($OS_TYPE / $ARCH_TYPE)." >&2 |
There was a problem hiding this comment.
OS_TYPE is deprecated, should use OZONE_OS_TYPE.
| if [ -z "$TARGET_FILE" ]; then | ||
| echo "Error: libhadoop doesn't support platform combination ($OS_TYPE / $ARCH_TYPE)." >&2 | ||
| else | ||
| LINK_FILE="libhadoop.dylib" |
There was a problem hiding this comment.
By moving LINK_FILE definition out of if-else, the code block can be extracted to a function, to be reused for both Darwin and Linux cases.
Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
ChenSammi
commented
Jul 20, 2026
Thanks @adoroszlai@jojochuang@yandrey321 , for the review and good suggestion. |
What changes were proposed in this pull request?
Currently, three platform hadoop native library is supported,
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15559
How was this patch tested?
Tested locally for aarch64 platform, and CI for x86_64 platform.
// use ozone docker image hadoop native library under /usr/lib
// mvn clean package -DskipTests -Dmaven.javadoc.skip=true -Pdist -Plinux-aarch64 // on MacOS M1
// use ozone package hadoop native library under ./lib/native/