-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libb2] Fix using absolute install name in arm64-osx-dynamic triple #31720
Conversation
Thank you for mentioning this PR, our ci does not have a corresponding machine to test this change, so please make sure that the local test is ok. |
You're welcome. I understand that CI may not be able to test this particular change. Here're some test steps, if anyone has arm64-osx machine. Feel free to expand upon it: vcpkg remove libb2:arm64-osx-dynamic
vcpkg install libb2 --host-triplet=arm64-osx-dynamic --triplet=arm64-osx-dynamic --no-binarycaching Expected Result: ❯ otool -L /opt/vcpkg/packages/libb2_arm64-osx-dynamic/lib/libb2.dylib
/opt/vcpkg/packages/libb2_arm64-osx-dynamic/lib/libb2.dylib:
@rpath/libb2.1.dylib (compatibility version 2.0.0, current version 2.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0) and includes ❯ otool -l /opt/vcpkg/packages/libb2_arm64-osx-dynamic/lib/libb2.dylib | grep -A5 LC_RPATH
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12) |
Before adding so much osx rpath code to a single port, it should be checked if this is a general problem, i.e. if it needs a general hook. The situation reminds me of what |
Related: #31681. |
CMake project, like QT, has already set such @rpath when install. I found these issues when installing QT in arm64 osx, other dependencies It's good to have a general hook function(like Thanks for your mentions. I'll look for what |
Thanks for looking! I think the crux of this issue is that we never really should have added osx-dynamic for the same reason we resisted adding linux-dynamic for a long time: that we can build the thing but we know the resulting output won't run. We added linux-dynamic only at the same time @liviaerxin I think we have 3 paths forward here:
I setting this to draft status to mark that the ball's in your court. :) Please mark ready for review when you've chosen 1a, 1b, or 2. |
Hello @BillyONeal, I've used an approach as Before fix( ❯ otool -L /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/*dylib
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.72.1.dylib:
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.72.dylib:
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.dylib:
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.72.1.dylib:
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.72.dylib:
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.dylib:
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.72.1.dylib:
@rpath/libicuio.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.72.dylib:
@rpath/libicuio.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.dylib:
@rpath/libicuio.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.72.1.dylib:
@rpath/libicutu.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.72.dylib:
@rpath/libicutu.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.dylib:
@rpath/libicutu.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.1.dylib:
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.dylib:
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.dylib:
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
❯ otool -l /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/*dylib | grep -A3 LC_RPATH
❯ ~/Documents/dlopen_test.out /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.dylib
dlopen(/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.dylib, 0x0001): Library not loaded: @rpath/libicudata.72.dylib
Referenced from: <4A737B11-73EC-33E2-87E3-8AA577A9EDD3> /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.1.dylib
Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@rpath/libicudata.72.dylib' (no such file), '/usr/local/lib/libicudata.72.dylib' (no such file), '/usr/lib/libicudata.72.dylib' (no such file, not in dyld cache)
dlopen sample% Here we see After fix: ❯ otool -L /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/*dylib
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.72.1.dylib:
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.72.dylib:
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.dylib:
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.72.1.dylib:
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.72.dylib:
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.dylib:
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.72.1.dylib:
@rpath/libicuio.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.72.dylib:
@rpath/libicuio.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.dylib:
@rpath/libicuio.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.72.1.dylib:
@rpath/libicutu.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.72.dylib:
@rpath/libicutu.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.dylib:
@rpath/libicutu.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.1.dylib:
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.dylib:
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.dylib:
@rpath/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@rpath/libicudata.72.dylib (compatibility version 72.0.0, current version 72.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
❯ otool -l /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/*dylib | grep -A3 LC_RPATH
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.72.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicudata.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.72.1.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.72.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicui18n.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.72.1.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.72.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuio.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.72.1.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.72.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicutu.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.1.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
/opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.dylib:
--
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
❯ ~/Documents/dlopen_test.out /opt/vcpkg/packages/icu_arm64-osx-dynamic/lib/libicuuc.72.dylib
dlopen sample% Now I have no idea to do tests on all ports easily. Could you recommend some ways? Meanwhile, need I open a new PR for this general fix? Thank you in advance! |
Thanks for the suggestions! I've submitted PR: #32200 (method 1a)to solve these issues generally that can be applied to all ports by taking ideas from Hope |
Note: I will be converting your PR to draft status. When your submitted PR 32200 is merged, please revert to "ready for review". That way, I will mark this PR as reviewed. |
Thanks! |
@liviaerxin Thanks for your PR, Is work still being done for this PR? |
Still in progress, as #32200 gets some feedback nowadays. |
@liviaerxin Thanks for your PR, Is work still being done for this PR? |
Closing this PR since it seems that no progress is being made. Please ping us to reopen if work is still being done. |
Fix #31719:
./vcpkg x-add-version --all
and committing the result.