Refactor: allow alternatives for Lua libraries loaded with all profiles#3648
Conversation
This allows a bit of flexibility especially as I have recently changed
the library used to provide the `zip` library. After this PR the following
are allowed for the following libaries:
* `zip`:
* lua-zip (the Brimworks one that MacOs has recently been switched to to
avoid a zziplib dependency.
* luazip (the one originally by the Kepler organisation)
* `utf8`:
* `lua-utf8` (a "Starwing" one, what we were using up to now)
* `utf8` (an alternative version from the same GitHub repository
which the user might grab instead, might be an older version)
This has been test and confirmed to work as I expect (particularly for
luazip & lua-zip modules).
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
|
Hm... but I don't want to spend my energy helping people who install something else other than what we support - it doesn't work for them, so they come to us for help. Why can't they follow instructions and install what we require? Seems like less hassle for everyone involved? And the loading code doesn't have to be complicated with message queues (!). |
|
I don't like having to use different luarocks for different systems and this will allow for flexibility if we add any more rocks to our requirements. It will also make it easier to swap the Linux and Windows installer builds to be swapped over to Edit: I am quite happy to not have even an indirect dependence on that confusingly name extra library i.e. |
|
So you'd like it that way - okay sounds good. It looks like the queue only ever stores one message at a time, can we use a multi-return from the function to return boolean+string ? |
|
The queue stores the error messages for all the attempts to provide a particular Lua module - and either ends up with a single Passing that Queue as a reference allows for a If I had been aware of it at the time the |
|
Sorry, I still only see it enqueing only 1 message at a time - either a success or a failure one. The queue's size is 1 item at most, ever. Am I missing something? |
vadi2
left a comment
There was a problem hiding this comment.
Right, I see where it comes into play now 👍
Bur module loading went from something simple to a complex beast now with message queues and support for library alternatives - let's not move further than this. Remember that code can break and someone will have to fix it and not get frustrated by how complicated something that should have been so simple is...
|
If you do not have/or they cannot both be loaded lua-zip NOR luazip for example you will get the list of all the file names and other possibilities that were tried. They will be different for each luarock or however it could be packaged, like the BTW I am just finding that there is merit in ensuring that your system environment defines |
This allows a bit of flexibility especially as I have recently changed the library used to provide the
ziplibrary. After this PR the following are allowed for the following libraries:zip:lua-zip(the "Brimworks" one that MacOs has recently been switched to to avoid azziplibdependency.luazip(the one originally by the Kepler organisation)utf8:lua-utf8(a "Starwing" one, what we were using up to now)utf8(an alternative version from the same GitHub repository which the user might grab instead)This has been test and confirmed to work as I expect (particularly for
luazip&lua-zipmodules) on Linux.Signed-off-by: Stephen Lyons slysven@virginmedia.com