Giter Club home page Giter Club logo

luapak's Introduction

Luapak

Build Status Windows Build Status LDoc

Luapak is a command-line tool that offers complete, multi-platform (Linux, macOS, and Windows), adjustable, all-in-one (yet modular) solution for building a standalone, zero-dependencies, possibly statically linked (only on Linux) executable for (almost) any Lua program. It Just Works!

  1. Resolves, builds and installs project’s Lua dependencies (declared in rockspec) from LuaRocks. Lua/C modules (aka native extensions) are built as static libraries (.a archive files), so they can be statically linked into resulting executable.[1]

  2. Resolves actually required Lua and Lua/C modules (.lua and .a files) using static code analysis of the project and its dependencies (recursively).

  3. Merges all required Lua modules into a single Lua script.

  4. Minifies the Lua script (i.e. removes unnecessary characters to shrink its size) using LuaSrcDiet.

  5. Compresses the Lua script using BriefLZ algorithm.

  6. Embeds the Lua script into a generated C wrapper.

  7. Compiles the C wrapper and links it with Lua interpreter (PUC Lua 5.1–5.3 and LuaJIT supported) and Lua/C libraries (aka native extensions) into a standalone executable.

All these steps can be run with single command luapak make <rockspec>, or separately if you need more control. You can discover available commands and their options in section Commands.

Table of Contents

Commands

luapak make

Click here to expand…
Usage: luapak make [options] [PACKAGE...]
       luapak make --help

Makes a standalone executable from Lua package(s). This is the main Luapak
command that handles entire process from installing dependencies to
compiling executable.
Arguments:
  PACKAGE                         Lua package to build specified as <source-dir>:<rockspec>.
                                  :<rockspec> may be omitted if the <source-dir> or
                                  <source-dir>/rockspec(s) contains single rockspec, or multiple
                                  rockspecs for the same package (i.e. with different version).
                                  In the further case rockspec with the highest version is used.
                                  <source-dir>: may be omitted if the <rockspec> is in the
                                  project's source directory or rockspec(s) subdirectory.
                                  If no argument is given, the current directory is used as
                                  <source-dir>.

Options:
  -s, --entry-script=FILE         The entry point of your program, i.e. the main Lua script. If not
                                  specified and the last PACKAGE defines exactly one CLI script,
                                  then it's used.

  -e, --exclude-modules=PATTERNS  Module(s) to exclude from dependencies analysis and the
                                  generated binary. PATTERNS is one or more glob patterns matching
                                  module name in dot notation (e.g. "pl.*"). Patterns may be
                                  delimited by comma or space. This option can be also specified
                                  multiple times.

  -g, --debug                     Enable debug mode, i.e. preserve line numbers, module names and
                                  local variable names for error messages and backtraces.

  -i, --include-modules=PATTERNS  Extra module(s) to include in dependencies analysis and add to
                                  the generated binary. PATTERNS has the same format as in
                                  "--exclude-module".

      --lua-impl=NAME             The Lua implementation that should be used - "PUC" (default),
                                  or "LuaJIT". This is currently used only as a hint to find the
                                  correct library and headers when auto-detection is used
                                  (i.e. --lua-incdir or --lua-lib is not specified).

      --lua-incdir=DIR            The directory that contains Lua (or LuaJIT) headers. If not
                                  specified, luapak will look for the lua.h (and luajit.h) file
                                  inside: Luarock's LUA_INCDIR, ./vendor/lua, ./deps/lua,
                                  /usr/local/include, and /usr/include. If --lua-version is
                                  specified, then it will also try subdirectories lua<version> and
                                  lua-<version> of each of the named directories and verify that
                                  the found lua.h (or luajit.h) is for the specified Lua
                                  (or LuaJIT) version.

      --lua-lib=FILE              The library of Lua interpreter to include in the binary. If not
                                  specified, luapak will try to find library with version
                                  corresponding to the headers inside Luarock's LUA_LIBDIR,
                                  ./vendor/lua, ./deps/lua, /usr/local/lib, /usr/local/lib64,
                                  /usr/lib, and /usr/lib64.

      --lua-version=VERSION       The version number of Lua (or LuaJIT) headers and library to try
                                  to find (e.g. "5.3", "2.0").

  -o, --output=FILE               Output file name or path. Defaults to base name of the main
                                  script with stripped .lua extension.

  -C, --no-compress               Disable BriefLZ compression of Lua sources.

  -M, --no-minify                 Disable minification of Lua sources.

  -t, --rocks-tree=DIR            The prefix where to install required modules. Default is
                                  ".luapak" in the current directory.
  -q, --quiet                     Be quiet, i.e. print only errors.

  -v, --verbose                   Be verbose, i.e. print debug messages.

  -h, --help                      Display this help message and exit.

