Skip to content

Conversation

@xiota
Copy link
Contributor

@xiota xiota commented Mar 6, 2023

Extends #1233 to add support for Lua 5.1 and LuaJIT by adding compatibility functions/defines. The build script is fixed to not ignore the --with-lua-pkg option and to recognize Lua variants: lua51, luajit, lua, lua53, lua52. Systems that use a different basename will have to explicitly specify the name, eg lua5.1 or lua-5.1, during configure. To change variants, reconfigure and rebuild.

./configure --with-lua-pkg=[lua]
make -C geanylua clean
make -C geanylua

Supercedes #1231, #1233, #1235.
Resolves #1228. Resolves #1133.

@xiota xiota changed the title GeanyLua: Add support LuaJIT and Lua 5.2-5.4 GeanyLua: Support for LuaJIT and Lua 5.1-5.4 Mar 7, 2023
@techee
Copy link
Member

techee commented Mar 8, 2023

I'm not sure we should do that. If the decision is to use LuaJIT with a Lua 5.1 fallback, we should support just these versions. Supporting tons of lua versions each with slight language modifications could really become hard to maintain. I don't think anyone of us will have time to test the plugin against all of the lua libraries. Similarly, if we decide to switch to say Lua 5.4, we should stop supporting other Lua versions.

Plus I think you accidentally pushed about all the changes in geany-plugins you've been playing with ;-)

@Skif-off
Copy link
Contributor

Skif-off commented Oct 9, 2023

@techee
In fact, there are few changes (I don't understand why changes not related to GeanyLua are lumped together) and these versions of Lua will no longer be different.
So theoretically, support will not be required for a long time.

@xiota
Copy link
Contributor Author

xiota commented Oct 9, 2023

Rebased on master. So far, when switching between Lua versions, including LuaJIT, the only issues I've run into were not isolated to one version of Lua.

@xiota
Copy link
Contributor Author

xiota commented Jul 4, 2025

@b4n I was hoping this could be merged for 2.1. I've been including the patches in builds while testing other PRs, and have intermittently been using different Lua versions for a couple years. Have not seen any functional differences across Lua versions.

Successfully compiled against current HEAD 9845647 with Lua 5.1, 5.2, 5.3, 5.4, and LuaJit. All versions of the plugin successfully loaded and launched the test scripts for the GeanyLua PRs that were merged recently.

As for what versions of Lua should be officially supported... Build should succeed for whatever Lua versions Arch Linux provides in official repos. Bugfix support for LuaJit and Lua 5.4. So far, bugs affecting builds for one Lua version have affected all.

@techee
Copy link
Member

techee commented Jul 4, 2025

I'm still not completely sure whether supporting all the lua versions is a good idea and whether it's useful for anything. For maintenance, bug reporting, etc. it would be easier to support a single lua version (e.g. 5.4). Anyway, this is just my opinion and if others disagree, please go ahead merging this PR.

@xiota
Copy link
Contributor Author

xiota commented Jul 4, 2025

This PR would provide a 5.1 → 5.4/LuaJit transition path for distros that are slow to update depends. 5.2/5.3 are just along for the ride because they require basically the same changes as 5.4.

It would be fine to have policy that LuaJit/5.4 are the only explicitly supported Lua implementations.

Could add a warning that 5.1/5.2/5.3 are EOL / deprecated.

@xiota xiota force-pushed the pr-lua-lua5x branch 3 times, most recently from ed4f774 to 3cd199a Compare July 5, 2025 15:46
@xiota
Copy link
Contributor Author

xiota commented Jul 5, 2025

Force pushed to rebase on current master and to address @b4n comments.

The default pkg-config name is set to "lua". This is presumed to point to some lua version. On Arch and Fedora, points to latest available, 5.4. Otherwise, the user/packager is assumed to provide the correct name for the desired Lua version.

Also updated the Linux workflow to Lua 5.4. Windows workflow appears to use a script that needs to be updated elsewhere.

@b4n b4n added this to the 2.2.0 milestone Jul 6, 2025
@xiota xiota changed the title GeanyLua: Support for LuaJIT and Lua 5.1-5.4 GeanyLua: Allow building with Lua 5.1-5.4 and LuaJIT Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GeanyLua] Switch to LuaJIT? [GeanyLua] For version 5.4.3?

4 participants