Skip to main content
C.Cella
Inspiring
April 17, 2024
Answered

SDK / getting "bad header in precompiled chunk" for my scripts.

  • April 17, 2024
  • 1 reply
  • 1042 views

I have downloaded the latest lua here: https://www.lua.org/download.html

Initialled on my Mac and all is fine.

I then wanted to obfuscate my code so I need to compile the scripts.

 

I do

 

 luac -o CompiledScriptName.lua ScriptName.lua

 

All seems to be ok, the new compiled file is created no issues...but then I get this error whenever I run the script in LrC.

 

NameOfScript.lua: bad header in precompiled chunk

 

Don't know what I am doing wrong here.

Any help would be appreciated.

This topic has been closed for replies.
Correct answer johnrellis

I have uninstalled lua 5.4.6

 

Now I don't understand how to install the luac I have in the SDK

There is no make.

I went to the Lua Binaries and I get this error when I want to download 5.1.5

The "/5.1.5/Tools Executa..MacOS1011_bin.tar.gz" file could not be found or is not available. Please select another file.

 

.

 

 

 


Oh, I see it's a little geeky to install:

 

1. Download or re-download the Lightroom Classic SDK from here:

https://developer.adobe.com/console/servicesandapis

 

and unzip it. 

 

2. In Terminal, do these commands:

cd /Users/john/Downloads/LrC_13.2_202402141005-bf1aeb84.release_SDK/Lua\ Compiler/mac
chmod +x luac
xattr -r -d com.apple.quarantine luac
cp luac /usr/local/bin

 

replacing the path in the first line with the path of where you downloaded the SDK.

1 reply

johnrellis
Genius
April 17, 2024

That downloaded "luac" is version 5.4.6, while LR requires 5.1.  Use the "luac" stored in the SDK subfolder "Lua Compiler/{mac,win}".  I don't think that's documented anywhere.

C.Cella
C.CellaAuthor
Inspiring
April 17, 2024

Ok, I will uninstall 5.4.6 and install the one that comes with the SDK.

 

.

 

 

C.Cella
C.CellaAuthor
Inspiring
April 17, 2024

I have uninstalled lua 5.4.6

 

Now I don't understand how to install the luac I have in the SDK

There is no make.

I went to the Lua Binaries and I get this error when I want to download 5.1.5

The "/5.1.5/Tools Executa..MacOS1011_bin.tar.gz" file could not be found or is not available. Please select another file.

 

.