jirutka / luapak

Easily build a standalone executable for any Lua program
MIT License
200 stars 7 forks source link

unexpected symbol near '<\127>' #12

Closed erichowey closed 3 years ago

erichowey commented 3 years ago

I have the following rockspec:

package = "gujo"
version = "0.1-1"

description = {
    summary = "A Lua Dialplan Framework for Asterisk",
    detailed = [[
        A Lua Dialplan Framework for Asterisk
    ]],
    homepage = "",
    license = "MIT"
}

dependencies = {
    "lua >= 5.1",
    "redis-lua >= 2.0.4-1",
    "luaorm >= 1.1.1-1",
    "inifile >= 1.0-2",
    "busted >= 2.0.0-1",
    "inspect >= 3.1.1-0",
    "lua-log >= 0.1.6-1"
}

source = {
    url = "https://github.com/talkroute/gujo"
}

build = {
    type = "builtin",
    modules = {
        gujo = "main.lua"
    }
}

and the following code in main.lua:

print("hello")

i'm running the following luapak command:

eric@beast:~/luaSandbox$ luapak make gujo-0.1-1.rockspec -s main.lua -o extensions.lua --lua-lib=/usr/lib/x86_64-linux-gnu/liblua5.3.a
luapak: Building /home/eric/luaSandbox/gujo-0.1-1.rockspec (/home/eric/luaSandbox)
gujo 0.1-1 is now installed in /home/eric/luaSandbox/.luapak (license: MIT)

luapak: Resolving dependencies...
luapak: Loading and minifying Lua modules...
luapak: Generating extensions.lua.c...
luapak: Compiling extensions.lua.o...
luapak: Linking extensions.lua...
luapak: Build completed: extensions.lua

however, when I attempt to run the packed file:

eric@beast:~/luaSandbox$ lua extensions.lua 
lua: extensions.lua:1: unexpected symbol near '<\127>'

Any ideas on this one? I cannot figure out what's going on.

jirutka commented 3 years ago

Have you actually read the documentation?

Makes a standalone executable from Lua package(s). This is the main Luapak command that handles entire process from installing dependencies to compiling executable.

Executable is not a Lua script to be run via Lua interpreter, but a binary that bundles your project and the Lua interpreter itself. That's the whole point of Luapak.