Have 'make uninstall' delete plugins which are no longer built#1312
Have 'make uninstall' delete plugins which are no longer built#1312SteveErl wants to merge 2 commits intoMythTV:masterfrom
Conversation
This update modifies the mythplugins/cleanup/Makefile to delete plugins which are not being built. This helps to prevent weird memory corruption problems caused by trying to load an outdated plugin. Resolves MythTV#1174
|
This does not belong in a "make install" command. I have no objection to it being part of a "make uninstall" command. |
|
As I understand it this patch does remove the old plugins when there is a new plugin built. |
|
I could try moving it to It tries, but luckily fails to remove /usr/bin/, /usr/share/mythtv/, /usr/share/mythtv/bindings, /usr/share/mythtv/fonts, /usr/share/mythtv/locales, /usr/share/mythtv/metadata, /usr/share/mythtv/mythconverg_backup.pl, /usr/share/mythtv/mythconverg_restore.pl, /usr/share/mythtv/sql, /usr/share/mythtv/themes. None of these are parts of the plugins. They are components of the mythbackend, mythfrontend, or the operating system. I prefer to consider |
|
A few comments.
|
|
The way the version check is currently implemented is that the plugin detects that its version does not match the libmythbase version. But this check is only done once the plugin is loaded, and by then, it's too late to avoid the memory corruption. I looked into ways to implement your suggested "proper solution". The only way I found was This could work on Linux and MacOS, but Windows does not have a direct built-in equivalent that extracts strings from binary files in the same way the Linux strings command does. It also doesn't have a direct built-in equivalent to sed. Implementing your "proper solution" would be quite complicated. The solution I came up with in this Pull Request is tremendously more simple. It will throw out libmythweather.so on my system since that plugin is expecting an old libmythbase version (34). As a result, it will never get loaded, and we avoid the memory corruption. The builder doesn't need to know about a new requirement that they run I grant that it's unusual to delete something during a |
The deletion of plugins which are no longer configured to be built has been moved from the 'install' rule to the 'uninstall' rule. Resolves MythTV#1174
|
I've moved the cleanup of old plugins from the install rule to the uninstall rule. |
This update modifies the uninstall rule in mythplugins/cleanup/Makefile to delete plugins which are not being built. If a builder reruns configuration to eliminate a plugin which was previously included, but fails to run uninstall before doing so, the old plugin may be left behind. Running
make uninstallafter the configuration changes wouldn't work. These changes will remove plugins which are no longer configured to be built.Resolves #1174
Checklist