leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.12k stars 247 forks source link

luarocks install lapis did not see installed openssl #766

Open milen-prg opened 1 year ago

milen-prg commented 1 year ago

Please see here: https://github.com/msys2/MINGW-packages/issues/17041#issuecomment-1528812280 I thought that the problem was with MSYS, but not:

I'm on Windows 10 Pro 64 bit, MSYS2/MINGW64,

I try to install there lua rocks:

luaossl luacrypto lapis

The lua packages and mingw-w64-x86_64-openssl are installed, but luarock can't install any lua package with openssl requirements, for example:

mlap@DESKTOP-3SBJLHO MINGW64 ~ $ luarocks install --global luaossl CRYPTO_DIR=/mingw64/ Installing https://luarocks.org/luaossl-20220711-0.src.rock

Error: Could not find library file for CRYPTO No file libssleay32.dll in C:/msys64/mingw64 No file libssleay32.dll in C:/msys64/mingw64/lib No file libssleay32.dll in C:/msys64/mingw64/bin No file libssleay32.dll.a in C:/msys64/mingw64 No file libssleay32.dll.a in C:/msys64/mingw64/lib No file libssleay32.dll.a in C:/msys64/mingw64/bin No file ssleay32.dll.a in C:/msys64/mingw64 No file ssleay32.dll.a in C:/msys64/mingw64/lib No file ssleay32.dll.a in C:/msys64/mingw64/bin No file libssleay32.a in C:/msys64/mingw64 No file libssleay32.a in C:/msys64/mingw64/lib No file libssleay32.a in C:/msys64/mingw64/bin No file ssleay32.dll in C:/msys64/mingw64 No file ssleay32.dll in C:/msys64/mingw64/lib No file ssleay32.dll in C:/msys64/mingw64/bin No file ssleay32.lib in C:/msys64/mingw64 No file ssleay32.lib in C:/msys64/mingw64/lib No file ssleay32.lib in C:/msys64/mingw64/bin No file matching libssleay32.so. in C:/msys64/mingw64 No file matching libssleay32.so. in C:/msys64/mingw64/lib No file matching libssleay32.so.* in C:/msys64/mingw64/bin You may have to install CRYPTO in your system and/or pass CRYPTO_DIR or CRYPTO_LIBDIR to the luarock s command. Example: luarocks install luaossl CRYPTO_DIR=/usr/local

The REPLY from MSYS is:

"The project is trying to link with older openssl libraries. libeay32.dll and ssleay32.dll was replaced with libcrypto.dll and libssl.dll. The issue is not related to luarocks or lua project."

SO, is it possible to use lapis (and all Lua openssl bindings) with new versions of openssl?

knownasbot commented 11 months ago

I know it's an old issue but I want to share some info.

I had the same problem yesterday and tried everything but nothing seemed to work. I even tried compiling OpenSSL source and passing every include folder I could find (based on other issues) and still nothing. I don't know about C stuff, but I think there's something that conflicts with Windows.

So today I decided to try it on WSL (v1; Ubuntu 22.04) with package libssl-dev installed and it worked fine. After spending many hours trying to make it work, I would like to share this little information for anyone who is tired like me trying to do something.

Check also https://github.com/leafo/lapis/issues/489

milen-prg commented 11 months ago

@knownasbot , most of these problems are exactly because they are developed for linux and nobody supports them for windows.

izxyz commented 5 months ago

假设你的OpenSSL路径为“E:\SDK\OpenSSL-Win64”,那么你需要执行下面的操作。 1.创建E:\SDK\OpenSSL-Win64\lib\libeay32.dll的副本,并重命名为libcrypto.dll。 2.创建E:\SDK\OpenSSL-Win64\lib\libssl.dll的副本,名重命名为ssleay32.dll。 3.执行luarocks命令 luarocks install luaossl CRYPTO_DIR=E:\SDK\OpenSSL-Win64 OPENSSL_DIR=E:\SDK\OpenSSL-Win64 --lua-version=5.1。 4.大功告成。

izxyz commented 5 months ago

@knownasbot @milen-prg

karai17 commented 4 months ago

Unsure if this will help on Windows, but when I install Lapis inside of Docker containers, I use the following format:

ARG OPENSSL_DIR="/usr/local/openresty/openssl"
RUN luarocks install lapis \
  CRYPTO_DIR=${OPENSSL_DIR} \
  CRYPTO_INCDIR=${OPENSSL_DIR}/include \
  OPENSSL_DIR=${OPENSSL_DIR} \
  OPENSSL_INCDIR=${OPENSSL_DIR}/include