After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742410 - Implement logic in Lua instead of using Lua C API
Implement logic in Lua instead of using Lua C API
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: lua
git master
Other Linux
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-05 19:45 UTC by Garrett Regier
Modified: 2015-02-14 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Shorten Lua plugin loader filenames (3.70 KB, patch)
2015-01-19 09:49 UTC, Garrett Regier
committed Details | Review
Use Lua to implement the plugin loader's logic (31.28 KB, patch)
2015-01-19 09:49 UTC, Garrett Regier
none Details | Review
Use Lua to implement the plugin loader's logic v2 (32.04 KB, patch)
2015-01-21 01:13 UTC, Garrett Regier
reviewed Details | Review
Use Lua to implement the plugin loader's logic v3 (32.02 KB, patch)
2015-01-22 16:44 UTC, Garrett Regier
committed Details | Review

Description Garrett Regier 2015-01-05 19:45:17 UTC
Instead of implementing all of the loader's logic using Lua's C API we should
implement it in Lua itself using internal.lua

This is the Lua companion bug for the Python plugin loader's conversion: https://bugzilla.gnome.org/show_bug.cgi?id=742349
Comment 1 Garrett Regier 2015-01-19 09:49:06 UTC
Created attachment 294847 [details] [review]
Shorten Lua plugin loader filenames

Using "peas-plugin-loader-lua" as a prefix is just too long.
Comment 2 Garrett Regier 2015-01-19 09:49:31 UTC
Created attachment 294848 [details] [review]
Use Lua to implement the plugin loader's logic

This allows us to avoid using Lua's C API and have a more understandable implementation.
Comment 3 Garrett Regier 2015-01-21 01:13:04 UTC
Created attachment 295058 [details] [review]
Use Lua to implement the plugin loader's logic v2

This allows us to avoid using Lua's C API and have a more understandable implementation.

----

Update to specially format the traceback when loading a plugin, as done in the Python plugin loader.
Comment 4 Ignacio Casal Quinteiro (nacho) 2015-01-21 08:44:45 UTC
Review of attachment 294847 [details] [review]:

Sure.
Comment 5 Ignacio Casal Quinteiro (nacho) 2015-01-21 08:52:20 UTC
Review of attachment 295058 [details] [review]:

At a quick check just that minor comment specially since I do not know much of this api... let me know if you want me to check something specific

::: loaders/lua5.1/peas-lua-compile.lua
@@ +3,3 @@
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Library General Public License as published by

ditto for the previous stuff, we should change the license

@@ +41,3 @@
+
+local function main(arg)
+    for i=1,#arg,2 do

I'm not a fan of this styling... is it on purpose or c&p error?
Comment 6 Garrett Regier 2015-01-22 16:44:29 UTC
Created attachment 295197 [details] [review]
Use Lua to implement the plugin loader's logic v3

(In reply to comment #5)
> Review of attachment 295058 [details] [review]:
> 
> At a quick check just that minor comment specially since I do not know much of
> this api... let me know if you want me to check something specific
> 

Mainly just knowing if anything seems especially odd/stupid and if the *.lua files seem sane is good.


> ::: loaders/lua5.1/peas-lua-compile.lua
> @@ +3,3 @@
> +--
> +-- This program is free software; you can redistribute it and/or modify
> +-- it under the terms of the GNU Library General Public License as published
> by
> 
> ditto for the previous stuff, we should change the license
> 

I'll do this as another patch to the original bug.


> @@ +41,3 @@
> +
> +local function main(arg)
> +    for i=1,#arg,2 do
> 
> I'm not a fan of this styling... is it on purpose or c&p error?

Copied from the Lua tutorial, changed to more sane coding style. Also, update the file a bit as my Lua has gotten a bit better.
Comment 7 Garrett Regier 2015-02-14 20:33:08 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.