Skip to main content
danielm49702136
Known Participant
Sep 14, 2026 6:53 PM UTC
Question

Lightroom lua plugin compilation

I would like to compile a plugin in order to deliver it without the source code. There are two versions of the lua compiler with the sdk: one for windows and one for mac. I do not know how to proceed, my plugin has many files which generates tables of functions I do import. An example would be:
 

--<file1.lua>

functions={}

functions.one=function (...<function definition>...

functions.two=function (...<function definition>...


return functions
--<main.lua>

local functions=requiere "file1"
...

 

  • 1. How do I compile both files and make main.luac  import the functions of the compiled file1.luac ?
  •  2. If I compile it in windows, will the bytecode work in mac or do I need to make bytecodes for each platform?
  • 3. Is there any other way to deliver the code? I know there are some codes for reversing the luac to lua.

    Regards,
    Daniel

    3 replies

    danielm49702136
    Known Participant
    Sep 18, 2026 1:59 PM UTC

    Thanks! The Lightroom community, and especially those of us who develop plugins, really benefit from all the contributions you share. I’ve personally learned a lot from you!

    Translate
    danielm49702136
    Known Participant
    Sep 14, 2026 11:48 PM UTC

    I have been able to compile the code.

    I have used de lua compiler for windows provided with the sdk and used for the output .lua extension and not .luac    require(file1) did not find file1.luac but it was ok to use compiled file named file1.lua

    I did not compile Info.lua (just by guess, I have not been able to run the plugin if info.lua was compiled)

    Will the compiled code work in mac althought compiled with windows lua compiler?

    Translate
    johnrellis
    Legend
    Sep 17, 2026 5:58 PM UTC

    [View this post in your web browser. It contains formatting and images that don't appear in email.]

     

    Will the compiled code work in mac althought compiled with windows lua compiler?

     

    Yes. However, shipping a plugin that hasn’t been tested on both platforms is fraught with the possibility of bugs. There are too many platform-dependent behaviors that aren’t easy to avoid without testing.

    Translate