Environment Variables:
  AR          Archive-maintaining program; default is "ar".
  CC          Command for compiling C; default is "gcc".
  CMAKE       Command for processing CMakeLists.txt files; default is "cmake".
  CFLAGS      Extra flags to give to the C compiler; default is "-Os -fPIC".
  LD          Command for linking object files and archive files; default is "ld".
  LDFLAGS     Extra flags to give to compiler when they are supposed to invoke the linker;
              default on macOS is "-pagezero_size 10000 -image_base 100000000".
  MAKE        Command for executing Makefile; default is "make".
  RANLIB      Command for generating index to the contents of an archive; default is "ranlib".
  STRIP       Command for discarding symbols from an object file; default is "strip".

luapak analyse-deps

Click here to expand…
Usage: luapak analyse-deps [-a|-f|-m|-g] [options] FILE...
       luapak analyse-deps --help

Analyses dependency graph of Lua module(s) using static code analysis (looks
for "require" expressions).
Arguments:
  FILE                        The entry point(s); path(s) to Lua script(s) to analyse.

Options:
  -a, --all                   Print all information (default).
  -f, --found                 Print only found modules.
  -m, --missing               Print only missing modules.
  -g, --ignored               Print only excluded/ignored modules.

  -e, --excludes=PATTERNS     Module(s) to exclude from the dependencies analysis. PATTERNS is one
                              or more glob patterns matching module name in dot notation
                              (e.g. "pl.*"). Patterns may be delimited by comma or space. This
                              option can be also specified multiple times.

  -n, --ignore-errors         Ignore errors from dependencies resolution (like unredable or unparseable files).

  -P, --no-pcalls             Do not analyse pcall requires.

  -W, --no-wildcards          Do not expand "wildcard" requires.

  -p, --pkg-path=PATH         The path pattern where to search for Lua and C/Lua modules instead of
                              the default path.

  -v, --verbose               Be verbose, i.e. print debug messages.

  -h, --help                  Display this help message and exit.

luapak build-rock

Click here to expand…
Usage: luapak build-rock [options] ROCKSPEC...
       luapak build-rock --help

Builds Lua/C module as a library archive suitable for static linking
and installs it into rocks tree.
Arguments:
  ROCKSPEC                    Path of the rockspec file to build and install.

Options:
  -C, --directory=DIR         Change directory before doing anything.

  -i, --lua-impl=NAME         The Lua implementation that should be used - "PUC" (default), or
                              "LuaJIT". This is currently used only as a hint to find the correct
                              headers when auto-detection is used (i.e. --lua-incdir unspecified).

  -I, --lua-incdir=DIR        The directory that contains Lua (or LuaJIT) headers. If not
                              specified, luapak will look for the lua.h (and luajit.h) file inside:
                              Luarock's LUA_INCDIR, ./vendor/lua, ./deps/lua, /usr/local/include,
                              and /usr/include. If --lua-version is specified, then it will also
                              try subdirectories lua<version> and lua-<version> of each of the
                              named directories and verify that the found lua.h (or luajit.h) is
                              for the specified Lua (or LuaJIT) version.

  -l, --lua-version=VERSION   The version number of Lua (or LuaJIT) headers and library to try
                              to find (e.g. "5.3", "2.0").

  -t, --rocks-tree=DIR        The prefix where to install Lua/C modules Default is ".luapak" in
                              the current directory.

  -v, --verbose               Be verbose, i.e. print debug messages.

  -h, --help                  Display this help message and exit.

Environment Variables:
  AR          Archive-maintaining program; default is "ar".
  CC          Command for compiling C; default is "gcc".
  CMAKE       Command for processing CMakeLists.txt files; default is "cmake".
  CFLAGS      Extra flags to give to the C compiler; default is "-Os -fPIC".
  LD          Command for linking object files and archive files; default is "ld".
  LDFLAGS     Extra flags to give to compiler when they are supposed to invoke the linker;
              default on macOS is "-pagezero_size 10000 -image_base 100000000".
  MAKE        Command for executing Makefile; default is "make".
  RANLIB      Command for generating index to the contents of an archive; default is "ranlib".

luapak merge

Click here to expand…
Usage: luapak merge [options] MODULE...
       luapak merge --help

Combines multiple Lua modules into a single file. Each module is be wrapped in
a function, or string loaded by "load" (--debug), and assigned to
"package.preload" table.
Arguments:
  MODULE                    Name and path of Lua module delimited with "="
                            (e.g. "luapak.utils=luapak/utils.lua") or just path of module.

