-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow installing rocks locally - fix openssl include #109
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
DEV_ROCKS=busted luacov luacov-coveralls luacheck ldoc | ||
BUSTED_ARGS ?= -v -o gtest | ||
CASSANDRA ?= 3.10 | ||
PROD_ROCKFILE = $(shell ls lua-cassandra-*.rockspec | grep -v dev) | ||
DEV_ROCKFILE = $(shell ls lua-cassandra-*.rockspec | grep dev) | ||
FLAGS ?= | ||
|
||
.PHONY: install dev busted prove test clean coverage lint doc | ||
|
||
install: | ||
@luarocks make | ||
@luarocks make $(PROD_ROCKFILE) | ||
|
||
dev: install | ||
install-dev: | ||
@luarocks $(FLAGS) make $(DEV_ROCKFILE) OPENSSL_DIR=$(OPENSSL_DIR) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you can already specify this with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope :( luarocks ignores it
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather we don't add this new rule to the makefile at all. I'm not sure I understand why we need it. The Makefile is there only to run |
||
|
||
dev: | ||
@for rock in $(DEV_ROCKS) ; do \ | ||
if ! luarocks list | grep $$rock > /dev/null ; then \ | ||
echo $$rock not found, installing via luarocks... ; \ | ||
luarocks install $$rock ; \ | ||
luarocks install $(FLAGS) $$rock ; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is nice to keep 👍 |
||
else \ | ||
echo $$rock already installed, skipping ; \ | ||
fi \ | ||
done; | ||
|
||
busted: | ||
busted: install-dev | ||
@busted $(BUSTED_ARGS) | ||
|
||
prove: | ||
|
@@ -31,7 +37,7 @@ clean: | |
@rm -f luacov.* | ||
@util/clean_ccm.sh | ||
|
||
coverage: clean | ||
coverage: clean install-dev | ||
@busted $(BUSTED_ARGS) --coverage | ||
@util/prove_ccm.sh $(CASSANDRA) | ||
@TEST_COVERAGE_ENABLED=true TEST_NGINX_TIMEOUT=30 prove | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,6 +221,26 @@ The documentation is generated with | |
$ make doc | ||
``` | ||
|
||
#### macOS notes | ||
|
||
## Openssl headers | ||
|
||
Newer versions of macOS don't include the openssl headers by purpose. You'll need to install | ||
them via `brew install openssl` or manually. | ||
|
||
Homebrew openssl headers however don't get symlinked in /usr/local, so you need to tell | ||
luarocks where to find them via `OPENSSL_DIR`. | ||
|
||
``` | ||
OPENSSL_DIR=/usr/local/opt/openssl/ FLAGS='--local' make busted | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto, I don't think this is a good place to teach users how to properly install OpenSSL on macOS. Makes for opinionated setups that this library should not concern itself with... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can remove the reference to macOS, which actually is not strictly relevant since it looks like this problem also happen on some linux distribution. I just wanted to let developers know that the Makefile already supports this and they only need to set an env variable to fix it. Same for your next comment on |
||
|
||
## Install rocks locally | ||
|
||
To install the development dependencies locally instead of in `/usr/local`, set | ||
`FLAGS='--local'`. This will use the tree in the user's home directory. | ||
You might also need to run `eval $(luarocks path --bin)` to add them to your path. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the README is an appropriate place to school users about LuaRocks. That should be something they deal with on their own... |
||
|
||
[Back to TOC](#table-of-contents) | ||
|
||
[Luarocks]: https://luarocks.org | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,9 @@ description = { | |
license = "MIT" | ||
} | ||
dependencies = { | ||
"luabitop" | ||
"luabitop", | ||
"luasec", | ||
"luasocket" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those dependencies are deliberately not included in this rockspec because they are not needed unless the user runs this library in a non-cosocket context (non-OpenResty or an OpenResty context that doesn't support cosocokets) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the be listed in DEV_ROCKS then? They are needed for tests and they don't get installed by anything right now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DEV_ROCKS sounds good! 👍 |
||
} | ||
build = { | ||
type = "builtin", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me without specifying the rockspec:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this changed in luarocks 2.4.x. On my system I had luarocks 2.3 and it fails.
luarocks install luarocks
fixed it.Will revert