mesonbuild/meson

Meson doesn't set LD_LIBRARY_PATH when executables in builddir are used to run custom_target

開放

#2,881 建立於 2018年1月5日

 (9 則留言) (0 個反應) (0 位負責人)Python (1,465 個分叉)batch import
OS:*BSDbugcompilersgeneratorshelp wanted

倉庫指標

星標
 (4,978 顆星)
PR 合併指標
 (平均合併 139天 13小時) (30 天內合併 51 個 PR)

描述

colord uses custom_target to run cd-create-profile to generate icc files during the build. cd-create-profile is an executable built from the same source tree, which should have RPATH set by Meson. However, FreeBSD configures its compiler to pass --enable-new-dtags to the linker, so RPATH are converted to RUNPATH. If users have LD_LIBRARY_PATH set in the environment, it will override RUNPATH and cause cd-create-profile to fail to run because the runtime linker picks the already installed libcolordprivate.so.2 from LD_LIBRARY_PATH instead of the one built in builddir.

$ ninja
[108/215] Generating AppleRGB.icc with a custom command.
FAILED: data/profiles/AppleRGB.icc 
/home/lantw44/gnome/build/colord/client/cd-create-profile --output=data/profiles/AppleRGB.icc data/profiles/AppleRGB.iccprofile.xml
/home/lantw44/gnome/build/colord/client/cd-create-profile: Undefined symbol "cd_icc_set_created"
[109/215] Generating AdobeRGB1998.icc with a custom command.
FAILED: data/profiles/AdobeRGB1998.icc 
/home/lantw44/gnome/build/colord/client/cd-create-profile --output=data/profiles/AdobeRGB1998.icc data/profiles/AdobeRGB1998.iccprofile.xml
/home/lantw44/gnome/build/colord/client/cd-create-profile: Undefined symbol "cd_icc_set_created"
[111/215] Generating BestRGB.icc with a custom command.
FAILED: data/profiles/BestRGB.icc 
/home/lantw44/gnome/build/colord/client/cd-create-profile --output=data/profiles/BestRGB.icc data/profiles/BestRGB.iccprofile.xml
/home/lantw44/gnome/build/colord/client/cd-create-profile: Undefined symbol "cd_icc_set_created"
$ chrpath /home/lantw44/gnome/build/colord/client/cd-create-profile
/home/lantw44/gnome/build/colord/client/cd-create-profile: RUNPATH=$ORIGIN/../lib/colord

It seems there are some similar issues for tests: #1383, #1635.

I know I can workaround it by using a shell script to set LD_LIBRARY_PATH and run cd-create-profile, but it will become a problem if I have to patch all projects using uninstalled executables to run custom_target.

貢獻者指南