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

Doc to install lua-http on macos and lua 5.3 #142

Open
octplane opened this issue Mar 7, 2019 · 12 comments
Open

Doc to install lua-http on macos and lua 5.3 #142

octplane opened this issue Mar 7, 2019 · 12 comments

Comments

@octplane
Copy link

octplane commented Mar 7, 2019

This is probably a known issue, but there is not clear doc on how to do that correctly:

With lua 5.3 from brew, the install command that succeeds on my machine is:

 luarocks install http CRYPTO_DIR=/usr/local/opt/openssl/ CRYPTO_INCDIR=/usr/local/opt/openssl/include OPENSSL_DIR=/usr/local/opt/openssl/ OPENSSL_INCDIR=/usr/local/opt/openssl/include

Thanks for making lua-http!

@daurnimator
Copy link
Owner

The problem is that it changes somewhat regularly and not in a way that is easily coordinated with the lua-http release cycle:

  • it's not lua-http that needs openssl, but lua-http's dependencies
  • there are several different ways to install openssl, even on just OSX
  • until recently, apple shipped openssl themselves (but an old version)
  • brew is quite configurable; and they have moved the location before

So I'm not sure what I can do to avoid having potentially outdated instructions around.

@RyanSquared
Copy link
Contributor

I have absolutely no clue what's up with the openssl situation on macOS to the point where I'm getting a new computer, part of the justification being that I just don't want to deal with it. Unfortunately, it's very much a "per-system" situation.

@octplane
Copy link
Author

Yeah, I actually opened the bug so that people like me (and probably me later) remember this might not be as straightforward as luarocks install http on macOS :)

@daurnimator
Copy link
Owner

One solution (given that you seem to have decided on brew) would be to package lua-http in brew?

@latenitefilms
Copy link

Thanks heaps @octplane ! This issue was very helpful!

@javierfernandes
Copy link

Still does the trick ! Thanks 🙏 !

@daurnimator
Copy link
Owner

Is there anyone that would like to create/submit a brew package for lua-http?

@Lanttcat
Copy link

Lanttcat commented Apr 11, 2022

Update: if you install openssl now, The brew will install openssl@3 on your machine. And then the LuaRocks will install failed by use openssl@3 and error is: Could not find header file for CRYPTO.

This is workaround on my machine:

luarocks install http CRYPTO_DIR=/usr/local/opt/[email protected]/ CRYPTO_INCDIR=/usr/local/opt/[email protected]/include OPENSSL_DIR=/usr/local/opt/[email protected]/ OPENSSL_INCDIR=/usr/local/opt/[email protected]/include

@vvvvv
Copy link

vvvvv commented Oct 26, 2022

For anyone coming here in 2022, this is still an issue.

This is a workaround on my machine macbook m1

luarocks install http CRYPTO_DIR=/opt/homebrew/opt/[email protected] CRYPTO_INCDIR=/opt/homebrew/opt/[email protected]/include OPENSSL_DIR=/opt/homebrew/opt/[email protected] OPENSSL_INCDIR=/opt/homebrew/opt/[email protected]/include

@daurnimator
Copy link
Owner

openssl 1.1 is quite old at this point. consider using a newer release?

@alextes
Copy link

alextes commented Mar 14, 2023

To make this work with a more recent openssl:

brew install openssl
luarocks install http CRYPTO_DIR=/opt/homebrew/opt/openssl@3 OPENSSL_DIR=/opt/homebrew/opt/openssl@3

or the default 1.1

luarocks install http CRYPTO_DIR=/opt/homebrew/opt/[email protected] OPENSSL_DIR=/opt/homebrew/opt/[email protected]

Although from what I gather 1.1 is still widely used openssl themselves would encourage you to upgrade.

from: https://www.openssl.org/source/

Note: The latest stable version is the 3.0 series supported until 7th September 2026. This is also a Long Term Support (LTS) version. The previous LTS version (the 1.1.1 series) is also available and is supported until 11th September 2023. All older versions (including 1.1.0, 1.0.2, 1.0.0 and 0.9.8) are now out of support and should not be used. Users of these older versions are encouraged to upgrade to 3.0 as soon as possible. Extended support for 1.0.2 to gain access to security fixes for that version is available.

With regard to trying to actually improve the situation, during installation one of the steps lists where it was looking for openssl stuff, and does not list the place where homebrew installs the shared openssl things.

Error: Failed installing dependency: https://luarocks.org/cqueues-20200726.54-0.src.rock - Could not find header file for CRYPTO
  No file openssl/crypto.h in /usr/local/include
  No file openssl/crypto.h in /usr/include
  No file openssl/crypto.h in /include
  No file openssl/crypto.h in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
  No file openssl/crypto.h in /usr/local/opt/include

Is that a luarocks or a cqueues issue? One of them is clearly unaware of the location where all macOS users will have their include dir, which is a lot of people! I can open something in one of those repos if someone has the answer.

For this repo I think the natural thing to do is to either note something in the install section or maybe a troubleshooting that mentions install on macOS requires additional steps. Even if only linking this issue. Installing an http lib is after all fairly common 😅 , and this appears to be the most popular option. At the same time, I'd also say it's fair to do nothing until something is fixed upstream. The lib which depends on openssl should know how to find it, not this lib. Nevertheless, this repo will probably face the most stuck end-users.

@daurnimator
Copy link
Owner

One of them is clearly unaware of the location where all macOS users will have their include dir, which is a lot of people!

It's a luarocks configuration issue: you'd need to tell luarocks about where brew is putting things.
As upstream luarocks doesn't really know anything about brew, it's more of a question for whereever you got your luarocks config from.... which is probably brew?
i.e. it's a missing feature of the brew packaging of luarocks; in that it doesn't tell it about how brew works.

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

8 participants