{"action":"created","issue":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/314","repository_url":"https://api.github.com/repos/mesonbuild/meson","labels_url":"https://api.github.com/repos/mesonbuild/meson/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/mesonbuild/meson/issues/314/comments","events_url":"https://api.github.com/repos/mesonbuild/meson/issues/314/events","html_url":"https://github.com/mesonbuild/meson/issues/314","id":117487924,"number":314,"title":"rpath doesn't get set with find_library('foo', dirs:'/path/to/lib')","user":{"login":"rhd","id":3422847,"avatar_url":"https://avatars2.githubusercontent.com/u/3422847?v=4","gravatar_id":"","url":"https://api.github.com/users/rhd","html_url":"https://github.com/rhd","followers_url":"https://api.github.com/users/rhd/followers","following_url":"https://api.github.com/users/rhd/following{/other_user}","gists_url":"https://api.github.com/users/rhd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhd/subscriptions","organizations_url":"https://api.github.com/users/rhd/orgs","repos_url":"https://api.github.com/users/rhd/repos","events_url":"https://api.github.com/users/rhd/events{/privacy}","received_events_url":"https://api.github.com/users/rhd/received_events","type":"User","site_admin":false},"labels":[{"id":99546085,"url":"https://api.github.com/repos/mesonbuild/meson/labels/bug","name":"bug","color":"fc2929","default":true},{"id":251967616,"url":"https://api.github.com/repos/mesonbuild/meson/labels/compilers","name":"compilers","color":"c7def8","default":false},{"id":546865937,"url":"https://api.github.com/repos/mesonbuild/meson/labels/dependencies","name":"dependencies","color":"e99695","default":false},{"id":99546087,"url":"https://api.github.com/repos/mesonbuild/meson/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":45,"created_at":"2015-11-18T01:03:55Z","updated_at":"2017-10-29T01:03:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Hi Jussi,\n\nIf you build a shared object with meson, the rpath get sets correctly (or so the docs say), but when I use find_library() and give it a search path, the rpath doesn't get set. This is causing me lot of pain.\n\nI'm currently doing stuff like this:\n\n```\nthirdparty_root = '/usr/local/thirdparty-1.6.0'\nthirdparty_lib = [thirdparty_root + '/lib/linux-x64-all',\n    thirdparty_root + '/lib/linux-x64-gcc4.8'\n]\nthirdparty_rpath = thirdparty_lib[0] + ':' + thirdparty_lib[1]\n\nthirdparty_dep = declare_dependency(\n    include_directories: thirdparty_inc,\n    dependencies: [\n        find_library('lib1', dirs: thirdparty_lib),\n        find_library('lib2', dirs: thirdparty_lib),\n        find_library('lib3', dirs: thirdparty_lib)\n    ]\n)\n```\n\nThen doing this:\n\n```\nexecutable('foo', 'foo.cpp',\n   ...,\n    link_args: '-Wl,-rpath,@0@:@1@'.format(thirdparty_rpath, boost_rpath),\n)\n```\n\nAm I doing it wrong?\n"},"comment":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/comments/340230198","html_url":"https://github.com/mesonbuild/meson/issues/314#issuecomment-340230198","issue_url":"https://api.github.com/repos/mesonbuild/meson/issues/314","id":340230198,"user":{"login":"morrisonlevi","id":253316,"avatar_url":"https://avatars2.githubusercontent.com/u/253316?v=4","gravatar_id":"","url":"https://api.github.com/users/morrisonlevi","html_url":"https://github.com/morrisonlevi","followers_url":"https://api.github.com/users/morrisonlevi/followers","following_url":"https://api.github.com/users/morrisonlevi/following{/other_user}","gists_url":"https://api.github.com/users/morrisonlevi/gists{/gist_id}","starred_url":"https://api.github.com/users/morrisonlevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morrisonlevi/subscriptions","organizations_url":"https://api.github.com/users/morrisonlevi/orgs","repos_url":"https://api.github.com/users/morrisonlevi/repos","events_url":"https://api.github.com/users/morrisonlevi/events{/privacy}","received_events_url":"https://api.github.com/users/morrisonlevi/received_events","type":"User","site_admin":false},"created_at":"2017-10-29T01:03:17Z","updated_at":"2017-10-29T01:03:17Z","author_association":"NONE","body":"A bit of background: I install and maintain a wide range of packages for HPC clusters. It is absolutely routine to install software into non-standard locations because people need different versions of the same program/library. Some software provides `.pc` files so we add them to our `PKG_CONFIG_PATH`, but not everything does and not every build tool uses them anyway. So when we install a program that needs dependency `libfoo` we add things to `LIBRARY_PATH`, `LD_RUN_PATH`, `CPATH`/`C_INCLUDE_PATH`, `CPLUS_INCLUDE_PATH`, etc.\r\n\r\nMeson breaks this. We intend the `DT_RPATH`/`DR_RUNPATH` to be set when we set `LD_RUN_PATH`. Shouldn't the build system honor that? If meson mangles these during build that's fine as long as 1) it works and 2) on install it puts them the way they ought to be."}}
{"actor":{"display_login":"morrisonlevi"}}