darktable 3.5.1 and lua support

I have just upgraded to darktable 3.5.0~git2655.737515330b-1

I seem to have trouble with lua support. there’s a bunch of errors at start and from the script_manager I’m unable to activate scripts:

(base) 23:41:00 aadm@psion:~/.config/darktable$ darktable -d lua
1,525931 LUA ERROR: script_manager.lua: activate: 208: Error loading contrib/CollectHelper 
1,526004 LUA ERROR: script_manager.lua: activate: 209: Error message: bad argument #2 to '?' (string expected, got function) 
1,526601 LUA ERROR: script_manager.lua: activate: 208: Error loading contrib/autostyle 
1,526646 LUA ERROR: script_manager.lua: activate: 209: Error message: /home/aadm/.config/darktable/lua/contrib/autostyle.lua:155: bad argument #2 to 'register_event' (string expected, got function) 
1,712476 LUA ERROR: script_manager.lua: activate: 208: Error loading contrib/copy_attach_detach_tags 
1,712552 LUA ERROR: script_manager.lua: activate: 209: Error message: ...config/darktable/lua/contrib/copy_attach_detach_tags.lua:250: bad argument #2 to 'register_event' (string expected, got function) 
2,029086 LUA ERROR: script_manager.lua: activate: 208: Error loading contrib/quicktag 
2,029126 LUA ERROR: script_manager.lua: activate: 209: Error message: /home/aadm/.config/darktable/lua/contrib/quicktag.lua:273: bad argument #2 to 'register_event' (string expected, got function) 
2,082331 LUA ERROR API Version: 7.0.0
2,082968 LUA ERROR: script_manager.lua: activate: 208: Error loading official/copy_paste_metadata 
2,082994 LUA ERROR: script_manager.lua: activate: 209: Error message: bad argument #2 to '?' (string expected, got function) 
2,160943 LUA ERROR: script_manager.lua: activate: 208: Error loading official/image_path_in_ui 
2,160973 LUA ERROR: script_manager.lua: activate: 209: Error message: ...aadm/.config/darktable/lua/official/image_path_in_ui.lua:88: bad argument #2 to 'register_event' (string expected, got function) 

From the github repo I can see that there’s a branch called “API-7.0.0-dev” – probably I should change to that branch since 3.5.0 has Lua 7.0 support? But how to do that?

Yes you need the API-7.0.0-dev branch. I haven’t tested it myself, but luckily we have @wpferguson here as the expert for this.

If you are comfortable with git then

cd $home/.config/darktable/lua
git checkout API-7.0.0.dev

I’m working on an update to script_manager to make it branch and API aware so that it will automatically switch to the correct branch. It will be done by Friday, if you can wait that long. Also on Friday the current master will be checked out as a branch named API-6.1.0. Then the current API-7.0.0-dev branch will be merged into master. Sooner or later, depending on when the lua 5.4 pull request gets merged into master, the new development branch will be API-8.0.0-dev.

I’ll update here when things are ready. I’ll also release it on the mailing list and in a separate post.

3 Likes

thanks Bill!

I did the simple git checkout <branch> and everything works now!

About the rest of your plan – am I correct in understanding that when 3.6 comes out (next week I believe?) there will be no troubles about the new lua api? (7.0 will become master means just that, right?)

Yes, the dev branch will become master and the current master will be branched as API-6.1.0. It will probably happen in ~30 hours or so. I’ll also post on pixls and the mailing lists what to expect from the new lua API and then brace myself for the storm from the people that didn’t read it :smiley:

2 Likes