Koha plugins cannot currently declare any dependencies. Not meeting them will occcasionally fail upon installation (if the main plugin class tries to load them at compile time) or runtime (if one of the other packages does, or code cleverly checks if the dependency is met). Ideally we'd have a way of specifying if a Koha plugin depends on another Perl module, or another Koha plugin. A nice feature of this would be to able be able to declare optional dependencies, which may only be required for a subset of the Plugin's features (like in https://github.com/HKS3/koha-normalize-marc2db/blob/main/Koha/Plugin/HKS3/NormalizeMARC2DB/Jobs/VerifyAll.pm#L34). Those shouldn't prevent installation, but should still warn loudly upon plugin installation, in a way that is hard/impossible to miss (e.g. have an intermitted screen on plugins-upload.pl, with an "are you sure"). Patch incoming.
Created attachment 191567 [details] [review] Bug 41651: Allow plugins do specify dependencies, abort installation if unmet This approach uses a new $metadata key, to minimize the scope of changes needed. The downside of that is the fact that if the base plugin package requires those dependencies in compile-time already, the code (and thus metadata itself) will fail to load in an unhandled way. plugins-upload.pl can't know for sure whether it's really the plugin being installed that doesn't have its dependencies met, which is a limitation to how it currently works.