Options:
  -g, --debug               Preserve module names and line numbers in error backtraces?
  -o, --output=FILE         Where to write the generated code. Use "-" for stdout. Default is "-".
  -v, --verbose             Be verbose, i.e. print debug messages.
  -h, --help                Display this help message and exit.

luapak minify

Click here to expand…
Usage: luapak minify [options] [FILE]
       luapak minify --help

Minifies Lua source code - removes comments, unnecessary white spaces and
empty lines, shortens numbers and names of local variables.
Arguments:
  FILE                        Path of the Lua source file, or "-" for stdin.

Options:
  -l, --keep-lno              Do not affect line numbers.
  -n, --keep-names            Do not rename local variables.
  -o, --output=FILE           Where to write the output. Use "-" for stdout. Default is "-".
  -v, --verbose               Be verbose, i.e. print debug messages.
  -h, --help                  Display this help message and exit.

luapak wrapper

Click here to expand…
Usage: luapak wrapper [options] FILE [MODULE_NAME...]
       luapak wrapper --help

Wraps Lua script into a generated C file that can be compiled and linked with
Lua interpreter and Lua/C native extensions into a standalone executable.
Arguments:
  FILE                        The Lua file to embed into the wrapper.
  MODULE_NAME                 Name of native module to preload (e.g. "cjson").

Options:
  -C, --no-compress           Do not compress FILE using BriefLZ algorithm.
  -o, --output=FILE           Where to write the generated code; "-" for stdout. Default is "-".
  -v, --verbose               Be verbose, i.e. print debug messages.
  -h, --help                  Display this help message and exit.

What Luapak Is Not?

  • Luapak is not a transpiler from Lua to C, nor compiler to a native code. It does not save you from runtime errors in your Lua code, nor increase its performance.

Installation

Note: If you want to bootstrap development environment for running tests, read the next section.

Using LuaRocks

You can install luapak using LuaRocks (the Lua package manager):

luarocks install luapak

or to get the latest development version:

luarocks install --server=http://luarocks.org/dev luapak

Download Standalone Binary

You can also download standalone Luapak binaries for Linux, macOS and Windows from Releases.

Note: Linux binaries are statically linked with musl libc, so they should work on any Linux system.

Set Up Development Environment

  1. Clone this repository:

    git clone https://github.com/jirutka/luapak.git
    cd luapak
  2. Source file .envrc into your shell (or manually add $(pwd)/.venv/bin to your PATH):

    source .envrc
  3. Install Lua and modules for running tests into directory .venv:

    ./script/bootstrap
  4. Start hacking!

  5. Run linters:

    ./script/test

TODO

  • Write documentation into README.

  • Write integration tests.

  • Analyse usage of Lua standard modules and exclude unused from the binary.

Similar Projects

Luapak is not the first tool for packing Lua code into standalone executable, but it’s the most complete. Here’s a list of similar projects I know about, some of them served as an inspiration for Luapak.

License

This project is licensed under MIT License. For the full text of the license, see the LICENSE file.


1. Luapak includes LuaRocks package manager with rewritten builtin build backend and modified settings to build Lua/C modules as static libraries. Other backends (make, cmake, …) are not supported in the sense that Luapak cannot alter build process to produce static libraries; it’s up to the user to ensure that.

luapak's People

Contributors

jirutka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luapak's Issues

unexpected symbol near '<\127>'

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.

Can't build executable that requires luasec

I have this simple repro testcase that uses lua-requests:

local requests = require("requests")
print("go")
do
  local res = requests.get("http://192.168.1.1")
  return print(res.text)
end

...with this .rockspec:

package = "fennel-http"
version = "scm-1"
source = {
   url = ""
}
description = {
   homepage = "",
   license = ""
}
dependencies = {
   "lua >= 5.1, < 5.4",
   "lua-requests"
}
build = {
   type="builtin",
   modules = {
      request = "request.lua",
   },
   install = {
       bin =  {
           "request.lua"
        }
   }
}

Somehow luapak can't get lua-requests installed into .luapak.

Running:

% luapak make --lua-lib=/usr/lib/x86_64-linux-gnu/liblua5.1.a

..gives me this:

lua-requests 1.2-1 depends on luasec >= 0.5.1 (not installed)
Installing https://luarocks.org/luasec-0.8-1.src.rock
luapak: error: Failed to build /mnt/c/....rockspec: Failed installing dependency: https://luarocks.org/lua-requests-1.2-1.src.rock - Failed installing dependency: https://luarocks.org/luasec-0.8-1.src.rock - Failed copying ssl.so

