Closed tsondergaard closed 2 months ago
Is this problem specific to vcpkg deployed libraries or are the targets your project generates using add_executable
and add_library
, while using the vcpkg toolchain, also affected?
The vcpkg libraries themselves don't contain location information because that data is stripped out of the libraries when they are packaged. RPATHs are counter-intuitive in packages, as they would describe a build agent's setup, but the setup they need to abide to is the deploy target's one instead.
On systems supporting RPaths, cmake will instruct the linker to embed rpath data into each executable and library it emits. This will allow you to execute a binary linked against vcpkg provisioned libraries without having to override LD_LIBRARY_PATH
.
EDIT: x64-linux-dynamic triplet results in executable with rpath data having been embedded into it for vcpkg libraries on github actions:
2: Test command: /usr/bin/ldd "vcpkg-sqlite-demo"
2: Working Directory: /home/runner/work/vcpkg-sqlite-demo/vcpkg-sqlite-demo/build
2: Test timeout computed to be: 10000000
2: linux-vdso.so.1 (0x00007fff8a7e8000)
2: libsqlite3.so => /home/runner/work/vcpkg-sqlite-demo/vcpkg-sqlite-demo/build/vcpkg_installed/x64-linux-dynamic/debug/lib/libsqlite3.so (0x00007fa802113000)
2: libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa801e00000)
2: /lib64/ld-linux-x86-64.so.2 (0x00007fa8022e6000)
Project: https://github.com/PurpleFlowerGarden/vcpkg-sqlite-demo/tree/29c80a73aa49cd0fddac616a33134b028feeb9dd Workflow Reference: https://github.com/PurpleFlowerGarden/vcpkg-sqlite-demo/actions/runs/7992423522/job/21825874115#step:5:28
This is a problem with the qt5-webengine vcpkg port itself and doesn't involve my own project. Since opening this bug I have noticed that this problem is a known issue in the port, as is evident from this line: qt5-webengine/portfile.cmake:15. This comment is from commit bb7ccc4b90d6 but it does not provide a reason for why qt5-webengine should rely on system provided packages such as icu, and nss from the system rather than using vcpkg provided ports. I little bit more digging shows that the ports of nss and its dependency nspr are currently windows only and it looks from https://github.com/microsoft/vcpkg/pull/21281#issuecomment-964826255 that this is just because no one has done the work yet to enable them on other platforms.
I've also noticed that qt5-webengine is an experimental package: qt5-webengine/portfile.cmake:10.
I'm new to Vcpkg and I'm currently just evaluating it (vs Conan), but I will see if I can find time to fix the qt5-webengine port on Linux so it doesn't require system provided libraries and hereunder make the nss and nspr ports work on Linux too.
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
Describe the bug qt5-webengine picks up many system libraries that it should get from vcpkg. It also picks up both vcpkg and system libraries of some libraries, at least in debug configuration where it links both system libfreetype.so.xx and libfreetyped.so.
Environment
To Reproduce Steps to reproduce the behavior:
Expected behavior Vcpkg should not link system versions of
Failure logs
The X11 and OpenGL libraries are fine to be system, but ICU, png, bz2, pcre2 and many other should not be picked up from the host system.
Additional context Add any other context about the problem here.