On Tue, Nov 05, 2024 at 01:09:21PM -0800, Stephen Paul Weber wrote:
If I make a rock that has a prosody module and some binary bits (in rust in
my case, but I imagine this situation would be identical for C) then I can
get prosodyctl install to install it just fine, and it can see my module
and try to load it, but when my module tries to require("...") the binary
module it cannot find it, it seems because the custom_plugins directory is
not part of the ?.so search path only the ?.lua search path.
Would it be sensible for prosody to add eg
/var/lib/prosody/custom_plugins/lib/lua/5.4 to the ?.so search path for
require, or is there a different approach I should be considering here?
I actually thought this was unintentionally possible already, but the
search paths are indeed not added to the regular Lua ones so require()
can't find them, only module:require() which can't load binary modules.
One thing I might consider a blocker is that the plugin management code
can't _unload_ binary modules currently, so upgrading and reloading
modules is not enough.
If you're okay with needing extra steps to upgrade and replace code,
there are some things that can be done without code changes:
You could install the binary bits with luarocks into the Prosody home
directory:
sudo -u prosody luarocks install mybinarybits
Another trick would be to set the plugin installer path to
`~prosody/.luarocks`, i.e. the same path the above luarocks command
would use. Maybe this should have been the default, I'm not sure.
Then `prosodyctl install` and `luarocks install` (as the prosody user)
would be essentially the same.
installer_plugin_path = "/var/lib/prosody/.luarocks"
--
Zash
--
You received this message because you are subscribed to the Google Groups
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/prosody-dev/ZyzTaxyeCqq-S8ho%40diploria.zash.se.