ludo@gnu.org (Ludovic Courtès) skribis: > taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis: > >> While looking into another issue, I happened to notice dangling .so >> references in some executables in Guix packages. This is the first in a >> series of bug reports for each such package. Some might be false >> positives; Mark suggested I report them all so we have a list to go >> through. It's also not comprehensive because of course I don't have >> every Guix package installed; the script to go through one's /gnu/store >> to get output such as the following for each package is attached at the >> bottom of this mail. > > Nice, thanks the reports (although it’s a bit daunting ;-)). > > I think there are two things to do: > > 1. Identify the reasons why these things aren’t in the RUNPATH: > missing -L? ld-wrapper bug (introduced in last ‘core-updates’?)? > > 2. Add a standard phase in gnu-build-system.scm, based on (guix elf), > that checks whether things in DT_NEEDED can actually be found among > the directories in DT_RUNPATH, and errors out if not. I made some progress on #2. The attached module exports ‘validate-needed-in-runpath’, which does exactly what I wrote above. I’ve tested it on the library and executables in my profile. It finds real issues (libssl, libpython3, gsc and gsx from Ghostscript): --8<---------------cut here---------------start------------->8--- scheme@(guix build gremlin)> (define libs (find-files "/home/ludo/.guix-profile/lib" "\\.so$")) scheme@(guix build gremlin)> (define execs (find-files "/home/ludo/.guix-profile/bin" "")) scheme@(guix build gremlin)> (for-each validate-needed-in-runpath (filter elf-file? execs)) error: '/home/ludo/.guix-profile/bin/gsc' depends on 'libgs.so.9', which cannot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib" "./sobin" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..") error: '/home/ludo/.guix-profile/bin/gsx' depends on 'libgs.so.9', which cannot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib" "./sobin" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..") scheme@(guix build gremlin)> (for-each validate-needed-in-runpath (filter elf-file? libs)) error: '/home/ludo/.guix-profile/lib/libc-2.21.so' depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libdl-2.21.so' depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libdl.so' depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libmemusage.so' depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_compat-2.21.so' depends on 'libnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_compat.so' depends on 'libnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_db-2.21.so' depends on 'libnss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_db.so' depends on 'libnss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_hesiod-2.21.so' depends on 'libnss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_hesiod.so' depends on 'libnss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis-2.21.so' depends on 'libnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis-2.21.so' depends on 'libnss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis.so' depends on 'libnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis.so' depends on 'libnss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nisplus-2.21.so' depends on 'libnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nisplus.so' depends on 'libnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libpthread-2.21.so' depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libpython3.so' depends on 'libpython3.3m.so.1.0', which cannot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..") error: '/home/ludo/.guix-profile/lib/libssl.so' depends on 'libcrypto.so.1.0.0', which cannot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib" "." "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..") scheme@(guix build gremlin)> (length (filter elf-file? libs)) $51 = 305 scheme@(guix build gremlin)> (length (filter elf-file? execs)) $52 = 818 --8<---------------cut here---------------end--------------->8--- Note that by default libc’s own libraries (libdl, librt, libm, etc.) are always considered found. This is to avoid false positives, notably found in libc itself and also in Binutils programs (ar, ranlib, etc.) I also tried it on i686 binaries as well as cross-compiled MIPS binaries. The latter case revealed what appears to be a genuine packaging bug: --8<---------------cut here---------------start------------->8--- scheme@(guix build gremlin)> (validate-needed-in-runpath "/gnu/store/lblx8nxh43zkp9k2n6b9q0j6ml96n64h-libunistring-0.9.5/lib/libunistring.so.2") error: '/gnu/store/lblx8nxh43zkp9k2n6b9q0j6ml96n64h-libunistring-0.9.5/lib/libunistring.so.2' depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ("/gnu/store/3g4h2dk1b3v1z96yb1q4c838c52adg0y-glibc-cross-mips64el-linux-gnu-2.21/lib" "/gnu/store/fl6mhhlwam8iyrxkngawrblrv1xbsmns-gcc-cross-mips64el-linux-gnu-4.8.4/lib64" "/gnu/store/fl6mhhlwam8iyrxkngawrblrv1xbsmns-gcc-cross-mips64el-linux-gnu-4.8.4/lib") $57 = #f --8<---------------cut here---------------end--------------->8--- I’d like to give it a try in ‘core-updates’. Comments? Thanks, Ludo’.