Debugger plugin missing in Geany 1.37.1 compiled for Ubuntu 18.04 on Nvidia Jetson Nano
I have compiled Geany and all Geany plugins using gcc 8.4 on an NVIDIA Jetson Nano. The Jetson runs Nvidia's "Linux for Tegra", based on Ubuntu 18.04. Everything compiled and linked without errors. I've installed my locally-built Geany and plugins, using the "make install" step, and they both appeared to succeed. Geany launches normally. However, the Debugger plugin is not listed under Tools -> Plugin Manager. I do see a "debugger.so" and "debugger.la" under /usr/local/lib/geany. The Jetson Nano does have gdb installed and I can debug executables with gdb "the hard way". But the whole point of us using Geany is to provide a graphical debugging interface.
I see lots of foo on various forums about the Debugger plugin having been removed from various Debian distros. The suggestion is to build Geany 1.37 and its plugins from source, which I have done. So ... what else am I missing? Is there some other missing dependency? How can I further debug why the Debugger plugin is not listed in Geany's Plugin Manager? The Jetson Nano is a fairly common development box, very similar to a Raspberry Pi. Suggestions welcome.
Look and see if there are any messages in Help->Debug messages after you opened the plugin manager.
Probably also worth deleting the debugger.so and .la and re-building to be sure they are not old ones left over from a previous install.
Current git master debugger builds and runs here (with current master Geany) on Linux Mint 20 which is based on Ubuntu 18.04 so perhaps try compiling master Geany and plugins instead.
I rebuilt geany and geany-plugins from latest git repository, master branch. I needed to install libvte-2.91 to allow the debugger plugin to build. I can launch my newly-built geany, but the Debugger plugin is still missing from geany's Tools -> Plugin manager menu . Your suggestion to go geany's Help menu -> Debug Messages menu revealed this clue:
(null): Geany INFO : Geany 1.38 (git >= 5b307bc0), en_US.UTF-8
(null): Geany INFO : GTK 3.22.30, GLib 2.56.4
(null): Geany INFO : OS: Linux
(null): Geany INFO : System data dir: /usr/local/share/geany
(null): Geany INFO : User config dir: /home/timmyd/.config/geany
(null): Geany INFO : Loaded GTK+ CSS theme '/usr/local/share/geany/geany.css'
(null): Geany INFO : Loaded GTK+ CSS theme '/usr/local/share/geany/geany-3.20.css'
(null): Geany INFO : System plugin path: /usr/local/lib/geany
(null): Geany INFO : Added filetype Meson (64).
(null): Geany INFO : Added filetype Swift (65).
(null): Geany INFO : Added filetype CUDA (66).
(null): Geany INFO : Added filetype Kotlin (67).
(null): Geany INFO : Added filetype Graphviz (68).
(null): Geany INFO : Added filetype Cython (69).
(null): Geany INFO : Added filetype Nim (70).
(null): Geany INFO : Added filetype Genie (71).
(null): Geany INFO : Added filetype Groovy (72).
(null): Geany INFO : Added filetype Arduino (73).
(null): Geany INFO : Added filetype Clojure (74).
(null): Geany INFO : Added filetype TypeScript (75).
(null): Geany INFO : Added filetype Scala (76).
(null): Geany INFO : Added filetype JSON (77).
(null): Geany INFO : Loaded libvte from libvte-2.91.so
(null): Geany INFO : /ext/video-generator/frame-writer.cpp : C++ (UTF-8)
(null): Geany INFO : Loaded /usr/local/share/geany/tags/std99.c.tags (C), 1618 symbol(s).
(null): Geany INFO : Can't load plugin: libgeanypluginutils.so.0: cannot open shared object file: No such file or directory
(null): Geany INFO : Failed to load "/usr/local/lib/geany/debugger.so" - ignoring plugin!
(null): Geany INFO : Can't load plugin: libgeanypluginutils.so.0: cannot open shared object file: No such file or directory
(null): Geany INFO : Failed to load "/usr/local/lib/geany/scope.so" - ignoring plugin!
(null): Geany INFO : Added 36 plugin(s) in '/usr/local/lib/geany'.
(null): Gtk CRITICAL : gtk_widget_get_preferred_width_for_height: assertion 'height >= 0' failed
However, the libgeanypluginutils.so.0 file is clearly present in /usr/local/lib:
timmyd@eris:/ext/geany-plugins$ ls -l /usr/local/lib
total 88580
drwxr-xr-x 3 root root 4096 Oct 5 14:16 cmake
drwxr-xr-x 2 root root 4096 Oct 5 15:31 geany
-rwxr-xr-x 1 root root 1096 Oct 5 14:49 libgeany.la
-rwxr-xr-x 1 root root 1230 Oct 5 15:30 libgeanypluginutils.la
lrwxrwxrwx 1 root root 28 Oct 5 15:30 libgeanypluginutils.so -> libgeanypluginutils.so.0.0.0
lrwxrwxrwx 1 root root 28 Oct 5 15:30 libgeanypluginutils.so.0 -> libgeanypluginutils.so.0.0.0
-rwxr-xr-x 1 root root 46992 Oct 5 15:30 libgeanypluginutils.so.0.0.0
lrwxrwxrwx 1 root root 17 Oct 5 14:49 libgeany.so -> libgeany.so.0.0.0
lrwxrwxrwx 1 root root 17 Oct 5 14:49 libgeany.so.0 -> libgeany.so.0.0.0
-rwxr-xr-x 1 root root 41426696 Oct 5 14:49 libgeany.so.0.0.0
-rw-r--r-- 1 root root 43244872 Oct 5 14:15 libnvcomp.so
-rw-r--r-- 1 root root 3648678 Aug 23 11:19 libtiff.a
-rwxr-xr-x 1 root root 960 Aug 23 11:19 libtiff.la
lrwxrwxrwx 1 root root 16 Aug 23 11:19 libtiff.so -> libtiff.so.5.5.0
lrwxrwxrwx 1 root root 16 Aug 23 11:19 libtiff.so.5 -> libtiff.so.5.5.0
-rwxr-xr-x 1 root root 2123744 Aug 23 11:19 libtiff.so.5.5.0
-rw-r--r-- 1 root root 104270 Aug 23 11:19 libtiffxx.a
-rwxr-xr-x 1 root root 996 Aug 23 11:19 libtiffxx.la
lrwxrwxrwx 1 root root 18 Aug 23 11:19 libtiffxx.so -> libtiffxx.so.5.5.0
lrwxrwxrwx 1 root root 18 Aug 23 11:19 libtiffxx.so.5 -> libtiffxx.so.5.5.0
-rwxr-xr-x 1 root root 62216 Aug 23 11:19 libtiffxx.so.5.5.0
drwxr-xr-x 2 root root 4096 Oct 5 14:49 pkgconfig
drwxrwsr-x 4 root staff 4096 Mar 5 2021 python2.7
drwxrwsr-x 3 root staff 4096 May 18 2018 python3.6
So it is still a mystery. Thoughts welcome!
In the relevant directory do readelf --dynamic debugger.so and see what it has for RUNPATH.
Here you go! There is no RUNPATH that I can see.
timmyd@eris:/usr/local/lib/geany$ readelf --dynamic debugger.so
Dynamic section at offset 0x2cb68 contains 37 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libgeany.so.0]
0x0000000000000001 (NEEDED) Shared library: [libvte-2.91.so.0]
0x0000000000000001 (NEEDED) Shared library: [libgtk-3.so.0]
0x0000000000000001 (NEEDED) Shared library: [libgdk-3.so.0]
0x0000000000000001 (NEEDED) Shared library: [libcairo.so.2]
0x0000000000000001 (NEEDED) Shared library: [libgdk_pixbuf-2.0.so.0]
0x0000000000000001 (NEEDED) Shared library: [libgobject-2.0.so.0]
0x0000000000000001 (NEEDED) Shared library: [libglib-2.0.so.0]
0x0000000000000001 (NEEDED) Shared library: [libutil.so.1]
0x0000000000000001 (NEEDED) Shared library: [libgeanypluginutils.so.0]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-aarch64.so.1]
0x000000000000000e (SONAME) Library soname: [debugger.so]
0x000000000000000c (INIT) 0xf788
0x000000000000000d (FINI) 0x24cd8
0x0000000000000019 (INIT_ARRAY) 0x3ca20
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x3ca28
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x1f0
0x0000000000000005 (STRTAB) 0x4338
0x0000000000000006 (SYMTAB) 0x960
0x000000000000000a (STRSZ) 12585 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000003 (PLTGOT) 0x3cfe8
0x0000000000000002 (PLTRELSZ) 13200 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0xc3f8
0x0000000000000007 (RELA) 0x79b8
0x0000000000000008 (RELASZ) 19008 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffffe (VERNEED) 0x7938
0x000000006fffffff (VERNEEDNUM) 4
0x000000006ffffff0 (VERSYM) 0x7462
0x000000006ffffff9 (RELACOUNT) 723
0x0000000000000000 (NULL) 0x0
I also tried copying libgeanypluginutils.* from /usr/local/lib/ to /usr/local/lib/geany/ And launching geany as super-user. None of that fixed my problem.
Finally, here is output of the readelf command applied to libgeanypluginutils.so (although you did not explicitly ask for that, I thought it might help.)
timmyd@eris:/usr/local/lib$ readelf --dynamic libgeanypluginutils.so
Dynamic section at offset 0x2d78 contains 30 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libgeany.so.0]
0x0000000000000001 (NEEDED) Shared library: [libvte-2.91.so.0]
0x0000000000000001 (NEEDED) Shared library: [libpango-1.0.so.0]
0x0000000000000001 (NEEDED) Shared library: [libglib-2.0.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-aarch64.so.1]
0x000000000000000e (SONAME) Library soname: [libgeanypluginutils.so.0]
0x000000000000000c (INIT) 0xf50
0x000000000000000d (FINI) 0x1b98
0x0000000000000019 (INIT_ARRAY) 0x12d68
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x12d70
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x1f0
0x0000000000000005 (STRTAB) 0x710
0x0000000000000006 (SYMTAB) 0x260
0x000000000000000a (STRSZ) 1005 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000003 (PLTGOT) 0x12fe8
0x0000000000000002 (PLTRELSZ) 648 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0xcc8
0x0000000000000007 (RELA) 0xba8
0x0000000000000008 (RELASZ) 288 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffffe (VERNEED) 0xb68
0x000000006fffffff (VERNEEDNUM) 2
0x000000006ffffff0 (VERSYM) 0xafe
0x000000006ffffff9 (RELACOUNT) 3
0x0000000000000000 (NULL) 0x0
The problem is that on most Linuxes /usr/local/lib is not a place the dynamic loader looks for libraries (/lib, /usr/lib by default IIUC) and so its not finding libgeanypluginutils.so. But the RUNPATH adds an extra directory to look in, and on my system debugger.so and scope.so (notice it has the same error as debugger in your Help->Debug messages) here both have RUNPATH pointing to lib in the prefix I built Geany with (~/geany-git so nowhere near a standard system directory).
Did you build Geany with --prefix=/usr/local and Plugins with --prefix=/usr/local --with-geany-libdir=/usr/local/lib?
Thanks elextr. I did not build Geany or plugins with any special --prefix option. I just used defaults. Here are the exact steps I used to build both geany and plugins (I savied them from terminal scrollback):
sudo apt remove geany-common
git clone https://github.com/geany/geany.git
git clone https://github.com/geany/geany-plugins.git
cd geany
pip install rst2html
sudo apt-get install intltool
./autogen.sh
sudo make
sudo make install
cd ../geany-plugins
sudo apt install libvte-2.91-dev
./autogen.sh --enable-debugger
make
sudo make install
Based on your description, I was able to fix my problem by adding a file /etc/ld.so.conf.d/local.conf which contains a single line that points to /usr/local/lib, then running sudo ldconfig. After that, Geany shows the Debugger plugin in the Plugin Manager. Yay!
Is there a build step that I should have done differently?
Maybe its this manifesting itself in a different place. (RPATH mentioned is an older version of RUNPATH and does the same thing)
You could try explicitly specifying the prefix to geany and prefix and libdir to geany plugins as I mentioned. Maybe that will fool autotools into adding RUNPATH.
An autotools expert might be able tell you how to apply the fix from geany to debugger and scope but I can't.
The debugger plugin is available in packages for Ubuntu 21.04 and 21.10. The source package, with a few minor changes to the control file (which contains dependency info), builds fine on 18.04 and 20.04. It's also possible to build git snapshots of geany and geany plugins into deb packages.
Download the files *.orig.tar.xz, *.debian.tar.xz, and *.dsc. Extract the source using dpkg-source -x filename.dsc. Then from the source folder, run dpkg-buildpackage to create the deb files. It will warn you if you need to install any dependencies.
@xiota some history, the debugger plugin was slow to update to GTK3, so it was disabled by various distros when they started shipping GTK3 geany (inc debian and ubuntu). After it was updated there was a delay before it was re-enabled on Debian/Ubuntu, possibly due to distro internal processes, so it was not in 18.04 the OPs distro was based on.
The OP therefore built a version of Geany and plugins where debugger had been updated. They built correctly but some plugins don't load because autotools and Ubuntu disagree on which are system directories that are searched without an explicit RPATH so the pluginutils library was not found.
Did you check the debugger and scope plugins actually loaded on all those systems you built the source package for? If so it might be that Debian/Ubuntu have patched Geany's build, so it would be good to see if you can find what they did (patches S/B in Debians repo IIUC) and make a PR for GP.
The packages appear to work for Ubuntu 20.04 and 21.10. I don't have 18.04 or 21.04 installed anymore. The debugger and scope plugins both load fine. I have not used them, so don't know if they have any other issues. The packages do not have any special patches, so if any changes were needed, they've already been merged. The only changes needed were to the control file (dependency info).
I did see that OP had built Geany and Geany plugins from source. I have not done so on 18.04, but on 21.04 and 21.10, Geany and Geany plugins from the repository have to be completely uninstalled. The problem is the repository installs to /usr, but building from source goes to /usr/local. If the Geany include files are present in both locations, trying to build the plugins just won't work -period- (Murphy's Law).
When building packages, the dpkg system configures them to install to /usr. So the above-mentioned problem doesn't occur. The 1.37 plugins even seem to work fine with Geany 1.39. Since OP mentions /usr/local paths, the dpkg system was probably not being used to build deb packages.
Another potential issue is missing dependencies. Anything not listed in the control file won't be installed automatically. If dependencies aren't installed, the plugin won't show up in the plugin manager. But usually building fails when dependencies aren't installed.
The packages appear to work for Ubuntu 20.04 and 21.10. I don't have 18.04 or 21.04 installed anymore.
Possibly the ld bug I linked above is fixed in those later distro releases.
If the Geany include files are present in both locations, trying to build the plugins just won't work -period- (Murphy's Law).
Presumably the distro standard library directory is searched before the local one (I think thats intended). So if the distro version is installed, thats the only place plugins will be found, and they may not be compatible with your local Geany.
Unless explicitly supported never install two versions of the same software to system directories (rule for most SW not just Geany). You can build Geany from tarball with any prefix, I use ~/geany-XXX where I have a heap of XXXs and that will work because autotools adds an internal search path if the prefix is not a system directory. I don't install to system directories because my distro puts libraries in lib/x86-64_linux_gnu but autotools puts Geany in /lib :frowning_face:. This is one of the things @kugel-s meson build fixes for Geany.
the dpkg system was probably not being used to build deb packages.
Yes, since the OP built a version newer than the distro they were using, probably Geany release tarballs.
But usually building fails when dependencies aren't installed.
Yes, most dependencies should be tested for, but anyway the build will fail if the development version isn't installed. But the pluginutils library is part of GP so its not a dependency.