Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Dependency Issues? #6

Closed
RickCarlino opened this issue Apr 28, 2013 · 15 comments
Closed

Possible Dependency Issues? #6

RickCarlino opened this issue Apr 28, 2013 · 15 comments

Comments

@RickCarlino
Copy link

I did a fresh install of Lua, Moonscript and Lapis on a new box running Linux and got errors when I first attempted to run 'lua help'. The first errors were fixed by installing lua-cjson and the second was fixed after I installed the lpeg luarock. This is the current error I get:

moon: /usr/local/share/lua/5.1/lapis/util/encoding.lua:20: module 'crypto' not found:No LuaRocks module found for crypto
no field package.preload['crypto']
no file '/usr/local/share/lua/5.1/crypto.lua'
no file '/usr/local/share/lua/5.1/crypto/init.lua'
no file '/home/rick/.luarocks/share/lua/5.1/crypto.lua'
no file '/home/rick/.luarocks/share/lua/5.1/crypto/init.lua'
no file '/usr/local/share/lua/5.2/crypto.lua'
no file '/usr/local/share/lua/5.2/crypto/init.lua'
no file '/home/rick/.luarocks/share/lua/5.2/crypto.lua'
no file '/home/rick/.luarocks/share/lua/5.2/crypto/init.lua'
no file '/usr/local/share/lua/5.2//crypto.lua'
no file '/usr/local/share/lua/5.2//crypto/init.lua'
no file '/usr/local/share/lua/5.2/crypto.lua'
no file '/usr/local/share/lua/5.2/crypto/init.lua'
no file '/usr/local/lib/lua/5.2/crypto.lua'
no file '/usr/local/lib/lua/5.2/crypto/init.lua'
no file './crypto.lua'
no file '/usr/local/lib/lua/5.1/crypto.so'
no file '/home/rick/.luarocks/lib/lua/5.1/crypto.so'
no file '/usr/local/lib/lua/5.2/crypto.so'
no file '/home/rick/.luarocks/lib/lua/5.2/crypto.so'
no file '/usr/local/lib/lua/5.2/crypto.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './crypto.so'
stack traceback:
[C]: in function 'require'
/usr/local/share/lua/5.1/lapis/util/encoding.lua:20: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.1/lapis/session.lua:4: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.1/lapis/application.lua:3: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.1/lapis/init.lua:2: in main chunk
[C]: in function 'require'
web.moon:1(1): in main chunk

@leafo
Copy link
Owner

leafo commented Apr 28, 2013

Interesting. LuaRocks should automatically install (lpeg, cjson, etc.) before installing Lapis via the rockspec. What command did you use to install Lapis?

luacrypo isn't listed as a dependency because it's only required if you try to include the module "lapis.encoding" not within nginx. Lapis doesn't do this normally, I only did this for testing.

From your stacktrace it looks like you are running web.moon file directly. I'm guessing you were trying to start the server? In case you missed it here's the tutorial on starting the server: http://leafo.net/lapis/reference.html#creating-an-application-lapis-command-line-tool

@RickCarlino
Copy link
Author

Initially, I did a 'sudo luarocks install --server=http://rocks.moonscript.org/manifests/leafo lapis' and tried to compile the simple 'hello world' off of the site homepage as web.moon, which is when the dependency issues showed up.

I did get it running just now, but only after running these additional commands:
sudo luarocks install xavante
sudo luarocks install luafilesystem

...the moment of glory...

rick@mintbox ~ $ sudo moon web.moon
Xavante started on port(s) 80

I'm loving Lapis so far, thanks for all your hard work in leading this project forward.

@leafo
Copy link
Owner

leafo commented Apr 28, 2013

The Xavante backend is not documented and most likely broken at this point. I'm going to be removing it. I recommend installing OpenResty and using the command lapis server to start the server: http://leafo.net/lapis/reference.html#creating-an-application-lapis-command-line-tool

@datashaman
Copy link

I had to add luacrypto and lua-cjson to the dependencies to get tests running. Now to get the tests passing... :)

@leafo
Copy link
Owner

leafo commented May 3, 2013

I updated the tests to print a pending message when luacrypto is missing (I recommend it though). As for lua-cjson, that is definitely a requirement, it should be installed when you install lapis via the rockspec.

@mathieujobin
Copy link

luacrypto fails to compile...

