pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/56959: meson patch breaks meson functionality



>Number:         56959
>Category:       pkg
>Synopsis:       meson patch breaks meson functionality
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 07 23:35:00 +0000 2022
>Originator:     Andres Freund
>Release:        9.3
>Organization:
>Environment:
NetBSD localhost 9.3 NetBSD 9.3 (GENERIC) #0: Thu Aug  4 15:30:37 UTC 2022  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
A part of meson was patched to not edit rpaths during installation anymore. See https://github.com/NetBSD/pkgsrc/blob/trunk/devel/meson/patches/patch-mesonbuild_scripts_depfixer.py

Unfortunately this leads to broken rpaths if the build spec uses either build_rpath / install_rpath. And even if it does not explicitly, meson automatically adds build rpaths between binaries and libraries in the build dir, which now don't get removed anymore.

Unfortunately the commit history does not provide any detail about why this patch was added.  Possibly because older versions of meson had a bug that overzelously removed rpaths specified via CFLAGS?

Postgres is working on porting the buildsystem to meson. This breaks postgres' tests.
>How-To-Repeat:
$ cat meson.build
project('rpath', 'c')

subdir('lib')

executable('rpathtest', 'rpathtest.c', link_with: mylib, build_rpath: 'build_rpath_foo', install_rpath: 'install_rpath_foo', install: true)

$ cat lib/meson.build 
mylib = shared_library('mylib', 'mylib.c')
andres@netbsd9.1:[/home/andres/src/repro]$ cat rpathtest.c 
int main(void)
{
  return 0;
}
$ cat lib/mylib.c 
$ readelf -d build/test_install/usr/local/bin/rpathtest |grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/lib:build_rpath_foo]
$ readelf -d build/rpathtest |grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/lib:build_rpath_foo]

note the presence of $ORIGIN/lib (automatically added by meson) and build_rpath_foo in both binaries.

This does not happen with upstream meson:
$ python3.9 /home/andres/src/meson/meson.py setup build-meson-upstream
$ python3.9 /home/andres/src/meson/meson.py install --destdir test_install -C build-meson-upstream
$ readelf -d build-meson-upstream/rpathtest |grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/lib:build_rpath_foo]
$ readelf -d build-meson-upstream/test_install/usr/local/bin/rpathtest |grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [install_rpath_foo]


>Fix:
Remove the patch? But it's hard to say without understanding why this change was made.


Home | Main Index | Thread Index | Old Index