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?
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:
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:
I also tried:
It says
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)
When I try to run
./dist/rattata, I get this:It seems like it's not finding the native stuff it built. What am I doing wrong?