luarocks install luacrypto --local
...
src/lcrypto.c: In function ‘luaopen_crypto’:
src/lcrypto.c:1901:19: error: array type has incomplete element type ‘struct luaL_reg’
   struct luaL_reg core[] = {
                   ^

Error: Build error: Failed compiling object src/lcrypto.o

@starius
Copy link
Contributor

starius commented Nov 2, 2015

Try the following command:

$ luarocks install luacrypto 0.3.2-1 --local

See yagop/telegram-bot#241

@mathieujobin
Copy link

thanks, but it looks like it could not be found...

bash$ luarocks install luacrypto 0.3.2-1 --local

Error: No results matching query were found.

bash$ luarocks search luacrypto

Search results:
===============


Rockspecs and source rocks:
---------------------------

luacrypto
   0.3.0.20120524-1 (rockspec) - https://luarocks.org
   0.3.0.20120524-1 (src) - https://luarocks.org
   0.2.0-2 (rockspec) - https://luarocks.org
   0.2.0-2 (src) - https://luarocks.org
   0.2.0-1 (rockspec) - https://luarocks.org
   0.2.0-1 (src) - https://luarocks.org

bash$

I tried the other available version but I am getting same compilation error.

src/lcrypto.c: In function ‘luaopen_crypto’:
src/lcrypto.c:503:19: error: array type has incomplete element type ‘struct
luaL_reg’
   struct luaL_reg core[] = {
                   ^

On Sun, Nov 1, 2015 at 7:44 PM, Boris Nagaev notifications@github.com
wrote:

Try the following command:

$ luarocks install luacrypto 0.3.2-1 --local

See yagop/telegram-bot#241
yagop/telegram-bot#241


Reply to this email directly or view it on GitHub
#6 (comment).

@starius
Copy link
Contributor

starius commented Nov 2, 2015

The official rockspec for luacrypto has the following Lua version line:

dependencies = {
        "lua >= 5.1, < 5.3",
}

That is why luarocks doesn't list this version for Lua 5.3.

I have fixed incompatibilities with Lua 5.3 this issue in my fork of luacrypto and uploaded modified rockspec to gist.

The following command installs luacrypto from my fork. It should work for Lua 5.3.

$ luarocks install https://gist.githubusercontent.com/starius/b20d3e63929ae678c857/raw/4b4499f442337b6f577422364358590bd00c9d48/luacrypto-0.3.2-2.rockspec --local

You can use this workaround until this issue is fixed in the upstream.

@mathieujobin
Copy link

Thanks very much

On Mon, Nov 2, 2015 at 3:50 PM, Boris Nagaev notifications@github.com
wrote:

The official rockspec
https://luarocks.org/manifests/luarocks/luacrypto-0.3.2-1.rockspec for
luacrypto has the following Lua version line:

dependencies = {
"lua >= 5.1, < 5.3",
}

That is why luarocks doesn't list this version for Lua 5.3.

I have fixed
starius/luacrypto@ab1caf2
incompatibilities with Lua 5.3 this issue in my fork of luacrypto
https://github.com/starius/luacrypto and uploaded modified rockspec
https://gist.githubusercontent.com/starius/b20d3e63929ae678c857/raw/4b4499f442337b6f577422364358590bd00c9d48/luacrypto-0.3.2-2.rockspec
to gist.

The following command installs luacrypto from my fork. It should work for
Lua 5.3.

$ luarocks install https://gist.githubusercontent.com/starius/b20d3e63929ae678c857/raw/4b4499f442337b6f577422364358590bd00c9d48/luacrypto-0.3.2-2.rockspec --local

You can use this workaround until this issue is fixed in the upstream
https://github.com/mkottman/luacrypto.


Reply to this email directly or view it on GitHub
#6 (comment).

@TangentFoxy
Copy link
Contributor

Not sure if related, but same error message about missing crypto library that I'm talking about on #560..

@leafo
Copy link
Owner

leafo commented Apr 24, 2018

@Guard13007 there is no longer a reference to the crypto module in the lapis codebase.

  • Are you sure you're using the latest version
  • Are you sure the error isn't from another dependency?

If you can give me the stack trace then I can tell you what's going on

@TangentFoxy
Copy link
Contributor

Ah, pgmoon is requiring it?

/usr/bin/lua: /usr/local/share/lua/5.1/pgmoon/crypto.lua:6: module 'crypto' not found:No LuaRocks module found for crypto
	no field package.preload['crypto']
	no file '/root/.luarocks/share/lua/5.1/crypto.lua'
	no file '/root/.luarocks/share/lua/5.1/crypto/init.lua'
	no file '/usr/local/share/lua/5.1/crypto.lua'
	no file '/usr/local/share/lua/5.1/crypto/init.lua'
	no file './crypto.lua'
	no file '/usr/local/lib/lua/5.1/crypto.lua'
	no file '/usr/local/lib/lua/5.1/crypto/init.lua'
	no file '/usr/share/lua/5.1/crypto.lua'
	no file '/usr/share/lua/5.1/crypto/init.lua'
	no file '/root/.luarocks/lib/lua/5.1/crypto.so'
	no file '/usr/local/lib/lua/5.1/crypto.so'
	no file './crypto.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.1/crypto.so'
	no file '/usr/lib/lua/5.1/crypto.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	/usr/local/share/lua/5.1/pgmoon/crypto.lua:6: in main chunk
	[C]: in function 'require'
	/usr/local/share/lua/5.1/pgmoon/init.lua:269: in function </usr/local/share/lua/5.1/pgmoon/init.lua:267>
	(tail call): ?
	/usr/local/share/lua/5.1/pgmoon/init.lua:211: in function 'connect'
	/usr/local/share/lua/5.1/lapis/db/postgres.lua:58: in function </usr/local/share/lua/5.1/lapis/db/postgres.lua:52>
	(tail call): ?
	(tail call): ?
	(tail call): ?
	...usr/local/share/lua/5.1/lapis/db/postgres/schema.lua:47: in function 'entity_exists'
	/usr/local/share/lua/5.1/lapis/db/migrations.lua:73: in function 'run_migrations'
	/usr/local/share/lua/5.1/lapis/cmd/actions.lua:282: in function </usr/local/share/lua/5.1/lapis/cmd/actions.lua:273>
	(tail call): ?
	(tail call): ?
	(tail call): ?
	...usr/local/lib/luarocks/rocks/lapis/1.7.0-1/bin/lapis:4: in main chunk
	[C]: ?

So is pgmoon failing to request this dependency?

@TangentFoxy
Copy link
Contributor

Note: Forgot to verify lapis version, but it should be latest as it's on a fresh server with fresh luarocks install using sudo luarocks install lapis. I will confirm the version number in a few minutes after fixing a script of my own.

@TangentFoxy
Copy link
Contributor

Lapis version 1.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants