wahern / luaossl

Most comprehensive OpenSSL module in the Lua universe.
http://25thandclement.com/~william/projects/luaossl.html
Other
140 stars 49 forks source link

Cannot install on Raspbian (ARM on Debian Buster/10) #185

Closed rcarmo closed 3 years ago

rcarmo commented 4 years ago

It seems that the build script does not take into account $MACHTYPE:

pi@lab:~ $ sudo luarocks install luaossl
Installing https://luarocks.org/luaossl-20200709-0.src.rock

Error: Could not find library file for CRYPTO
  No file libcrypto.a in /usr/lib
  No file libcrypto.a in /usr/lib/x86_64-linux-gnu
  No file libcrypto.so in /usr/lib
  No file libcrypto.so in /usr/lib/x86_64-linux-gnu
  No file matching libcrypto.so.* in /usr/lib
  No file matching libcrypto.so.* in /usr/lib/x86_64-linux-gnu
You may have to install CRYPTO in your system and/or pass CRYPTO_DIR or CRYPTO_LIBDIR to the luarocks command.
Example: luarocks install luaossl CRYPTO_DIR=/usr/local
pi@lab:~ $ ls /usr/lib | grep libcrypto
pi@lab:~ $ 
pi@lab:~ $ find /usr -name 'crypto.h'
/usr/include/openssl/crypto.h
pi@lab:~ $ sudo find /usr -name 'libcrypto*.so*'
/usr/lib/arm-linux-gnueabihf/libcrypto++.so
/usr/lib/arm-linux-gnueabihf/libcrypto++.so.6.0.0
/usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1
/usr/lib/arm-linux-gnueabihf/libcrypto++.so.6
/usr/lib/arm-linux-gnueabihf/libcryptopp.so.6
/usr/lib/arm-linux-gnueabihf/libcrypto.so
/usr/lib/arm-linux-gnueabihf/libcryptopp.so

(This is a Raspberry Pi 4 with the 32-bit OS, which is the default)

rcarmo commented 4 years ago

I (finally) had some success by using:

luarocks install luaossl CRYPTO_LIBDIR=/usr/lib/arm-linux-gnueabihf OPENSSL_LIBDIR=/usr/lib/arm-linux-gnueabihf OPENSSL_INCDIR=/usr/include

...but I really think the build should do this automatically for me (if it goes after x86_64-linux-gnu on this machine, something's wrong...)

daurnimator commented 4 years ago

(if it goes after x86_64-linux-gnu on this machine, something's wrong...)

That looks like a luarocks misconfiguration. How did you install luarocks? (perhaps lets move this to a new issue in the luarocks repository?)

rcarmo commented 3 years ago

Hi there! I installed it from the system package repository. And this is the only luarocks package I’ve had trouble with (ever) on this machine, so… I’m not sure it’s about luarocks at all.

On 7 Sep 2020, at 01:23, daurnimator notifications@github.com wrote:

(if it goes after x86_64-linux-gnu on this machine, something's wrong...)

That looks like a luarocks misconfiguration. How did you install luarocks? (perhaps lets move this to a new issue in the luarocks repository?)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wahern/luaossl/issues/185#issuecomment-687945409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC7322Q3YTWDFYS3SQ4KILSEQRYVANCNFSM4Q4UAX6A.

daurnimator commented 3 years ago

Hi there! I installed it from the system package repository. And this is the only luarocks package I’ve had trouble with (ever) on this machine, so… I’m not sure it’s about luarocks at all.

Could you paste e.g. the output of luarocks config? or the contents of /etc/luarocks/config*.lua ?

rcarmo commented 3 years ago

Sure, here you go:

pi@lab:~ $ luarocks config

Error: Please provide a flag for querying configuration values. See '/usr/bin/luarocks help config'.
pi@lab:~ $ luarocks help config

LuaRocks 2.4.2, a module deployment system for Lua

NAME
    /usr/bin/luarocks config - Query information about the LuaRocks configuration.

SYNOPSIS
    /usr/bin/luarocks config <flag>

DESCRIPTION
    --lua-incdir     Path to Lua header files.

    --lua-libdir     Path to Lua library files.

    --lua-ver        Lua version (in major.minor format). e.g. 5.1

    --system-config  Location of the system config file.

    --user-config    Location of the user config file.

    --rock-trees     Rocks trees in use. First the user tree, then the system tree.

SEE ALSO
    '/usr/bin/luarocks help' for general options and configuration.
pi@lab:~ $ luarocks config --lua-libdir 
/usr/local/lib
pi@lab:~ $ luarocks config --lua-incdir
/usr/include/lua5.1
pi@lab:~ $ luarocks config --system-config
/etc/luarocks/config.lua
pi@lab:~ $ cat /etc/luarocks/config.lua
rocks_trees = {
   home..[[/.luarocks]],
   [[/usr/local]]
}
pi@lab:~ $ cat /etc/luarocks/config*.lua
rocks_trees = {
   home..[[/.luarocks]],
   [[/usr/local]]
}

Nothing whatsoever architecture-specific here.

daurnimator commented 3 years ago

Oh, looks like you're using quite an old luarocks (consider upgrading). In that old version could you share the contents of site_config.lua? You may have to search your system for it.

saghul commented 3 years ago

FWIW, I had the same problem and indeed, installing luarocks 3.4.0 solved the problem!

daurnimator commented 3 years ago

Thanks @saghul. Closing due to lack of response from @rcarmo

rcarmo commented 3 years ago

Apologies, I had to move on and use straight C for my solution, and lost track of this until I got a notification for being mentioned. Will try again and come back to this if I still have any issues.