Any ideas?

Lua 5.4 not supported

The package uploaded to luarocks does not support lua 5.4.x branch

Is it possible to make it support it ?

Cross-compilation

I want to make a windows .exe from macOS, how would I do that?

I have a Windows toolchain set up that can compile C/C++ and many other things to Windows .exes, but I can't figure out how to make luapak use those! I know I need Windows-specific libraries, and I can manage that, but how do I tell luapak to use those and output a Windows-format .exe?

Luapak dependency analysis feedback

Sorry about the issue spam but as you can probably tell I'm working through using luapak in a practical way and I figure too much feedback is better than no feedback.

I do appreciate that luapak will try to statically analyze the modules my project requires, but because my package is nontrivial and includes dependencies that themselves have dependencies it's hard to tell where missing dependencies are used and why.

For example, here is the output from using luapak on lua-lsp:

luapak: Resolving dependencies...
luapak: warn: The following modules are required, but not found:
luapak: warn:    debug
luapak: warn:    lpeg
luapak: warn:    lua-lsp.formatting
luapak: warn:    luacheck
  • I have no idea where lpeg is used and I'm not sure how I'd find out. It'd be nice for luapak itself to track the source of these dependencies and then report them to me as a quick list next to the dependency name.
  • debug should(?) be the default lua debug module? With some knowledge of the source of this I could probably say for sure, but I don't have that info as of right now.
  • lua-lsp.formatting here is a straightforward mistake on my part: my source directory includes it but not my rockspec file. Still, if it's easy to do so It'd be nice to have a message for exactly this case.
  • I know for a fact I depend on luacheck, but since it's optional it's not listed as a dependency in the rockspec. It'd be nice to have an alternate way to specify luarocks dependencies to support this too.

main:3295: attempt to index a nil value (field 'LUAROCKS_UNAME_S')

When attempting to run Luapak make on Windows, I get the following: main:3295: attempt to index a nil value (field 'LUAROCKS_UNAME_S')
stack traceback:
main:3295: in function main:3270
[C]: in function 'require'
main:8454: in function main:8453
[C]: in function 'require'
main:7468: in function main:7467
[C]: in function 'require'
main:624: in function main:623
[C]: in function 'require'
main:5310: in function main:5309
[C]: in function 'require'
main:10587: in main chunk

Luapak seems to require "uname" which is not a valid command on Windows

I try to use luapak in Windows. I downloaded the Windows binary package
0.1.0 beta 5

Running luapak make yields:

The command "uname" was not found.
main:1186: attempt to index a nil value (field 'LUAROCKS_UNAME_S')
stack traceback:
main:1186: in function main:1161
[C]: in function 'require'
main:4507: in function main:4506
[C]: in function 'require'
main:3896: in function main:3895
[C]: in function 'require'
main:1202: in function main:1201
[C]: in function 'require'
main:5341: in function main:5340
[C]: in function 'require'
main:10587: in main chunk

LuaRocks 3 compatibility

Hey, I am currently in need of a way of bundling up a bunch of Lua and binary rock-dependencies together with some Lua code and create a native-ish install experience. luapak seems perfect, but has some trouble cooperating with luarocks 3:

/usr/bin/lua5.3: /usr/share/lua/5.3/luapak/luarocks/cfg_extra.lua:1: module 'luarocks.cfg' not found:No LuaRocks module found for luarocks.cfg
	no field package.preload['luarocks.cfg']
	no file ...

I see that you wrote this quite a while ago and I assume are not interested in working on this yourself currently. I am happy to take a look myself, I just wanted to ask if there is any advice you can give me before I try to find my own way into your source and the new luarocks? Or is there something bigger about luarocks3 that makes luapak not viable to be ported?

Is rockspec mandatory ? (can I individually build and link )

Hello,

This is not really an issue, but more of a usage doubt.
I am trying to use luapak on my project which has a handful of
my modules and a couple of thirdparty modules (all included as source).
Since I don't have a rockspec, I tried the following:

  • Generate the combined lua file from all the modules I need (using merge)
  • Generate the C file for the merged file (using wrapper)
  • Compile and link all the C files using LuaJIT static lib and includes

I got my executable, but its not doing anything when run - probably I am missing
something - do I have to specify what is the entry point/main [module]?

What is a Lua "package"?

So I'm quickly reading the CLI docs:

Usage: luapak make [options] [PACKAGE...]
       luapak make --help

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

and it's not clear to me what a lua package is in this context. Is it a directory with a rockspec in it, the rockspec itself, etc? A bit of definition or maybe an example would help here.

EDIT: so it looks like package is pretty adequately explained in the "real" luapak make --help docs: in this case I was reading the github readme page instead: so the actual actionable feedback is just to update the readme.md to include this info.

module '_cqueues' not found

I am trying to pak a small demo program that uses socket & http.request. Here is the demo-project. I am probably doing something wrong. I am sort of new to luarocks and luapak.

Here is the entry-point:

local socket = require 'socket'
local http_request = require 'http.request'

local server = assert(socket.bind('*', 0))
local ip, port = server:getsockname()

print('Please telnet to localhost on port ' .. port .. '. Give it a URL to download & run.')

function run(url)
  local headers, stream = assert(http_request.new_from_uri(url):go())
  local body = assert(stream:get_body_as_string())
  if headers:get ':status' ~= '200' then
    error(body)
  end
  local f = loadstring(body)
  return f()
end

while 1 do
  local client = server:accept()
  local url, err = client:receive()
  if not err then client:send('Downloading '..url .. '\n') end
  run(url)
  client:close()
end

It's just a small test of luasocket + http, really. I basically just want a bundled luajit + those 2 libs.

When I run this to pak it:

luapak make --lua-lib=/usr/lib/x86_64-linux-gnu/libluajit-5.1.so

I also tried:

luapak make --lua-lib=/usr/lib/x86_64-linux-gnu/libluajit-5.1.a

It says

Missing dependencies for rattata scm-1:
   http (not installed)
   luasocket (not installed)
   cqueues (not installed)

but all of those are installed (on my system) and the script works outside of luapak. After this, it builds things (it looks like it's building the things in the list) and finishes with no errors (and a lot of warnings)

uapak: Resolving dependencies...
luapak: warn: The following modules are required, but not found:
luapak: warn:    _cqueues
luapak: warn:    _cqueues.auxlib
luapak: warn:    _cqueues.condition
luapak: warn:    _cqueues.errno
luapak: warn:    _cqueues.socket
luapak: warn:    _openssl.pkey
luapak: warn:    _openssl.rand
luapak: warn:    _openssl.ssl
luapak: warn:    _openssl.ssl.context
luapak: warn:    _openssl.x509.verify_param
luapak: warn:    bit
luapak: warn:    coroutine
luapak: warn:    math
luapak: warn:    psl
luapak: warn:    string
luapak: warn:    struct
luapak: warn:    zlib
luapak: Loading and minifying Lua modules...
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: warn: Source equivalence test failed!
luapak: Generating dist/rattata.c...
luapak: Compiling dist/rattata.o...
luapak: Linking dist/rattata...
luapak: Build completed: dist/rattata

When I try to run ./dist/rattata, I get this:

main:11384: module '_cqueues' not found:
	no field package.preload['_cqueues']
stack traceback:
	[C]: in function 'require'
	main:11384: in function <main:11383>
	[C]: in function 'require'
	main:7060: in function <main:7059>
	[C]: in function 'require'
	main:6421: in function <main:6416>
	[C]: in function 'require'
	main:11835: in main chunk

It seems like it's not finding the native stuff it built. What am I doing wrong?

awesome

Never thought to do such a project,
anyway it is a good idea, awesome!

Supporting Luarocks 3.0.1

I believe you should not make your code dependent on a particular version of luarocks
and if anything , if that must be the case then use the latest version Luarocks 3.0.1

luaver="" && [ -n "$luaver" ] || luaver=`/usr/bin/lua5.1 -e 'print(_VERSION:sub(5))'`; \
mkdir -p "/usr/local/lib/luarocks/rocks-5.1/luarocks/2.4.4-1/lua/luarocks"; \
lprefix=`echo "/usr/local/lib/luarocks/rocks-5.1/luarocks/2.4.4-1/lua" | sed 's,/lib/luarocks/.*,,'`; sed "s,LUAROCKS_PREFIX=.*,LUAROCKS_PREFIX=[[$lprefix]],g" /share/lua/$luaver/luarocks/site_config.lua > "/usr/local/lib/luarocks/rocks-5.1/luarocks/2.4.4-1/lua/luarocks/site_config.lua"
sed: can't read /share/lua/5.1/luarocks/site_config.lua: No such file or directory
Makefile.luarocks:13: recipe for target 'copy_site_config' failed
make: *** [copy_site_config] Error 2

Error: Failed installing dependency: https://luarocks.org/luarocks-2.4.4-1.src.rock - Build error: Failed installing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.