Skip to content

Fix lua 5.5 incompatibilities#678

Open
spotaws wants to merge 1 commit into
darktable-org:masterfrom
spotaws:lua-5.5
Open

Fix lua 5.5 incompatibilities#678
spotaws wants to merge 1 commit into
darktable-org:masterfrom
spotaws:lua-5.5

Conversation

@spotaws
Copy link
Copy Markdown

@spotaws spotaws commented May 18, 2026

With Lua 5.5, for loop control variables are now read-only by default. These changes fix that issue across all the scripts in this repository. Note that these fixes are backwards compatible with Lua 5.4.

The change in tools/script_manager.lua is a little unique. It has this at the end of the for loop:

i = i + 1

... where i is the for loop control variable. Even in Lua 5.4, this ... didn't do anything. Hypothetically, if the i variable was used at a later point in the for loop, that line might have merit, but it's the last line of the for loop. Lua (as far as I can find) has always kept the counter value separate from any manipulation within the loop, so this line is just a no-op, and I'm not entirely sure why it was there. Commenting it out should be safe and will resolve the Lua 5.5 error.

I searched through all the scripts to see if there were any other Lua 5.5 incompatibilities besides modifying the for loop control var inside the loop, and I could not find any.

…ol variables within the for loop

Signed-off-by: Tom spot Callaway <spotaws@amazon.com>
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.

1 participant