GNOME Bugzilla – Bug 788772
meson installs gdb scripts incorrectly
Last modified: 2017-11-02 04:35:04 UTC
Created attachment 361244 [details] [review] [PATCH] meson: Fix GDB scripts install_dir autotools (--prefix=/usr) installs the GDB scripts as: usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.5400.0-gdb.py usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.5400.0-gdb.py Meson installs them as: usr/share/gdb/auto-loadlib/libglib-2.0.so.0.5400.0-gdb.py usr/share/gdb/auto-load/lib/libgobject-2.0.so.0.5400.0-gdb.py Which does not work correctly.
Review of attachment 361244 [details] [review]: ::: glib/meson.build @@ +285,3 @@ configuration: gdb_conf, install: true, + install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + glib_libdir) This can be written as: ``` install_dir: join_paths(glib_datadir, 'gdb', 'auto-load', glib_libdir) ``` `glib_datadir` is `get_option('datadir')` plus the prefix. ::: gobject/meson.build @@ +103,3 @@ configuration: gdb_conf, install: true, + install_dir: join_paths(get_option('datadir'), 'gdb/auto-load/' + glib_libdir) Same as above
Actually, no, because glib_libdir is an absolute path.
Ah, yes: you're right. It should just be `join_paths(glib_datadir, 'gdb', 'auto-load', 'lib')`, then.
Unless, of course, GDB is insane enough and uses a `lib`/`lib64` split under `gdb/auto-load`.
Should it really be /usr/share/gdb/auto-load/lib/*.py instead of /usr/share/gdb/auto-load/usr/lib/*.py ? On Arch Linux, GCC installs /usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.24-gdb.py
https://sourceware.org/gdb/onlinedocs/gdb/objfile_002dgdbdotext-file.html says: > script-name is formed by ensuring that the file name of > objfile is absolute, following all symlinks, and resolving > . and .. components, and appending the -gdb.ext suffix. If > this file exists and is readable, GDB will evaluate it as > a script in the specified extension language. Which suggests that the usr/ is indeed needed.
Okay, so it must be: join_paths(glib_datadir, 'gdb', 'auto-load', glib_libdir) since we install the library name under glib_libdir.
(In reply to Emmanuele Bassi (:ebassi) from comment #7) I already mentioned in comment #2 that this won't work as glib_libdir is absolute; join_paths will throw away everything else. Perhaps '.' + glib_libdir will work? I don't see any methods to slice off the initial '/'.
Let's use string concatenation, and hope that `glib_libdir` never looks like `C:/mingw64/build`.
Created attachment 362191 [details] [review] [PATCH] meson: Fix GDB scripts install_dir for *nix Disable installation on Windows for now as this would use a colon in the directory name.
(In reply to Emmanuele Bassi (:ebassi) from comment #9) > Let's use string concatenation, and hope that `glib_libdir` never looks like > `C:/mingw64/build`. We already had this problem: https://bugzilla.gnome.org/show_bug.cgi?id=783270#c61, which is why that code is in place. (In reply to Jan Alexander Steffens (heftig) from comment #10) > Created attachment 362191 [details] [review] [review] > [PATCH] meson: Fix GDB scripts install_dir for *nix > > Disable installation on Windows for now as this would use a colon in the > directory name. This workaround is fine. Anything better requires API in meson to fetch the prefix as a relative path which will remove the leading '/' and any drive letters on Windows, or some other way to join absolute paths.
Comment on attachment 362191 [details] [review] [PATCH] meson: Fix GDB scripts install_dir for *nix I pushed the patch but git bz messed up a bit and didn't close the bug. Closing manually.